public class AgentTools
extends java.lang.Object
Constructor and Description |
---|
AgentTools(AutomatedAgent agent)
Constructor
Save a pointer to the AutomatedAgent class
|
Modifier and Type | Method and Description |
---|---|
void |
acceptMessage(java.lang.String sOriginalMessage)
Called when you want to accept a message
|
void |
calculateNextTurnOffer()
calculate the selected offer the agent will propose
in the following turn
|
void |
calculateResponse(int messageType,
int[] currentAgreementIdx,
java.lang.String message)
Calculating the response to a given proposal.
|
int[] |
getAcceptedAgreementIdx() |
double |
getAcceptedAgreementsValue() |
java.lang.String |
getAgentSide() |
double |
getAgreementTimeEffect(AutomatedAgentType agentType)
Return the time effect for the entire agreement
|
double |
getAgreementValue(AutomatedAgentType agentType,
int[] CurrentAgreementIdx,
int nCurrentTurn) |
double |
getAgreementValue(int[] currentAgreementIdx) |
java.lang.String |
getBestAgreementStr(AutomatedAgentType agentType)
Return the best agreement as string
|
double |
getBestAgreementValue(AutomatedAgentType agentType)
Return the best agreement value for a given agent
|
int |
getCurrentTurn()
Get the current turn number
|
double |
getCurrentTurnAutomatedAgentValue() |
AutomatedAgentType |
getCurrentTurnSideAgentType(java.lang.String sideName,
int type)
Get the opponent's side
|
int |
getMaxValuePerIssue(AutomatedAgentType agentType,
int issueNum)
return the maximal value for the agent for issue i
|
java.lang.String |
getMessageByIndices(int[] currentAgreementIdx) |
int[] |
getMessageIndicesByMessage(java.lang.String currentAgreementStr) |
void |
getNextAgreement(int totalIssuesNum,
int[] currentAgreementIdx,
int[] maxIssueValues)
Iterator for going over all possible agreements
|
double |
getNextTurnAutomatedAgentValue() |
double |
getNextTurnOfferValue() |
AutomatedAgentType |
getNextTurnSideAgentType(java.lang.String sideName,
int type)
Get the opponent's side
|
double |
getOptOutValue(AutomatedAgentType agentType)
Return the opting out value for a given agent
|
double |
getSecondPerTurn() |
java.lang.String |
getSelectedOffer() |
double |
getSelectedOfferValue() |
boolean |
getSendOfferFlag() |
double |
getSQValue(AutomatedAgentType agentType)
Return the SQ value for a given agent
|
int |
getTotalAgreements(AutomatedAgentType agentType) |
int |
getTotalIssues(AutomatedAgentType agentType) |
int |
getTurnsNumber()
Get the total number of turns in the negotiation
|
java.lang.String |
getWorstAgreementStr(AutomatedAgentType agentType)
Return the worst agreement as a String
|
double |
getWorstAgreementValue(AutomatedAgentType agentType)
Return the worst agreement for a given agent
|
void |
initializeBestAgreement(AutomatedAgentType agentType)
Initializes the best agreement -
inits the indices and sets minimal value
|
void |
initializeWorstAgreement(AutomatedAgentType agentType)
Initializes the worst agreement -
inits the indices and sets maximal value
|
void |
optOut() |
void |
rejectMessage(java.lang.String sOriginalMessage)
Called when you want to reject a message
|
void |
sendComment(java.lang.String sMessage)
Called when you want to send a comment
|
void |
sendCounterOffers(int[] currentAgreementIdx)
Called when you want to send a counter offer
|
void |
sendMessage(int nMessageType,
int[] currentAgreementIdx)
Called when you want to send a message of type offer, counter offer, promise or query
|
void |
sendMessage(int nMessageType,
java.lang.String sMessage)
Called when you want to send a message of type offer, counter offer, promise or query
|
void |
sendOffer(java.lang.String sOffer)
Called when you want to send an offer
|
void |
sendPromise(int[] currentAgreementIdx)
Called when you want to send a promise
|
void |
sendQuery(int[] currentAgreementIdx)
Called when you want to send a query
|
void |
sendThreat(java.lang.String sMessage)
Called when you want to send a threat
|
void |
setAutomatedAgentType(java.lang.String side)
Set the automated agent type
Possible types: COMPROMISE_TYPE, SHORT_TERM_TYPE and LONG_TERM_TYPE
|
void |
setBestAgreementIndices(AutomatedAgentType agentType,
int[] currentAgreementIdx)
Sets the best agreement indices for a given agent
|
void |
setBestAgreementValue(AutomatedAgentType agentType,
double value)
Sets the best agreement value for a given agent
|
void |
setCurrentTurnAgreementString(java.lang.String agreementStr)
Sets the String of the selected offer for the current turn
|
void |
setCurrentTurnAutomatedAgentValue(double agreementValue)
Sets the value of the selected offer for the current turn
|
void |
setCurrentTurnOpponentSelectedValue(double agreementValue)
Sets the value of the selected offer for the current turn
for the opponent
|
void |
setNextTurnAgreementString(java.lang.String agreementStr)
Sets the String of the selected offer for the following turn
|
void |
setNextTurnAutomatedAgentSelectedValue(double agreementValue)
Sets the value of the selected offer for the following turn
|
void |
setNextTurnOpponentSelectedValue(double agreementValue)
Sets the value of the selected offer for the following turn
for the opponent
|
void |
setNextTurnOpponentType(int type)
Sets the side of the opponent (Side A or B)
|
void |
setSendOfferFlag(boolean flag)
Sets the boolean flag of sending offers/queries/promises
|
void |
setWorstAgreementIndices(AutomatedAgentType agentType,
int[] currentAgreementIdx)
Sets the worst agreement indices for a given agent
|
void |
setWorstAgreementValue(AutomatedAgentType agentType,
double value)
Sets the worst agreement value for a given agent
|
public AgentTools(AutomatedAgent agent)
agent
- - pointer to the AutomatedAgent classpublic void acceptMessage(java.lang.String sOriginalMessage)
sOriginalMessage
- - the message to be acceptedpublic void rejectMessage(java.lang.String sOriginalMessage)
sOriginalMessage
- - the message to be rejectedpublic void sendMessage(int nMessageType, int[] currentAgreementIdx)
currentAgreementIdx
- - the indices of the messagepublic void optOut()
public void sendMessage(int nMessageType, java.lang.String sMessage)
sMessage
- - the message as a Stringpublic void sendOffer(java.lang.String sOffer)
sOffer
- - the offer to be sentpublic void sendQuery(int[] currentAgreementIdx)
currentAgreementIdx
- - the indices of the querypublic void sendPromise(int[] currentAgreementIdx)
currentAgreementIdx
- - the indices of the promisepublic void sendCounterOffers(int[] currentAgreementIdx)
currentAgreementIdx
- - the indices of the counter offerpublic void sendComment(java.lang.String sMessage)
sMessage
- - the comment to be sentpublic void sendThreat(java.lang.String sMessage)
sMessage
- - the threat to be sentpublic int getTurnsNumber()
public int getCurrentTurn()
public double getAgreementValue(AutomatedAgentType agentType, int[] CurrentAgreementIdx, int nCurrentTurn)
agentType
- - the agent's typeCurrentAgreementIdx
- - the agreement indicesnCurrentTurn
- - the current turn for calculationspublic java.lang.String getBestAgreementStr(AutomatedAgentType agentType)
agentType
- - the agent's typepublic double getBestAgreementValue(AutomatedAgentType agentType)
agentType
- - the agent's typepublic java.lang.String getWorstAgreementStr(AutomatedAgentType agentType)
agentType
- - the agent's typepublic double getWorstAgreementValue(AutomatedAgentType agentType)
agentType
- - the agent's typepublic void setBestAgreementValue(AutomatedAgentType agentType, double value)
agentType
- - the agent's typevalue
- - the valuepublic void setBestAgreementIndices(AutomatedAgentType agentType, int[] currentAgreementIdx)
agentType
- - the agent's typecurrentAgreementIdx
- - the agreement indicespublic void setWorstAgreementValue(AutomatedAgentType agentType, double value)
agentType
- - the agent's typevalue
- - the valuepublic void setWorstAgreementIndices(AutomatedAgentType agentType, int[] currentAgreementIdx)
agentType
- - the agent's typecurrentAgreementIdx
- - the agreement indicespublic void initializeBestAgreement(AutomatedAgentType agentType)
agentType
- - the agent's typepublic void initializeWorstAgreement(AutomatedAgentType agentType)
agentType
- - the agent's typepublic double getAgreementTimeEffect(AutomatedAgentType agentType)
agentType
- - the agent's typepublic double getSQValue(AutomatedAgentType agentType)
agentType
- - the agent's typepublic double getOptOutValue(AutomatedAgentType agentType)
agentType
- - the agent's typepublic int getTotalAgreements(AutomatedAgentType agentType)
public void setAutomatedAgentType(java.lang.String side)
public java.lang.String getAgentSide()
public java.lang.String getSelectedOffer()
public double getSelectedOfferValue()
public double getAcceptedAgreementsValue()
public int[] getAcceptedAgreementIdx()
public void calculateNextTurnOffer()
public double getNextTurnOfferValue()
public void getNextAgreement(int totalIssuesNum, int[] currentAgreementIdx, int[] maxIssueValues)
totalIssuesNum
- - the total number of issues in the negotiatoincurrentAgreementIdx
- - the current agreement indicesmaxIssueValues
- - the maximal issue valuepublic AutomatedAgentType getNextTurnSideAgentType(java.lang.String sideName, int type)
sideName
- - the type of side (A or B)type
- - the type (compromise, short, long)public AutomatedAgentType getCurrentTurnSideAgentType(java.lang.String sideName, int type)
sideName
- - the type of side (A or B)type
- - the type (compromise, short, long)public double getNextTurnAutomatedAgentValue()
public double getCurrentTurnAutomatedAgentValue()
public void setCurrentTurnAutomatedAgentValue(double agreementValue)
agreementValue
- - the agreement's valuepublic void setNextTurnAutomatedAgentSelectedValue(double agreementValue)
agreementValue
- - the agreement's valuepublic void setNextTurnOpponentSelectedValue(double agreementValue)
agreementValue
- - the agreement's valuepublic void setCurrentTurnOpponentSelectedValue(double agreementValue)
agreementValue
- - the agreement's valuepublic void setNextTurnAgreementString(java.lang.String agreementStr)
agreementStr
- - the agreement as Stringpublic void setCurrentTurnAgreementString(java.lang.String agreementStr)
agreementStr
- - the agreement as Stringpublic void setNextTurnOpponentType(int type)
agreementStr
- - the agreement as Stringpublic void calculateResponse(int messageType, int[] currentAgreementIdx, java.lang.String message)
public java.lang.String getMessageByIndices(int[] currentAgreementIdx)
public int[] getMessageIndicesByMessage(java.lang.String currentAgreementStr)
public double getAgreementValue(int[] currentAgreementIdx)
public double getSecondPerTurn()
public int getTotalIssues(AutomatedAgentType agentType)
public int getMaxValuePerIssue(AutomatedAgentType agentType, int issueNum)
agentType
- - the agent's typeissueNum
- - the issue numberpublic boolean getSendOfferFlag()
public void setSendOfferFlag(boolean flag)
flag
- - true if wanting to send message, false - o/w