Record Class Coalition.RewardRecord
java.lang.Object
java.lang.Record
com.tnsai.coordination.groups.coalition.Coalition.RewardRecord
- Record Components:
timestamp- when distributedtotalValue- total distributeddistributions- per-agent distributions
- Enclosing interface:
Coalition
public static record Coalition.RewardRecord(Instant timestamp, double totalValue, Map<String,Double> distributions)
extends Record
Reward distribution record.
-
Constructor Summary
ConstructorsConstructorDescriptionRewardRecord(Instant timestamp, double totalValue, Map<String, Double> distributions) Creates an instance of aRewardRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedistributionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.doubleReturns the value of thetotalValuerecord component.
-
Constructor Details
-
RewardRecord
Creates an instance of aRewardRecordrecord class.- Parameters:
timestamp- the value for thetimestamprecord componenttotalValue- the value for thetotalValuerecord componentdistributions- the value for thedistributionsrecord component
-
-
Method Details
-
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. -
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. -
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 '=='. -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
totalValue
public double totalValue()Returns the value of thetotalValuerecord component.- Returns:
- the value of the
totalValuerecord component
-
distributions
Returns the value of thedistributionsrecord component.- Returns:
- the value of the
distributionsrecord component
-