public class AbstractAutomatedAgent
extends java.lang.Object
Constructor and Description |
---|
AbstractAutomatedAgent() |
AbstractAutomatedAgent(AgentTools agentTools)
Constructor
Save a pointer to the AgentTools class
|
Modifier and Type | Method and Description |
---|---|
void |
calculateOfferAgainstOpponent(AutomatedAgentType agentType,
java.lang.String sOpponentType,
int nCurrentTurn)
called to decide which offer to propose the opponent at a given turn
This method is always called when beginning a new turn
You can also call it during the turn if needed
|
void |
calculateResponse(int nMessageType,
int[] CurrentAgreementIdx,
java.lang.String sOriginalMessage)
Called when a message of type:
QUERY, COUNTER_OFFER, OFFER or PROMISE
is received
Note that if you accept a message, the accepted message is saved in the
appropriate structure, so no need to add logic for this.
|
void |
calculateValues(AutomatedAgentType agentType,
int nCurrentTurn)
called to calculate the values of the different possible agreements for the agent
|
void |
commentReceived(java.lang.String sComment)
called whenever we get a comment from the opponent
You can add logic to receiveMessage your agent
|
void |
initialize(AutomatedAgentType agentType,
java.lang.String sOpponentType)
Called before the the nagotiation starts.
|
void |
opponentAgreed(int nMessageType,
int[] CurrentAgreementIdx,
java.lang.String sOriginalMessage)
called whenever the opponent agreed to one of your massages (promise, query, offer or counter offer).
|
void |
opponentRejected(int nMessageType,
int[] CurrentAgreementIdx,
java.lang.String sOriginalMessage)
called whenever the opponent rejected one of your massages (promise, query, offer or counter offer)
|
void |
threatReceived(java.lang.String sThreat)
called whenever we get a threat from the opponent
You can add logic to receiveMessage your agent
|
public AbstractAutomatedAgent()
public AbstractAutomatedAgent(AgentTools agentTools)
agentTools
- - pointer to the AgentTools classpublic void initialize(AutomatedAgentType agentType, java.lang.String sOpponentType)
agentType
- - the automated agentpublic void calculateResponse(int nMessageType, int[] CurrentAgreementIdx, java.lang.String sOriginalMessage)
nMessageType
- - the message typeCurrentAgreementIdx
- - the agreement indicessOriginalMessage
- - the message itself as stringpublic void commentReceived(java.lang.String sComment)
sComment
- -the received commentpublic void threatReceived(java.lang.String sThreat)
sThreat
- - the received threatpublic void opponentAgreed(int nMessageType, int[] CurrentAgreementIdx, java.lang.String sOriginalMessage)
nMessageType
- - the type of massage the oppnent aggreed to, can be
AutomatedAgentMessages.PROMISE, QUERY, OFFER, COUNTER_OFFERCurrentAgreementIdx
- - the indices of the agreement the opponent agreed tosOriginalMessage
- - the original message that was acceptedpublic void opponentRejected(int nMessageType, int[] CurrentAgreementIdx, java.lang.String sOriginalMessage)
nMessageType
- - the type of massage the oppnent rejected, can be
AutomatedAgentMessages.PROMISE, QUERY, OFFER, COUNTER_OFFERCurrentAgreementIdx
- - the indices of the agreement the opponent agreed tosOriginalMessage
- - the original message that was rejectedpublic void calculateOfferAgainstOpponent(AutomatedAgentType agentType, java.lang.String sOpponentType, int nCurrentTurn)
agentType
- - the automated agent's typesOpponentType
- - the opponent's typenCurrentTurn
- - the current turnpublic void calculateValues(AutomatedAgentType agentType, int nCurrentTurn)
agentType
- - the automated agent's typenCurrentTurn
- - the current turn