uk.ac.liv.auction.agent
Class KaplanStrategy

java.lang.Object
  extended byuk.ac.liv.auction.agent.AbstractStrategy
      extended byuk.ac.liv.auction.agent.FixedQuantityStrategyImpl
          extended byuk.ac.liv.auction.agent.KaplanStrategy
All Implemented Interfaces:
AuctionEventListener, java.lang.Cloneable, FixedQuantityStrategy, Parameterizable, Prototypeable, Resetable, java.io.Serializable, Strategy

public class KaplanStrategy
extends FixedQuantityStrategyImpl
implements java.io.Serializable, Prototypeable

An implementation of Todd Kaplan's sniping strategy. Agents using this strategy wait until the last minute before attempting to "steal the bid". See

"Behaviour of trading automata in a computerized double auction market" J. Rust, J. Miller and R. Palmer in "The Double Auction Market: Institutions, Theories and Evidence" 1992, Addison-Wesley

Note that you must configure a logger of type DailyStatsMarketDataLogger in order to use this strategy.

Parameters

base.s
double >= 0
(the spread factor)
base.t
double >= 0
(the time factor)

Version:
$Revision: 1.24 $
Author:
Steve Phelps
See Also:
DailyStatsReport, Serialized Form

Field Summary
protected  DailyStatsReport dailyStats
           
static java.lang.String P_S
           
static java.lang.String P_T
           
protected  MarketQuote quote
           
protected  double s
          The spread factor.
protected  double t
          The time factor.
 
Fields inherited from class uk.ac.liv.auction.agent.AbstractStrategy
agent, auction, currentShout
 
Constructor Summary
KaplanStrategy()
           
 
Method Summary
 void auctionOpen(AuctionOpenEvent event)
           
 void endOfRound(Auction auction)
           
protected  void error(DataUnavailableException e)
           
 void eventOccurred(AuctionEvent event)
           
 double getS()
           
 double getT()
           
 boolean juicyOffer()
           
 boolean modifyShout(Shout.MutableShout shout)
          Modify the price and quantity of the given shout according to this strategy.
 java.lang.Object protoClone()
           
 void setup(ec.util.ParameterDatabase parameters, ec.util.Parameter base)
          Initialise this object from a parameter database.
 boolean smallSpread()
           
 boolean timeRunningOut()
           
 java.lang.String toString()
           
 
Methods inherited from class uk.ac.liv.auction.agent.FixedQuantityStrategyImpl
determineQuantity, getQuantity, setQuantity
 
Methods inherited from class uk.ac.liv.auction.agent.AbstractStrategy
getAgent, initialise, modifyShout, reset, setAgent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.ac.liv.util.Resetable
reset
 
Methods inherited from interface uk.ac.liv.auction.agent.Strategy
modifyShout, setAgent
 

Field Detail

t

protected double t
The time factor. Kaplan will bid if the remaining time in the current period is less than t.


s

protected double s
The spread factor.


quote

protected MarketQuote quote

dailyStats

protected DailyStatsReport dailyStats

P_T

public static final java.lang.String P_T
See Also:
Constant Field Values

P_S

public static final java.lang.String P_S
See Also:
Constant Field Values
Constructor Detail

KaplanStrategy

public KaplanStrategy()
Method Detail

setup

public void setup(ec.util.ParameterDatabase parameters,
                  ec.util.Parameter base)
Description copied from interface: Parameterizable
Initialise this object from a parameter database.

Specified by:
setup in interface Parameterizable
Overrides:
setup in class FixedQuantityStrategyImpl

protoClone

public java.lang.Object protoClone()
Specified by:
protoClone in interface Prototypeable
Overrides:
protoClone in class AbstractStrategy

eventOccurred

public void eventOccurred(AuctionEvent event)
Specified by:
eventOccurred in interface AuctionEventListener
Overrides:
eventOccurred in class AbstractStrategy

auctionOpen

public void auctionOpen(AuctionOpenEvent event)

modifyShout

public boolean modifyShout(Shout.MutableShout shout)
Description copied from class: AbstractStrategy
Modify the price and quantity of the given shout according to this strategy.

Overrides:
modifyShout in class FixedQuantityStrategyImpl

endOfRound

public void endOfRound(Auction auction)
Specified by:
endOfRound in class AbstractStrategy

juicyOffer

public boolean juicyOffer()

smallSpread

public boolean smallSpread()

timeRunningOut

public boolean timeRunningOut()

getS

public double getS()

getT

public double getT()

toString

public java.lang.String toString()

error

protected void error(DataUnavailableException e)