Class MultiRoundContractNet

java.lang.Object
com.tnsai.coordination.MultiRoundContractNet

public class MultiRoundContractNet extends Object
Multi-round Contract Net Protocol (CNP) implementation.

Extends the basic CNP with multi-round negotiation support:

  1. Call for Proposals (CFP) broadcast
  2. Collect initial proposals
  3. If best proposal not acceptable, request counter-offers
  4. Repeat up to maxRounds times
  5. Accept best proposal

Usage Example


 MultiRoundContractNet cnp = MultiRoundContractNet.builder()
     .manager(managerAgent)
     .contractors(List.of(agent1, agent2, agent3))
     .proposalRequester((contractor, task, round, targetScore, timeout) ->
         messaging.requestProposal(contractor, task, timeout))  // required
     .maxRounds(3)
     .improvementThreshold(0.1)  // Expect 10% improvement each round
     .acceptanceThreshold(0.5)   // Accept if score < 0.5
     .build();

 NegotiationResult result = cnp.negotiate(task);
 
Since:
0.0.2
See Also: