Package com.tnsai.coordination.auction
Record Class AuctionResult
java.lang.Object
java.lang.Record
com.tnsai.coordination.auction.AuctionResult
- Record Components:
success- whether the auction produced a winnerwinner- the winning agent (null if no winner)winningBid- the winning bid (null if no winner)payPrice- the price the winner pays (may differ from bid in Vickrey)allBids- all bids submitted during the auctionrounds- number of rounds executeddurationMs- total auction durationreason- failure reason if unsuccessful
public record AuctionResult(boolean success, com.tnsai.agents.Agent winner, Bid winningBid, double payPrice, List<Bid> allBids, int rounds, long durationMs, String reason)
extends Record
Result of an auction execution.
-
Constructor Summary
ConstructorsConstructorDescriptionAuctionResult(boolean success, com.tnsai.agents.Agent winner, Bid winningBid, double payPrice, List<Bid> allBids, int rounds, long durationMs, String reason) Creates an instance of aAuctionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionallBids()Returns the value of theallBidsrecord component.longReturns the value of thedurationMsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static AuctionResultdoublepayPrice()Returns the value of thepayPricerecord component.reason()Returns the value of thereasonrecord component.introunds()Returns the value of theroundsrecord component.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.com.tnsai.agents.Agentwinner()Returns the value of thewinnerrecord component.Returns the value of thewinningBidrecord component.static AuctionResultwon(com.tnsai.agents.Agent winner, Bid winningBid, double payPrice, List<Bid> allBids, int rounds, long durationMs)
-
Constructor Details
-
AuctionResult
public AuctionResult(boolean success, com.tnsai.agents.Agent winner, Bid winningBid, double payPrice, List<Bid> allBids, int rounds, long durationMs, String reason) Creates an instance of aAuctionResultrecord class.- Parameters:
success- the value for thesuccessrecord componentwinner- the value for thewinnerrecord componentwinningBid- the value for thewinningBidrecord componentpayPrice- the value for thepayPricerecord componentallBids- the value for theallBidsrecord componentrounds- the value for theroundsrecord componentdurationMs- the value for thedurationMsrecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
won
public static AuctionResult won(com.tnsai.agents.Agent winner, Bid winningBid, double payPrice, List<Bid> allBids, int rounds, long durationMs) -
noWinner
-
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 '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
winner
public com.tnsai.agents.Agent winner()Returns the value of thewinnerrecord component.- Returns:
- the value of the
winnerrecord component
-
winningBid
Returns the value of thewinningBidrecord component.- Returns:
- the value of the
winningBidrecord component
-
payPrice
public double payPrice()Returns the value of thepayPricerecord component.- Returns:
- the value of the
payPricerecord component
-
allBids
Returns the value of theallBidsrecord component.- Returns:
- the value of the
allBidsrecord component
-
rounds
public int rounds()Returns the value of theroundsrecord component.- Returns:
- the value of the
roundsrecord component
-
durationMs
public long durationMs()Returns the value of thedurationMsrecord component.- Returns:
- the value of the
durationMsrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-