public interface NegotiationParty
AbstractNegotiationParty
to get
more support from the parent class. Parties can do multilateral negotiations.
Notice that 'multilateral' includes 'bilateral'.
In an actual negotiation, usually all time that NegotiationParty
s
spend in their code, including the time spent in their constructor and init
calls, is subtracted from the total available negotiation time.
Your implementation must adhere to the protocol that it specifies in
getProtocol()
. If it doesn't, it may be kicked from the negotiation
at runtime.
Implementors of this class must have a public no-argument constructor. In fact we recommend not to implement any constructor at all.
Immediately after construction of any class implementing this, the function
init(AbstractUtilitySpace, Deadline, TimeLineInfo, long, AgentID)
MUST be called by the creator of the NegotiationParty.
Modifier and Type | Method and Description |
---|---|
Action |
chooseAction(java.util.List<java.lang.Class<? extends Action>> possibleActions)
When this function is called, it is expected that the Party chooses one
of the actions from the possible action list and returns an instance of
the chosen action.
|
java.lang.String |
getDescription() |
java.lang.Class<? extends MultilateralProtocol> |
getProtocol()
Get the protocol that this party supports.
|
void |
init(AbstractUtilitySpace utilSpace,
Deadline deadline,
TimeLineInfo timeline,
long randomSeed,
AgentID agentID)
Initializes the party.
|
void |
receiveMessage(AgentID sender,
Action action)
This method is called when another
NegotiationParty chose an
Action . |
void init(AbstractUtilitySpace utilSpace, Deadline deadline, TimeLineInfo timeline, long randomSeed, AgentID agentID)
utilSpace
- (a copy of/readonly version of) the
AbstractUtilitySpace
to be used for this session.deadline
- The deadline used for this negotiation.timeline
- The TimeLineInfo
about current session.randomSeed
- A random seed that can be used for creating "consistent
random" behaviour.agentID
- The agent's ID.Action chooseAction(java.util.List<java.lang.Class<? extends Action>> possibleActions)
possibleActions
- List of all actions possible.Action
.void receiveMessage(AgentID sender, Action action)
NegotiationParty
chose an
Action
.sender
- The initiator of the action.This is either the AgentID, or
null if the sender is not an agent (e.g., the protocol).action
- The action performedjava.lang.String getDescription()
java.lang.Class<? extends MultilateralProtocol> getProtocol()
MultilateralProtocol
, usually
StackedAlternatingOffersProtocol
.