net.sourceforge.jasa.agent
Class Inventory
java.lang.Object
net.sourceforge.jasa.agent.Inventory
- All Implemented Interfaces:
- java.io.Serializable
public class Inventory
- extends java.lang.Object
- implements java.io.Serializable
Class to track inventories of agents. The inventory will typically
specify the number of shares currently held by the specified agent.
- See Also:
- Serialized Form
-
-
Field Summary |
protected TradingAgent |
owner
The agent whose inventory we are tracking. |
protected int |
quantity
The number of shares held by the agent. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
quantity
protected int quantity
- The number of shares held by the agent.
owner
protected TradingAgent owner
- The agent whose inventory we are tracking.
Inventory
public Inventory()
Inventory
public Inventory(int quantity)
add
public void add(int quantity)
remove
public void remove(int quantity)
transfer
public void transfer(Inventory other,
int quantity)
getOwner
public TradingAgent getOwner()
setOwner
public void setOwner(TradingAgent owner)
getQuantity
public int getQuantity()
setQuantity
public void setQuantity(int quantity)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object