public class AlternatingOfferConsensusProtocol extends MultilateralProtocolAdapter
Round 1: Each agent makes their own offer. Round 2: Each agent votes (accept/reject) for each offer on the table. If there is one offer that everyone accepts, the negotiation end with this offer. Otherwise, the process continues until reaching deadline or agreement.
isAborted
Constructor and Description |
---|
AlternatingOfferConsensusProtocol() |
Modifier and Type | Method and Description |
---|---|
Round |
createRound()
factory function.
|
Turn |
createTurn(NegotiationPartyInternal party,
java.lang.Class<? extends Action> class1)
factory function.
|
Turn |
createTurn(NegotiationPartyInternal votingParty,
java.util.Collection<java.lang.Class<? extends Action>> acceptOrReject)
factory function.
|
java.util.Map<NegotiationPartyInternal,java.util.List<NegotiationPartyInternal>> |
getActionListeners(java.util.List<NegotiationPartyInternal> parties)
Get a map of parties that are listening to each other's response
|
Bid |
getCurrentAgreement(Session session,
java.util.List<NegotiationPartyInternal> parties)
Gets the current agreement if any.
|
int |
getNumberOfAgreeingParties(Session session,
java.util.List<NegotiationPartyInternal> parties)
Gets the maximum number of vote this protocol found.
|
Round |
getRoundStructure(java.util.List<NegotiationPartyInternal> parties,
Session session)
Get the round structure used by this algorithm.
|
boolean |
isFinished(Session session,
java.util.List<NegotiationPartyInternal> parties)
Check if the protocol is done or still busy.
|
afterSession, applyAction, beforeSession, endNegotiation, endNegotiation, exclude, getExecutor, includeOnly, setExecutor
public Turn createTurn(NegotiationPartyInternal votingParty, java.util.Collection<java.lang.Class<? extends Action>> acceptOrReject)
votingParty
- acceptOrReject
- public Turn createTurn(NegotiationPartyInternal party, java.lang.Class<? extends Action> class1)
party
- class1
- public Round createRound()
public Round getRoundStructure(java.util.List<NegotiationPartyInternal> parties, Session session)
Round 1: Each agent makes their own offer. Round 2: Each agent votes (accept/reject) for each offer on the table.
getRoundStructure
in interface MultilateralProtocol
getRoundStructure
in class MultilateralProtocolAdapter
parties
- The parties currently participatingsession
- The complete session historypublic boolean isFinished(Session session, java.util.List<NegotiationPartyInternal> parties)
SessionManager
will not start a new
.Round
after the current one. It will however
finish all the turns described in the
getRoundStructure(java.util.List, negotiator.session.Session)
method.isFinished
in interface MultilateralProtocol
isFinished
in class MultilateralProtocolAdapter
session
- the current state of this sessionpublic Bid getCurrentAgreement(Session session, java.util.List<NegotiationPartyInternal> parties)
getCurrentAgreement
in interface MultilateralProtocol
getCurrentAgreement
in class MultilateralProtocolAdapter
session
- The complete session history up to this pointparties
- The parties involved in the current negotiationpublic int getNumberOfAgreeingParties(Session session, java.util.List<NegotiationPartyInternal> parties)
getNumberOfAgreeingParties
in interface MultilateralProtocol
getNumberOfAgreeingParties
in class MultilateralProtocolAdapter
session
- the current state of this sessionparties
- The parties currently participatingpublic java.util.Map<NegotiationPartyInternal,java.util.List<NegotiationPartyInternal>> getActionListeners(java.util.List<NegotiationPartyInternal> parties)
getActionListeners
in interface MultilateralProtocol
getActionListeners
in class MultilateralProtocolAdapter
parties
- The parties involved in the current negotiationNegotiationParty
that is responding to
a
NegotiationParty.chooseAction(java.util.List)
event, and the value is a list of
NegotiationParty
that are listening to
that key party's response.