public class AlternatingOfferMajorityVotingProtocol extends ProtocolAdapter
Round 1 (offers): Each agent makes an offer Round 2 (voting): Each agent votes for each offer on the table The offer that is supported by the most parties, will stay on the table. If a new offer has more supporting parties, it overwrites the old offer. This protocol always has some agreement. When deadline reached, the most recent agreement will be considered the final agreement.
Constructor and Description |
---|
AlternatingOfferMajorityVotingProtocol() |
Modifier and Type | Method and Description |
---|---|
Bid |
getCurrentAgreement(Session session,
java.util.List<NegotiationParty> parties)
Gets the most recent agreement.
|
int |
getNumberOfAgreeingParties(Session session,
java.util.List<NegotiationParty> parties)
Gets the number of parties that currently agree to the offer.
|
Round |
getRoundStructure(java.util.List<NegotiationParty> parties,
Session session)
Get the structure of the current round.
|
boolean |
isFinished(Session session,
java.util.List<NegotiationParty> parties)
Check if the protocol is done or still busy.
|
afterSession, applyAction, beforeSession, exclude, getActionListeners, includeOnly
public AlternatingOfferMajorityVotingProtocol()
public Round getRoundStructure(java.util.List<NegotiationParty> parties, Session session)
NegotiationParty
and the complete .Session
which can be used to diversify the round
structure at some point during the session.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 participating