Package com.tnsai.coordination.auction
Class Auction
java.lang.Object
com.tnsai.coordination.auction.Auction
Multi-agent auction mechanism supporting various auction types.
Supported auction types:
Auction.Type.ENGLISH- Ascending price, agents outbid each otherAuction.Type.DUTCH- Descending price, first to accept winsAuction.Type.SEALED_BID- Single sealed bid, highest wins at bid priceAuction.Type.VICKREY- Single sealed bid, highest wins at second-highest price
Example usage:
AuctionResult result = Auction.builder()
.type(Auction.Type.VICKREY)
.task("Translate document to French")
.bidders(List.of(agent1, agent2, agent3))
.bidStrategy((agent, task, price, round, prev) -> {
// Parse agent's bid from LLM response
String response = agent.chat("Bid on: " + task + " (current: " + price + ")");
return Double.parseDouble(response.trim());
})
.build()
.execute();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumSupported auction types. -
Method Summary
Modifier and TypeMethodDescriptionstatic Auction.Builderbuilder()execute()Executes the auction synchronously.Executes the auction asynchronously.
-
Method Details
-
execute
Executes the auction synchronously. -
executeAsync
Executes the auction asynchronously. -
builder
-