public class AlternatingOfferConsensusProtocol extends ProtocolAdapter
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.
Constructor and Description |
---|
AlternatingOfferConsensusProtocol() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<NegotiationParty,java.util.List<NegotiationParty>> |
getActionListeners(java.util.List<NegotiationParty> parties)
Get a map of parties that are listening to each other's response
|
Bid |
getCurrentAgreement(Session session,
java.util.List<NegotiationParty> parties)
Gets the current agreement if any.
|
int |
getNumberOfAgreeingParties(Session session,
java.util.List<NegotiationParty> parties)
Gets the maximum number of vote this protocol found.
|
Round |
getRoundStructure(java.util.List<NegotiationParty> parties,
Session session)
Get the round structure used by this algorithm.
|
boolean |
isFinished(Session session,
java.util.List<NegotiationParty> parties)
Check if the protocol is done or still busy.
|
afterSession, applyAction, beforeSession, exclude, includeOnly
public Round getRoundStructure(java.util.List<NegotiationParty> 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 Protocol
getRoundStructure
in class ProtocolAdapter
parties
- The parties currently participatingsession
- The complete session historypublic boolean isFinished(Session session, java.util.List<NegotiationParty> 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 Protocol
isFinished
in class ProtocolAdapter
session
- the current state of this sessionpublic Bid getCurrentAgreement(Session session, java.util.List<NegotiationParty> parties)
getCurrentAgreement
in interface Protocol
getCurrentAgreement
in class ProtocolAdapter
session
- The complete session history up to this pointparties
- The parties involved in the current negotiationpublic int getNumberOfAgreeingParties(Session session, java.util.List<NegotiationParty> parties)
getNumberOfAgreeingParties
in interface Protocol
getNumberOfAgreeingParties
in class ProtocolAdapter
session
- the current state of this sessionparties
- The parties currently participatingpublic java.util.Map<NegotiationParty,java.util.List<NegotiationParty>> getActionListeners(java.util.List<NegotiationParty> parties)
getActionListeners
in interface Protocol
getActionListeners
in class ProtocolAdapter
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.