public interface NegotiationParty
AbstractNegotiationParty
to get
more support from the parent class. Parties can do multilateral negotiations.
Notice that 'multilateral' includes 'bilateral'.
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 and do initialization in the init() call.
Immediately after construction of the class, the functiondsf
#init(AbstractUtilitySpace, Deadline, TimeLineInfo, long, AgentID,PersistentDataContainer)
will be called.
The functions in this interface are implemented by competitors in a
competition of agents. All calls to the functions are sand-boxed in an
attempt to ensure the competition will follow the protocols (instead of
crashing). Sand-boxing attempts to protect the rest of the system for
out-of-memory, time-out, throws, and various types of SecurityManager
related issues (eg calling System.exit(int)
) that may occur inside
the implemented party.
The time limits are given below for each of the functions. Some functions are limited to a fixed time limit. Other functions are limited to a deadline as set in the actual settings for the negotiation. In that case, the deadline is a global deadline for which the entire negotiation session must be completed. If the deadline is round based, the session is also time-limited to 180 seconds.
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(NegotiationInfo info)
Initializes the party.
|
java.util.Map<java.lang.String,java.lang.String> |
negotiationEnded(Bid acceptedBid)
This is called to inform the agent that the negotiation has been ended.
|
void |
receiveMessage(AgentID sender,
Action action)
This method is called when another
NegotiationParty chose an
Action . |
void init(NegotiationInfo info)
info
- information about the negotiation that this party is part of.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
. This call is timeboxed by the negotiation deadline
settings.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
. The call must finish
within 1 second.java.util.Map<java.lang.String,java.lang.String> negotiationEnded(Bid acceptedBid)
acceptedBid
- the final accepted bid, or null if no agreement was reached.Map
containing data to log for this agent. null is equal
to returning an empty HashMap. Typically, this info will be
logged by XmlWriteStream.write(String, java.util.Map)