net.sourceforge.jasa.agent.strategy
Class MDPStrategy
java.lang.Object
AbstractStrategy
net.sourceforge.jasa.agent.strategy.AbstractTradingStrategy
net.sourceforge.jasa.agent.strategy.FixedQuantityStrategyImpl
net.sourceforge.jasa.agent.strategy.FixedDirectionStrategy
net.sourceforge.jasa.agent.strategy.AdaptiveStrategyImpl
net.sourceforge.jasa.agent.strategy.DiscreteLearnerStrategy
net.sourceforge.jasa.agent.strategy.MDPStrategy
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, AdaptiveStrategy, FixedQuantityStrategy, TradingStrategy, MarketEventListener
public class MDPStrategy
- extends DiscreteLearnerStrategy
- implements java.io.Serializable
A trading strategy that uses an MDP learning algorithm, such as the
Q-learning algorithm, to adapt its trading behaviour in successive market
rounds. The current market-quote is hashed to produce an integer state value.
-
-
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
learner
protected MDPLearner learner
bidBinStart
protected double bidBinStart
bidBinWidth
protected double bidBinWidth
askBinStart
protected double askBinStart
askBinWidth
protected double askBinWidth
quoteBins
protected int quoteBins
firstShout
protected boolean firstShout
MDPStrategy
public MDPStrategy(AbstractTradingAgent agent,
double askBinStart,
double askBinWidth,
double bidBinStart,
double bidBinWidth)
MDPStrategy
public MDPStrategy()
act
public int act()
- Description copied from class:
DiscreteLearnerStrategy
- Generate an action from the learning algorithm.
- Specified by:
act
in class DiscreteLearnerStrategy
learn
public void learn(Market auction)
- Description copied from class:
DiscreteLearnerStrategy
- Perform learning.
- Specified by:
learn
in class DiscreteLearnerStrategy
auctionState
public int auctionState(Market auction)
- Hash the market quote to produce a state value for the learning algorithm.
reset
public void reset()
- Overrides:
reset
in class AbstractTradingStrategy
getLearner
public Learner getLearner()
- Specified by:
getLearner
in interface AdaptiveStrategy
setLearner
public void setLearner(Learner learner)
- Specified by:
setLearner
in interface AdaptiveStrategy
toString
public java.lang.String toString()