net.sourceforge.jasa.agent
Class SimpleTradingAgent
java.lang.Object
AbstractAgent
net.sourceforge.jasa.agent.AbstractTradingAgent
net.sourceforge.jasa.agent.SimpleTradingAgent
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, TradingAgent, MarketEventListener
public class SimpleTradingAgent
- extends AbstractTradingAgent
Agents of this type have a fixed volume, and they trade units equal to their
volume in each round of the market.
-
-
Fields inherited from class net.sourceforge.jasa.agent.AbstractTradingAgent |
account, currentOrder, group, initialFunds, initialStock, lastOrderFilled, lastPayoff, markets, stock, totalPayoff, utilityFunction, valuer |
Constructor Summary |
SimpleTradingAgent()
|
SimpleTradingAgent(double privateValue,
boolean isSeller,
TradingStrategy strategy,
EventScheduler scheduler)
|
SimpleTradingAgent(double privateValue,
EventScheduler scheduler)
|
SimpleTradingAgent(EventScheduler scheduler)
|
SimpleTradingAgent(int stock,
double funds,
double privateValue,
EventScheduler scheduler)
|
SimpleTradingAgent(int stock,
double funds,
double privateValue,
TradingStrategy strategy,
EventScheduler scheduler)
|
SimpleTradingAgent(int stock,
double funds,
EventScheduler scheduler)
|
Methods inherited from class net.sourceforge.jasa.agent.AbstractTradingAgent |
calculatePayoff, clone, determineQuantity, equilibriumProfits, equilibriumProfitsEachDay, eventOccurred, getAccount, getCommodityHolding, getCurrentOrder, getFunds, getGroup, getMarket, getMarkets, getPayoff, getStock, getTotalPayoff, getTradingStrategy, getUtilityFunction, getValuation, getValuationPolicy, getVolume, giveFunds, initialise, isBuyer, isInteracted, isSeller, lastOrderFilled, onAgentArrival, onMarketClosed, onMarketOpen, orderFilled, pay, protoClone, register, reset, setGroup, setMarket, setMarkets, setPrivateValue, setUtilityFunction, setValuationPolicy, subscribeToEvents |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SimpleTradingAgent
public SimpleTradingAgent(int stock,
double funds,
double privateValue,
EventScheduler scheduler)
SimpleTradingAgent
public SimpleTradingAgent(int stock,
double funds,
double privateValue,
TradingStrategy strategy,
EventScheduler scheduler)
SimpleTradingAgent
public SimpleTradingAgent(int stock,
double funds,
EventScheduler scheduler)
SimpleTradingAgent
public SimpleTradingAgent(double privateValue,
boolean isSeller,
TradingStrategy strategy,
EventScheduler scheduler)
SimpleTradingAgent
public SimpleTradingAgent(double privateValue,
EventScheduler scheduler)
SimpleTradingAgent
public SimpleTradingAgent(EventScheduler scheduler)
SimpleTradingAgent
public SimpleTradingAgent()
onAgentArrival
public void onAgentArrival(Market auction,
AgentArrivalEvent event)
- Description copied from class:
AbstractTradingAgent
- Place an order in the market as determined by the agent's strategy.
- Overrides:
onAgentArrival
in class AbstractTradingAgent
acceptDeal
public boolean acceptDeal(Market auction,
double price,
int quantity)
getLastPayoff
public double getLastPayoff()
- Description copied from class:
AbstractTradingAgent
- Return the profit made in the most recent market round. This can be used
as, e.g. input to a re-inforcement learning algorithm.
- Overrides:
getLastPayoff
in class AbstractTradingAgent
active
public boolean active()
- Description copied from class:
AbstractTradingAgent
- Determine whether or not this trader is active. Inactive traders do not
place shouts in the market, but do carry on learning through their
strategy.
- Specified by:
active
in class AbstractTradingAgent
- Returns:
- true if the trader is active.
onEndOfDay
public void onEndOfDay(MarketEvent event)
- Overrides:
onEndOfDay
in class AbstractTradingAgent
toString
public java.lang.String toString()
calculateProfit
public double calculateProfit(Market auction,
int quantity,
double price)
- Specified by:
calculateProfit
in interface TradingAgent
- Overrides:
calculateProfit
in class AbstractTradingAgent