public class EpsilonGreedyExplorer<T> extends Object implements Explorer<T>, ConsumePolicy<T>
| Constructor and Description |
|---|
EpsilonGreedyExplorer(Policy<T> defaultPolicy,
float epsilon,
int numActions)
The constructor
|
| Modifier and Type | Method and Description |
|---|---|
DecisionTuple |
chooseAction(long saltedSeed,
T context)
Determines the action to take and the probability with which it was chosen, for a
given context.
|
void |
enableExplore(boolean explore) |
protected int |
getNumActions(T context) |
void |
updatePolicy(Policy<T> newPolicy) |
public EpsilonGreedyExplorer(Policy<T> defaultPolicy, float epsilon, int numActions)
defaultPolicy - A default function which outputs an action given a context.epsilon - The probability of a random exploration.numActions - The number of actions to randomize over.protected int getNumActions(T context)
public void updatePolicy(Policy<T> newPolicy)
updatePolicy in interface ConsumePolicy<T>public DecisionTuple chooseAction(long saltedSeed, T context)
ExplorerchooseAction in interface Explorer<T>saltedSeed - A PRG seed based on a unique id information provided by the usercontext - A user-defined context for the decisionpublic void enableExplore(boolean explore)
enableExplore in interface Explorer<T>Copyright © 2016. All Rights Reserved.