public static class Policy.RandomPolicy extends Policy
addAction(burlap.oomdp.singleagent.Action)
method
or remove or clear the actions.
Policy.ActionProb, Policy.PolicyUndefinedException, Policy.RandomPolicy
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Action> |
actions
The actions from which selection is performed
|
protected java.util.Random |
rand
The random factory used to randomly select actions.
|
annotateOptionDecomposition, evaluateDecomposesOptions
Constructor and Description |
---|
Policy.RandomPolicy(Domain domain)
Initializes by copying all the primitive actions references defined for the domain into an internal action
list for this policy.
|
Policy.RandomPolicy(java.util.List<Action> acitons)
Initializes by copying all the actions references defined in the provided list into an internal action
list for this policy.
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(Action action)
Adds an aciton to consider in selection.
|
void |
clearActions()
Clears the action list used in action selection.
|
AbstractGroundedAction |
getAction(State s)
This method will return an action sampled by the policy for the given state.
|
java.util.List<Policy.ActionProb> |
getActionDistributionForState(State s)
This method will return action probability distribution defined by the policy.
|
java.util.Random |
getRandomGenerator()
Returns the random generator used for action selection.
|
java.util.List<Action> |
getSelectionActions()
Returns of the list of actions that can be randomly selected.
|
boolean |
isDefinedFor(State s)
Specifies whether this policy is defined for the input state.
|
boolean |
isStochastic()
Indicates whether the policy is stochastic or deterministic.
|
void |
removeAction(java.lang.String actionName)
Removes an action from consideration.
|
void |
setRandomGenerator(java.util.Random rand)
Sets the random generator used for action selection.
|
evaluateBehavior, evaluateBehavior, evaluateBehavior, evaluateMethodsShouldAnnotateOptionDecomposition, evaluateMethodsShouldDecomposeOption, getDeterministicPolicy, getProbOfAction, getProbOfActionGivenDistribution, getProbOfActionGivenDistribution, sampleFromActionDistribution
protected java.util.List<Action> actions
protected java.util.Random rand
public Policy.RandomPolicy(Domain domain)
domain
- the domain containing all the primitive actions.public Policy.RandomPolicy(java.util.List<Action> acitons)
acitons
- the actions to select between.public void addAction(Action action)
action
- an action to consider in selectionpublic void clearActions()
public void removeAction(java.lang.String actionName)
actionName
- the name of the action to remove.public java.util.List<Action> getSelectionActions()
public java.util.Random getRandomGenerator()
public void setRandomGenerator(java.util.Random rand)
rand
- the random generator used for action selection.public AbstractGroundedAction getAction(State s)
Policy
public java.util.List<Policy.ActionProb> getActionDistributionForState(State s)
Policy
getActionDistributionForState
in class Policy
s
- the state for which an action distribution should be returnedpublic boolean isStochastic()
Policy
isStochastic
in class Policy
public boolean isDefinedFor(State s)
Policy
isDefinedFor
in class Policy
s
- the input state to test for whether this policy is definedState
s, false otherwise.