Record Class SegregationModel.GridState
java.lang.Object
java.lang.Record
org.episteme.social.sociology.SegregationModel.GridState
- All Implemented Interfaces:
Serializable
- Enclosing class:
SegregationModel
public static record SegregationModel.GridState(int step, SegregationModel.AgentType[][] grid, Real segregationIndex, Real happinessRate, int moves)
extends Record
implements Serializable
Represents a snapshot of the grid at a specific simulation step.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGridState(int step, SegregationModel.AgentType[][] grid, Real segregationIndex, Real happinessRate, int moves) Creates an instance of aGridStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.grid()Returns the value of thegridrecord component.Returns the value of thehappinessRaterecord component.final inthashCode()Returns a hash code value for this object.intmoves()Returns the value of themovesrecord component.Returns the value of thesegregationIndexrecord component.intstep()Returns the value of thesteprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
GridState
public GridState(int step, SegregationModel.AgentType[][] grid, Real segregationIndex, Real happinessRate, int moves) Creates an instance of aGridStaterecord class.- Parameters:
step- the value for thesteprecord componentgrid- the value for thegridrecord componentsegregationIndex- the value for thesegregationIndexrecord componenthappinessRate- the value for thehappinessRaterecord componentmoves- the value for themovesrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
step
public int step()Returns the value of thesteprecord component.- Returns:
- the value of the
steprecord component
-
grid
Returns the value of thegridrecord component.- Returns:
- the value of the
gridrecord component
-
segregationIndex
Returns the value of thesegregationIndexrecord component.- Returns:
- the value of the
segregationIndexrecord component
-
happinessRate
Returns the value of thehappinessRaterecord component.- Returns:
- the value of the
happinessRaterecord component
-
moves
public int moves()Returns the value of themovesrecord component.- Returns:
- the value of the
movesrecord component
-