public interface NegotiationParty
NegotiationParty
s spend in their code, including the
time spent in their constructor and init calls, is subtracting from the total
available time.
#init(UtilitySpace, Deadline, Timeline, long)
.
NegotiationParty
replaces Agent
.
If you are using a protocol that inherits from MultilateralProtocol
you should also use NegotiationParty
and not Agent
.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(UtilitySpace utilSpace,
Deadline deadline,
TimeLineInfo timeline,
long randomSeed,
AgentID agentID)
This is the first call made to a NegotiationParty after its
instantiation.
|
void |
receiveMessage(AgentID sender,
Action arguments)
This method is called when another
NegotiationParty chose an
Action . |
void init(UtilitySpace utilSpace, Deadline deadline, TimeLineInfo timeline, long randomSeed, AgentID agentID)
utilSpace
- (a copy of/readonly version of) the UtilitySpace
to be
used for this session.timeline
- The TimeLineInfo
about current session.agentID
- the AgentID
.java.lang.RuntimeException
- if init fails.Action chooseAction(java.util.List<java.lang.Class<? extends Action>> possibleActions)
possibleActions
- List of all actions possible.Action
.void receiveMessage(AgentID sender, Action arguments)
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).arguments
- The action performedjava.lang.String getDescription()
java.lang.Class<? extends MultilateralProtocol> getProtocol()
MultilateralProtocol
, usually
StackedAlternatingOffersProtocol
.