public class StackedAlternatingOffersProtocol extends DefaultMultilateralProtocol
The first agent makes an offer Other agents can accept or make a counter-offer If no agent makes a counter-offer, the negotiation end with this offer. Otherwise, the process continues until reaching deadline or agreement.
isAborted
Constructor and Description |
---|
StackedAlternatingOffersProtocol() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<NegotiationParty,java.util.List<Action>> |
beforeSession(Session session,
java.util.List<NegotiationParty> parties)
This will get called just before the session starts.
|
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.
|
Bid |
getCurrentAgreement(Session session,
java.util.List<NegotiationParty> parties)
Will return the current 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)
Defines the round structure.
|
boolean |
isFinished(Session session,
java.util.List<NegotiationParty> parties)
If all agents accept the most recent offer, then this negotiation ends.
|
afterSession, applyAction, endNegotiation, endNegotiation, exclude, includeOnly, listenToAll, listenToNone
public Round getRoundStructure(java.util.List<NegotiationParty> parties, Session session)
The first agent makes an offer Other agents can accept or make a counter-offer
getRoundStructure
in interface MultilateralProtocol
getRoundStructure
in class DefaultMultilateralProtocol
parties
- The parties currently participatingsession
- The complete session historypublic Bid getCurrentAgreement(Session session, java.util.List<NegotiationParty> parties)
getCurrentAgreement
in interface MultilateralProtocol
getCurrentAgreement
in class DefaultMultilateralProtocol
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)
DefaultMultilateralProtocol
getNumberOfAgreeingParties
in interface MultilateralProtocol
getNumberOfAgreeingParties
in class DefaultMultilateralProtocol
session
- the current state of this sessionparties
- The parties currently participatingpublic boolean isFinished(Session session, java.util.List<NegotiationParty> parties)
isFinished
in interface MultilateralProtocol
isFinished
in class DefaultMultilateralProtocol
session
- the current state of this sessionparties
- all the parties involved in the negotiationpublic java.util.Map<NegotiationParty,java.util.List<NegotiationParty>> getActionListeners(java.util.List<NegotiationParty> parties)
getActionListeners
in interface MultilateralProtocol
getActionListeners
in class DefaultMultilateralProtocol
parties
- The parties involved in the current negotiationpublic java.util.Map<NegotiationParty,java.util.List<Action>> beforeSession(Session session, java.util.List<NegotiationParty> parties) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, NegotiationPartyTimeoutException
DefaultMultilateralProtocol
beforeSession
in interface MultilateralProtocol
beforeSession
in class DefaultMultilateralProtocol
session
- The session instance that will be used for the sessionparties
- The parties that will participate in the sessionjava.lang.InterruptedException
java.util.concurrent.ExecutionException
NegotiationPartyTimeoutException