public class AlternatingOfferMajorityVotingProtocol extends MultilateralProtocolAdapter
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.
isAborted
Constructor and Description |
---|
AlternatingOfferMajorityVotingProtocol() |
Modifier and Type | Method and Description |
---|---|
Bid |
getCurrentAgreement(Session session,
java.util.List<NegotiationPartyInternal> parties)
Gets the most recent agreement.
|
int |
getNumberOfAgreeingParties(Session session,
java.util.List<NegotiationPartyInternal> parties)
Gets the number of parties that currently agree to the offer.
|
Round |
getRoundStructure(java.util.List<NegotiationPartyInternal> parties,
Session session)
Get the structure of the current round.
|
boolean |
isFinished(Session session,
java.util.List<NegotiationPartyInternal> parties)
Check if the protocol is done or still busy.
|
afterSession, applyAction, beforeSession, endNegotiation, endNegotiation, exclude, getActionListeners, getExecutor, includeOnly, setExecutor
public AlternatingOfferMajorityVotingProtocol()
public Round getRoundStructure(java.util.List<NegotiationPartyInternal> 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 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 participating