net.sourceforge.jabm.learning
Class EpsilonGreedyActionSelector
java.lang.Object
net.sourceforge.jabm.learning.EpsilonGreedyActionSelector
- All Implemented Interfaces:
- ActionSelector
public class EpsilonGreedyActionSelector
- extends java.lang.Object
- implements ActionSelector
An implementation of the epsilon-greedy action selection policy.
See:
Sutton, R. S., Barto, A. G., 1998. Reinforcement Learning: An Introduction.
MIT Press.
-
-
Field Summary |
static double |
DEFAULT_EPSILON
|
protected double |
epsilon
The parameter representing the probability of choosing a random action on
any given iteration. |
protected cern.jet.random.engine.RandomEngine |
prng
|The pseudo-random number generator used to randomly select whether to
explore and to randomly select an action when the algorithm is exploring. |
Method Summary |
int |
act(int state,
MDPLearner qLearner)
Choose an action according to the current state and the
current value estimates for each action. |
double |
getEpsilon()
|
cern.jet.random.engine.RandomEngine |
getPrng()
|
void |
setEpsilon(double epsilon)
|
void |
setPrng(cern.jet.random.engine.RandomEngine prng)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
epsilon
protected double epsilon
- The parameter representing the probability of choosing a random action on
any given iteration.
prng
protected cern.jet.random.engine.RandomEngine prng
- |The pseudo-random number generator used to randomly select whether to
explore and to randomly select an action when the algorithm is exploring.
DEFAULT_EPSILON
public static final double DEFAULT_EPSILON
- See Also:
- Constant Field Values
EpsilonGreedyActionSelector
public EpsilonGreedyActionSelector(double epsilon,
cern.jet.random.engine.RandomEngine prng)
EpsilonGreedyActionSelector
public EpsilonGreedyActionSelector(cern.jet.random.engine.RandomEngine prng)
EpsilonGreedyActionSelector
public EpsilonGreedyActionSelector()
act
public int act(int state,
MDPLearner qLearner)
- Description copied from interface:
ActionSelector
- Choose an action according to the current state and the
current value estimates for each action.
- Specified by:
act
in interface ActionSelector
- Parameters:
state
- The current state of the MDP.qLearner
- The algorithm used to update the value estimates.
- Returns:
- An integer representing the action chosen (indexed from 0).
getEpsilon
public double getEpsilon()
setEpsilon
public void setEpsilon(double epsilon)
getPrng
public cern.jet.random.engine.RandomEngine getPrng()
setPrng
public void setPrng(cern.jet.random.engine.RandomEngine prng)