|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectplayer.Player
public abstract class Player
Represents the basic functions of an economic player
Constructor Summary | |
---|---|
Player(java.lang.String name)
Constructor |
Method Summary | |
---|---|
void |
addToInventory(Commodity comm,
double qty)
Adds a given quantity of a specified commodity to the players inventory |
double |
browseInventory(Commodity comm)
Returns the player's value for the specified commodity |
double |
clearFromInventory(Commodity comm)
Clears the given commodity from this player's inventory |
void |
clearInventory()
Clears the player's entire inventory |
void |
clearValueFunction()
Clears the player's entire value function |
java.util.HashMap<Commodity,java.lang.Double> |
getInventory()
|
java.lang.String |
getPlayerName()
|
double |
getValue(Commodity comm)
Given a commodity, the value (cost) of this commodity for this player is returned |
abstract Ask |
makeAsk(Ask theAsk,
Market theMarket)
|
abstract Bid |
makeBid(Bid theBid,
Market theMarket)
|
void |
printInventory()
Prints to screen the contents of this player's inventory |
void |
removeFromInventory(Commodity comm,
double qty)
Removes the specified amount of a given commodity from this players inventory. |
void |
setBudget(java.util.HashMap<Commodity,java.lang.Double> budget)
|
void |
setPlayerName(java.lang.String playerName)
Renames this player under a new name given |
void |
setValue(Commodity comm,
double value)
Given a commodity, sets the value (cost) of this commodity for this player |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Player(java.lang.String name)
name
- Method Detail |
---|
public void addToInventory(Commodity comm, double qty)
comm
- qty
- public double browseInventory(Commodity comm)
comm
-
public void clearInventory()
public void clearValueFunction()
public java.util.HashMap<Commodity,java.lang.Double> getInventory()
public java.lang.String getPlayerName()
public double getValue(Commodity comm)
comm
-
public abstract Ask makeAsk(Ask theAsk, Market theMarket)
theAsk
- theMarket
-
public abstract Bid makeBid(Bid theBid, Market theMarket)
theBid
- theMarket
-
public double clearFromInventory(Commodity comm)
comm
- public void removeFromInventory(Commodity comm, double qty)
comm
- qty
- public void setBudget(java.util.HashMap<Commodity,java.lang.Double> budget)
budget
- public void setPlayerName(java.lang.String playerName)
playerName
- public void setValue(Commodity comm, double value)
comm
- value
- public void printInventory()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |