Record Class CoalitionResult.MemberContribution
java.lang.Object
java.lang.Record
com.tnsai.coordination.groups.coalition.CoalitionResult.MemberContribution
- Record Components:
agentId- agent identifieragentName- agent nameoutput- agent's outputsuccess- whether agent succeededcontributionScore- contribution score (0.0 to 1.0)durationMs- execution timecommitted- whether agent committed during negotiation
- Enclosing class:
CoalitionResult
public static record CoalitionResult.MemberContribution(String agentId, String agentName, String output, boolean success, double contributionScore, long durationMs, boolean committed)
extends Record
Individual member contribution to the coalition.
-
Constructor Summary
ConstructorsConstructorDescriptionMemberContribution(String agentId, String agentName, String output, boolean success, double contributionScore, long durationMs, boolean committed) Creates an instance of aMemberContributionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.Returns the value of theagentNamerecord component.booleanReturns the value of thecommittedrecord component.doubleReturns the value of thecontributionScorerecord component.longReturns the value of thedurationMsrecord component.final booleanIndicates whether some other object is "equal to" this one.Creates a failed contribution.final inthashCode()Returns a hash code value for this object.output()Returns the value of theoutputrecord component.booleansuccess()Returns the value of thesuccessrecord component.Creates a successful contribution.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MemberContribution
public MemberContribution(String agentId, String agentName, String output, boolean success, double contributionScore, long durationMs, boolean committed) Creates an instance of aMemberContributionrecord class.- Parameters:
agentId- the value for theagentIdrecord componentagentName- the value for theagentNamerecord componentoutput- the value for theoutputrecord componentsuccess- the value for thesuccessrecord componentcontributionScore- the value for thecontributionScorerecord componentdurationMs- the value for thedurationMsrecord componentcommitted- the value for thecommittedrecord component
-
-
Method Details
-
success
public static CoalitionResult.MemberContribution success(String agentId, String agentName, String output, double score, long durationMs) Creates a successful contribution. -
failure
public static CoalitionResult.MemberContribution failure(String agentId, String agentName, String error, long durationMs, boolean committed) Creates a failed contribution. -
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 '=='. -
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
agentName
Returns the value of theagentNamerecord component.- Returns:
- the value of the
agentNamerecord component
-
output
Returns the value of theoutputrecord component.- Returns:
- the value of the
outputrecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
contributionScore
public double contributionScore()Returns the value of thecontributionScorerecord component.- Returns:
- the value of the
contributionScorerecord component
-
durationMs
public long durationMs()Returns the value of thedurationMsrecord component.- Returns:
- the value of the
durationMsrecord component
-
committed
public boolean committed()Returns the value of thecommittedrecord component.- Returns:
- the value of the
committedrecord component
-