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 Details

    • SimulationState

      public SimulationState(int step, Map<String,Real> opinions, Real polarization, Real consensus, int clusters)
      Creates an instance of a SimulationState record class.
      Parameters:
      step - the value for the step record component
      opinions - the value for the opinions record component
      polarization - the value for the polarization record component
      consensus - the value for the consensus record component
      clusters - the value for the clusters record component
  • Method Details

    • getPolarizationValue

      public double getPolarizationValue()
    • getConsensusValue

      public double getConsensusValue()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • step

      public int step()
      Returns the value of the step record component.
      Returns:
      the value of the step record component
    • opinions

      public Map<String,Real> opinions()
      Returns the value of the opinions record component.
      Returns:
      the value of the opinions record component
    • polarization

      public Real polarization()
      Returns the value of the polarization record component.
      Returns:
      the value of the polarization record component
    • consensus

      public Real consensus()
      Returns the value of the consensus record component.
      Returns:
      the value of the consensus record component
    • clusters

      public int clusters()
      Returns the value of the clusters record component.
      Returns:
      the value of the clusters record component