|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.liv.auction.agent.AbstractTradingAgent
uk.ac.liv.auction.zi.ZITraderAgent
Class for "Zero Intelligence" (ZI) trader agents. Agents of this type have a finite trade entitlement, which determines how many units they are able to trade in a given trading period. ZITraderAgents become inactive once their intitial trade entitlement is used up, and their trade entitlement is restored at the end of each day.
See:"Minimal Intelligence Agents for Bargaining Behaviours in Market-based Environments" Dave Cliff 1997.
and "An experimental study of competitive market behaviour", Smith, V.L. 1962 in The Journal of Political Economy, vol 70.
Parameters
| base.initialtradeentitlement int >= 0 |
(the number of units of commodity that this agent is allowed to trade) |
| Field Summary | |
protected int |
initialTradeEntitlement
The initial value of tradeEntitlement |
protected boolean |
isActive
|
protected boolean |
lastShoutSuccessful
Flag indicating whether the last shout resulted in a transaction. |
static java.lang.String |
P_ACTIVATION_PROBABILITY
|
static java.lang.String |
P_INITIAL_TRADE_ENTITLEMENT
|
protected int |
quantityTraded
The number of units traded to date |
protected int |
tradeEntitlement
The number of units this agent is entitlted to trade in this trading period. |
| Fields inherited from class uk.ac.liv.auction.agent.AbstractTradingAgent |
currentShout, funds, group, id, initialFunds, initialStock, isSeller, lastProfit, lastShoutAccepted, P_DEFAULT_STRATEGY, P_GROUP, P_INITIAL_FUNDS, P_INITIAL_STOCK, P_IS_SELLER, P_STRATEGY, P_VALUER, profits, stock, strategy, valuer |
| Constructor Summary | |
ZITraderAgent()
|
|
ZITraderAgent(double privateValue,
int tradeEntitlement,
boolean isSeller)
|
|
ZITraderAgent(int stock,
double funds,
double privateValue,
int tradeEntitlement,
boolean isSeller)
|
|
| Method Summary | |
boolean |
active()
Determine whether or not this trader is active. |
int |
deliver(Auction auction,
int quantity,
double price)
This method is invoked by a seller on a buyer when it is transfering stock |
int |
determineQuantity(Auction auction)
|
void |
endOfDay(AuctionEvent event)
|
double |
equilibriumProfits(Auction auction,
double equilibriumPrice,
int quantity)
Calculate the hypothetical surplus this agent will receive if the market had cleared uniformly at the specified equilibrium price and quantity. |
int |
getInitialTradeEntitlement()
|
int |
getQuantityTraded()
|
int |
getTradeEntitlement()
|
void |
informOfSeller(Auction auction,
Shout winningShout,
TradingAgent seller,
double price,
int quantity)
Default behaviour for winning ZI bidders is to purchase unconditionally. |
protected void |
initialise()
|
java.lang.Object |
protoClone()
|
void |
purchaseFrom(Auction auction,
AbstractTradingAgent seller,
int quantity,
double price)
|
void |
requestShout(Auction auction)
Place a shout in the auction as determined by our currently configured strategy. |
void |
sellUnits(Auction auction,
int numUnits)
|
void |
setInitialTradeEntitlement(int initialTradeEntitlement)
|
void |
setTradeEntitlement(int tradeEntitlement)
|
void |
setup(ec.util.ParameterDatabase parameters,
ec.util.Parameter base)
Initialise this object from a parameter database. |
java.lang.String |
toString()
|
| Methods inherited from class uk.ac.liv.auction.agent.AbstractTradingAgent |
auctionClosed, auctionOpen, eventOccurred, getCurrentShout, getFunds, getGroup, getId, getLastProfit, getProfits, getStock, getStrategy, getValuation, getValuationPolicy, giveFunds, informOfBuyer, isBuyer, isSeller, lastShoutAccepted, pay, reset, roundClosed, setGroup, setIsSeller, setPrivateValue, setStrategy, setValuationPolicy |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int tradeEntitlement
protected int initialTradeEntitlement
protected boolean lastShoutSuccessful
protected int quantityTraded
protected boolean isActive
public static final java.lang.String P_INITIAL_TRADE_ENTITLEMENT
public static final java.lang.String P_ACTIVATION_PROBABILITY
| Constructor Detail |
public ZITraderAgent()
public ZITraderAgent(int stock,
double funds,
double privateValue,
int tradeEntitlement,
boolean isSeller)
public ZITraderAgent(double privateValue,
int tradeEntitlement,
boolean isSeller)
| Method Detail |
public void setup(ec.util.ParameterDatabase parameters,
ec.util.Parameter base)
Parameterizable
setup in interface Parameterizablesetup in class AbstractTradingAgentpublic java.lang.Object protoClone()
protoClone in interface PrototypeableprotoClone in class AbstractTradingAgentpublic void requestShout(Auction auction)
AbstractTradingAgent
requestShout in interface TradingAgentrequestShout in class AbstractTradingAgentprotected void initialise()
initialise in class AbstractTradingAgentpublic void endOfDay(AuctionEvent event)
endOfDay in class AbstractTradingAgentpublic boolean active()
AbstractTradingAgent
active in class AbstractTradingAgent
public void informOfSeller(Auction auction,
Shout winningShout,
TradingAgent seller,
double price,
int quantity)
informOfSeller in interface TradingAgentinformOfSeller in class AbstractTradingAgent
public void purchaseFrom(Auction auction,
AbstractTradingAgent seller,
int quantity,
double price)
purchaseFrom in class AbstractTradingAgent
public int deliver(Auction auction,
int quantity,
double price)
AbstractTradingAgent
deliver in class AbstractTradingAgentquantity - The number of items of stock to transfer
public double equilibriumProfits(Auction auction,
double equilibriumPrice,
int quantity)
AbstractTradingAgent
equilibriumProfits in class AbstractTradingAgent
public void sellUnits(Auction auction,
int numUnits)
public int getQuantityTraded()
public int determineQuantity(Auction auction)
determineQuantity in class AbstractTradingAgentpublic int getTradeEntitlement()
public void setTradeEntitlement(int tradeEntitlement)
public int getInitialTradeEntitlement()
public void setInitialTradeEntitlement(int initialTradeEntitlement)
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||