Record Class OpinionDynamics.SimulationState
java.lang.Object
java.lang.Record
org.episteme.social.sociology.OpinionDynamics.SimulationState
- All Implemented Interfaces:
Serializable
- Enclosing class:
OpinionDynamics
public static record OpinionDynamics.SimulationState(int step, Map<String,Real> opinions, Real polarization, Real consensus, int clusters)
extends Record
implements Serializable
Captures the state of the simulation at a specific step.
- Since:
- 1.0
- Version:
- 1.2
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintclusters()Returns the value of theclustersrecord component.Returns the value of theconsensusrecord component.final booleanIndicates whether some other object is "equal to" this one.doubledoublefinal inthashCode()Returns a hash code value for this object.opinions()Returns the value of theopinionsrecord component.Returns the value of thepolarizationrecord component.intstep()Returns the value of thesteprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimulationState
public SimulationState(int step, Map<String, Real> opinions, Real polarization, Real consensus, int clusters) Creates an instance of aSimulationStaterecord class.- Parameters:
step- the value for thesteprecord componentopinions- the value for theopinionsrecord componentpolarization- the value for thepolarizationrecord componentconsensus- the value for theconsensusrecord componentclusters- the value for theclustersrecord component
-
-
Method Details
-
getPolarizationValue
public double getPolarizationValue() -
getConsensusValue
public double getConsensusValue() -
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
-
opinions
-
polarization
Returns the value of thepolarizationrecord component.- Returns:
- the value of the
polarizationrecord component
-
consensus
Returns the value of theconsensusrecord component.- Returns:
- the value of the
consensusrecord component
-
clusters
public int clusters()Returns the value of theclustersrecord component.- Returns:
- the value of the
clustersrecord component
-