Record Class OpinionDynamics.Agent
java.lang.Object
java.lang.Record
org.episteme.social.sociology.OpinionDynamics.Agent
- Record Components:
id- unique identifieropinion- current opinion value (-1.0 to 1.0)stubbornness- resistance to change (0.0 to 1.0)neighbors- list of connected agent IDs
- All Implemented Interfaces:
Serializable
- Enclosing class:
OpinionDynamics
public static record OpinionDynamics.Agent(String id, Real opinion, Real stubbornness, List<String> neighbors)
extends Record
implements Serializable
Represents a single agent in the network with a specific opinion and stubbornness.
- Since:
- 1.0
- Version:
- 1.2
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theneighborsrecord component.opinion()Returns the value of theopinionrecord component.Returns the value of thestubbornnessrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Agent
-
Agent
Creates an instance of aAgentrecord class.- Parameters:
id- the value for theidrecord componentopinion- the value for theopinionrecord componentstubbornness- the value for thestubbornnessrecord componentneighbors- the value for theneighborsrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
id
-
opinion
-
stubbornness
Returns the value of thestubbornnessrecord component.- Returns:
- the value of the
stubbornnessrecord component
-
neighbors
-