public abstract class BilateralAgent extends Agent implements BidHistoryKeeper
Modifier and Type | Field and Description |
---|---|
protected Domain |
domain |
protected BidHistory |
myHistory |
protected BidHistory |
opponentHistory |
fNegotiation, parametervalues, sessionNr, sessionsTotal, startTime, strategyParameters, timeline, totalTime, utilitySpace
Constructor and Description |
---|
BilateralAgent() |
Modifier and Type | Method and Description |
---|---|
Action |
chooseAction()
this function is called after ReceiveMessage, with an Offer-action.
|
abstract Bid |
chooseCounterBid()
The opponent has already made a bid.
|
abstract Bid |
chooseFirstCounterBid()
Use this method to make the first counter-bid.
|
abstract Bid |
chooseOpeningBid()
Use this method to make an opening bid.
|
Bid |
getMyLastBid() |
Bid |
getMySecondLastBid() |
BidHistory |
getOpponentHistory() |
Bid |
getOpponentLastBid() |
int |
getRound()
Returns the current round number, starting at 0.
|
protected double |
getUndiscountedUtility(Bid bid) |
java.lang.String |
getVersion() |
void |
init()
This method is called by the protocol every time before starting a new
session after the internalInit method is called.
|
abstract boolean |
isAcceptable(Bid plannedBid)
At some point, one of the parties has to accept an offer to end the
negotiation.
|
protected static void |
log(java.lang.String s) |
protected Action |
makeAcceptAction()
By default, if an offer is deemed acceptable, we send accept.
|
void |
ReceiveMessage(Action opponentAction)
informs you which action the opponent did
|
static double |
round2(double x)
Rounds to two decimals
|
endSession, getAgentID, getName, getParameterValues, getSessionNumber, getSessionsTotal, getStrategyParameters, getSupportedNegotiationSetting, getUniqueIdentifier, getUtility, internalInit, isUIAgent, loadSessionData, parseStrategyParameters, restartDataObjectsFolder, saveSessionData, setAgentID, setName, sleep
protected Domain domain
protected BidHistory myHistory
protected BidHistory opponentHistory
public void init()
Agent
public java.lang.String getVersion()
getVersion
in class Agent
public void ReceiveMessage(Action opponentAction)
Agent
ReceiveMessage
in class Agent
protected double getUndiscountedUtility(Bid bid)
public Action chooseAction()
Agent
chooseAction
in class Agent
remember
- : remember the action or not.protected Action makeAcceptAction()
public abstract boolean isAcceptable(Bid plannedBid)
plannedBid
- public abstract Bid chooseCounterBid()
public abstract Bid chooseOpeningBid()
public abstract Bid chooseFirstCounterBid()
public Bid getMyLastBid()
getMyLastBid
in interface BidHistoryKeeper
public Bid getMySecondLastBid()
getMySecondLastBid
in interface BidHistoryKeeper
public BidHistory getOpponentHistory()
getOpponentHistory
in interface BidHistoryKeeper
public Bid getOpponentLastBid()
getOpponentLastBid
in interface BidHistoryKeeper
public int getRound()
protected static void log(java.lang.String s)
public static double round2(double x)