public abstract class AbstractNegotiationParty extends java.lang.Object implements NegotiationParty
NegotiationParty
interface. This basic
implementation sets up some common variables for you.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<DeadlineType,java.lang.Object> |
deadlines
map of all deadlines set for this party.
|
protected AgentID |
partyId
The id used to identify this agent (if set to null, a default identifier will be used).
|
protected java.util.Random |
rand
Random seed used by this party.
|
protected Timeline |
timeline
Time line used by the party if time deadline is set.
|
protected UtilitySpace |
utilitySpace
utility space used by this party (set in constructor).
|
Constructor and Description |
---|
AbstractNegotiationParty(UtilitySpace utilitySpace,
java.util.Map<DeadlineType,java.lang.Object> deadlines,
Timeline timeline,
long randomSeed)
Initializes a new instance of the
NegotiationParty class. |
Modifier and Type | Method and Description |
---|---|
protected Bid |
generateRandomBid()
Generates a random bid which will be generated using this.utilitySpace.
|
AgentID |
getPartyId()
Gets the party id for this party
|
protected Value |
getRandomValue(Issue currentIssue)
Gets a random value for the given issue.
|
Timeline |
getTimeLine()
Gets this agent's time line.
|
double |
getUtility(Bid bid)
Gets the utility for the given bid.
|
UtilitySpace |
getUtilitySpace()
Gets this agent's utility space.
|
double |
getUtilityWithDiscount(Bid bid)
Gets the time discounted utility for the given bid.
|
void |
setPartyId(AgentID partyId)
Sets the party id
|
java.lang.String |
toString()
Returns a human readable string representation of this party.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
chooseAction, receiveMessage
protected final Timeline timeline
protected final java.util.Map<DeadlineType,java.lang.Object> deadlines
protected final java.util.Random rand
protected final UtilitySpace utilitySpace
protected AgentID partyId
public AbstractNegotiationParty(UtilitySpace utilitySpace, java.util.Map<DeadlineType,java.lang.Object> deadlines, Timeline timeline, long randomSeed)
NegotiationParty
class.utilitySpace
- The utility space used by this classdeadlines
- The deadlines for this sessiontimeline
- The time line (if time deadline) for this session, can be nullrandomSeed
- The seed that should be used for all randomization (to be reproducible)protected Bid generateRandomBid()
protected Value getRandomValue(Issue currentIssue) throws java.lang.Exception
currentIssue
- The issue to generate a random value forjava.lang.Exception
- if the issues type is not Discrete, Real or Integer.public double getUtility(Bid bid)
getUtility
in interface NegotiationParty
bid
- The bid to get the utility forpublic double getUtilityWithDiscount(Bid bid)
getUtilityWithDiscount
in interface NegotiationParty
bid
- The bid to get the utility forpublic final UtilitySpace getUtilitySpace()
getUtilitySpace
in interface NegotiationParty
public Timeline getTimeLine()
getTimeLine
in interface NegotiationParty
public java.lang.String toString()
toString
in class java.lang.Object
public AgentID getPartyId()
getPartyId
in interface NegotiationParty
public void setPartyId(AgentID partyId)
setPartyId
in interface NegotiationParty
partyId
- The uniquely identifying party id.