net.sourceforge.jasa.agent
Class MarketMakerAgent

java.lang.Object
  extended by AbstractAgent
      extended by net.sourceforge.jasa.agent.AbstractTradingAgent
          extended by net.sourceforge.jasa.agent.MarketMakerAgent
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, TradingAgent, MarketEventListener

public class MarketMakerAgent
extends AbstractTradingAgent

 

Field Summary
protected  Order ask
           
protected  int askQuantity
           
protected  Order bid
           
protected  int bidQuantity
           
protected  double minMargin
           
protected  double priceOffset
           
 
Fields inherited from class net.sourceforge.jasa.agent.AbstractTradingAgent
account, currentOrder, group, initialFunds, initialStock, lastOrderFilled, lastPayoff, markets, stock, totalPayoff, utilityFunction, valuer
 
Constructor Summary
MarketMakerAgent()
           
MarketMakerAgent(EventScheduler scheduler)
           
 
Method Summary
 boolean active()
          Determine whether or not this trader is active.
 int determineQuantity(Market auction)
           
 int getAskQuantity()
           
 int getBidQuantity()
           
 double getPriceOffset()
           
 boolean isBuyer(Market market)
           
 boolean isSeller(Market market)
           
 void onAgentArrival(Market market, AgentArrivalEvent event)
          Place an order in the market as determined by the agent's strategy.
 void onMarketOpen(MarketEvent event)
           
 void orderFilled(Market auction, Order filledOrder, double price, int quantity)
           
 void setAskQuantity(int askQuantity)
           
 void setBidQuantity(int bidQuantity)
           
 void setPriceOffset(double priceOffset)
           
 
Methods inherited from class net.sourceforge.jasa.agent.AbstractTradingAgent
calculatePayoff, calculateProfit, clone, equilibriumProfits, equilibriumProfitsEachDay, eventOccurred, getAccount, getCommodityHolding, getCurrentOrder, getFunds, getGroup, getLastPayoff, getMarket, getMarkets, getPayoff, getStock, getTotalPayoff, getTradingStrategy, getUtilityFunction, getValuation, getValuationPolicy, getVolume, giveFunds, initialise, isInteracted, lastOrderFilled, onAgentArrival, onEndOfDay, onMarketClosed, pay, protoClone, register, reset, setGroup, setMarket, setMarkets, setPrivateValue, setUtilityFunction, setValuationPolicy, subscribeToEvents
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

priceOffset

protected double priceOffset

minMargin

protected double minMargin

bid

protected Order bid

ask

protected Order ask

bidQuantity

protected int bidQuantity

askQuantity

protected int askQuantity
Constructor Detail

MarketMakerAgent

public MarketMakerAgent(EventScheduler scheduler)

MarketMakerAgent

public MarketMakerAgent()
Method Detail

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.

isBuyer

public boolean isBuyer(Market market)
Overrides:
isBuyer in class AbstractTradingAgent

isSeller

public boolean isSeller(Market market)
Overrides:
isSeller in class AbstractTradingAgent

determineQuantity

public int determineQuantity(Market auction)
Overrides:
determineQuantity in class AbstractTradingAgent

onAgentArrival

public void onAgentArrival(Market market,
                           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

orderFilled

public void orderFilled(Market auction,
                        Order filledOrder,
                        double price,
                        int quantity)
Specified by:
orderFilled in interface TradingAgent
Overrides:
orderFilled in class AbstractTradingAgent

onMarketOpen

public void onMarketOpen(MarketEvent event)
Overrides:
onMarketOpen in class AbstractTradingAgent

getPriceOffset

public double getPriceOffset()

setPriceOffset

public void setPriceOffset(double priceOffset)

getBidQuantity

public int getBidQuantity()

setBidQuantity

public void setBidQuantity(int bidQuantity)

getAskQuantity

public int getAskQuantity()

setAskQuantity

public void setAskQuantity(int askQuantity)