edu.cuny.cat.trader.strategy
Class DiscreteLearnerStrategy

java.lang.Object
  extended by java.util.Observable
      extended by edu.cuny.cat.trader.strategy.AbstractStrategy
          extended by edu.cuny.cat.trader.strategy.FixedQuantityStrategyImpl
              extended by edu.cuny.cat.trader.strategy.AdaptiveStrategyImpl
                  extended by edu.cuny.cat.trader.strategy.DiscreteLearnerStrategy
All Implemented Interfaces:
AuctionEventListener, AdaptiveStrategy, FixedQuantityStrategy, Strategy, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Prototypeable, edu.cuny.obj.Resetable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
StimuliResponseStrategy

public abstract class DiscreteLearnerStrategy
extends AdaptiveStrategyImpl
implements java.io.Serializable

A class representing a strategy in which we adapt our bids using a discrete learning algorithm.

Parameters

base.markupscale
double >= 0
(scaling factor by which to multiply the output from the learner)

Default Base

discrete_learner_strategy

Version:
$Revision: 1.15 $
Author:
Steve Phelps
See Also:
Serialized Form

Field Summary
protected  double markupScale
          A scaling factor used to multiply-up the output from the learning algorithm.
static java.lang.String P_DEF_BASE
           
 
Fields inherited from class edu.cuny.cat.trader.strategy.FixedQuantityStrategyImpl
quantity
 
Fields inherited from class edu.cuny.cat.trader.strategy.AbstractStrategy
agent, currentShout, MIN_PRICE_DIFFERENCE
 
Constructor Summary
DiscreteLearnerStrategy()
           
DiscreteLearnerStrategy(AbstractTradingAgent agent)
           
 
Method Summary
abstract  int act()
          Generate an action from the learning algorithm.
 void eventOccurred(AuctionEvent event)
           
 double getMarkupScale()
           
abstract  void learn()
          Perform learning.
 boolean modifyShout(Shout.MutableShout shout)
          Modify the price and quantity of the given shout according to this strategy.
 void setMarkupScale(double markupScale)
           
 void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.cuny.cat.trader.strategy.FixedQuantityStrategyImpl
determineQuantity, getQuantity, setQuantity
 
Methods inherited from class edu.cuny.cat.trader.strategy.AbstractStrategy
getAgent, initialize, modifyShout, protoClone, requiresAuctionHistory, reset, setAgent
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.cuny.cat.trader.strategy.AdaptiveStrategy
getLearner, setLearner
 
Methods inherited from interface edu.cuny.cat.trader.strategy.Strategy
determineQuantity, modifyShout, requiresAuctionHistory, setAgent
 
Methods inherited from interface edu.cuny.obj.Prototypeable
protoClone
 
Methods inherited from interface edu.cuny.obj.Resetable
reset
 

Field Detail

markupScale

protected double markupScale
A scaling factor used to multiply-up the output from the learning algorithm.


P_DEF_BASE

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

DiscreteLearnerStrategy

public DiscreteLearnerStrategy()

DiscreteLearnerStrategy

public DiscreteLearnerStrategy(AbstractTradingAgent agent)
Method Detail

setup

public void setup(edu.cuny.config.param.ParameterDatabase parameters,
                  edu.cuny.config.param.Parameter base)
Specified by:
setup in interface edu.cuny.config.param.Parameterizable
Overrides:
setup in class FixedQuantityStrategyImpl

eventOccurred

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

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
Returns:
false if no shout is to be placed at this time

getMarkupScale

public double getMarkupScale()

setMarkupScale

public void setMarkupScale(double markupScale)

act

public abstract int act()
Generate an action from the learning algorithm.


learn

public abstract void learn()
Perform learning.


toString

public java.lang.String toString()
Overrides:
toString in class FixedQuantityStrategyImpl