public class PrimitiveOption extends Option
| Modifier and Type | Field and Description |
|---|---|
protected Action |
srcAction
The primitive action this option wraps.
|
cachedExpectations, cachedExpectedRewards, cumulativeDiscount, discountFactor, expectationSearchCutoffProb, expectationStateHashingFactory, externalTerminalFunction, keepTrackOfReward, lastCumulativeReward, lastNumSteps, lastOptionExecutionResults, rand, rf, shouldAnnotateExecution, shouldRecordResults, stateMapping, terminateMapperactionObservers, domain, name, parameterClasses, parameterOrderGroup| Constructor and Description |
|---|
PrimitiveOption(Action srcAction)
Creates an option wrapper for a given primitive action.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
applicableInState(State st,
java.lang.String[] params)
Returns true if this action can be applied in this specified state with the specified parameters.
|
java.util.List<Policy.ActionProb> |
getActionDistributionForState(State s,
java.lang.String[] params)
Returns the option's policy distribution for a given state.
|
void |
initiateInStateHelper(State s,
java.lang.String[] params)
This method is always called when an option is initated and begins execution.
|
boolean |
isMarkov()
Returns whether this option is Markov or not; that is, whether action selection and termination only depends on the current state.
|
boolean |
isPrimitive()
Returns whether this action is a primitive action of the domain or not.
|
GroundedAction |
oneStepActionSelection(State s,
java.lang.String[] params)
This method causes the option to take a single step in the given state, when the option was initiated with the provided parameters.
|
double |
probabilityOfTermination(State s,
java.lang.String[] params)
Returns the probability that this option (executed with the given parameters) will terminate in the given state
|
boolean |
usesDeterministicPolicy()
Returns whether this option's policy is deterministic or stochastic
|
boolean |
usesDeterministicTermination()
Returns whether this option's termination conditions are deterministic or stochastic
|
accumulateDiscountedProb, continueFromState, getDeterministicPolicy, getExpectedRewards, getLastCumulativeReward, getLastExecutionResults, getLastNumSteps, getTransitions, init, initiateInState, isAnnotatingExecutionResults, isRecordingExecutionResults, iterateExpectationScan, keepTrackOfRewardWith, map, oneStep, performActionHelper, setExernalTermination, setExpectationCalculationProbabilityCutoff, setExpectationHashingFactory, setStateMapping, setTerminateMapper, toggleShouldAnnotateResults, toggleShouldRecordResultsaddActionObserver, applicableInState, clearAllActionsObservers, deterministicTransition, equals, getAllApplicableGroundedActions, getAllApplicableGroundedActionsFromActionList, getDomain, getName, getParameterClasses, getParameterOrderGroups, getTransitions, hashCode, parametersAreObjects, performAction, performActionprotected Action srcAction
public PrimitiveOption(Action srcAction)
srcAction - the primitive action to wrap.public boolean isPrimitive()
ActionisPrimitive in class Optionpublic boolean isMarkov()
Optionpublic boolean usesDeterministicTermination()
OptionusesDeterministicTermination in class Optionpublic boolean usesDeterministicPolicy()
OptionusesDeterministicPolicy in class Optionpublic double probabilityOfTermination(State s, java.lang.String[] params)
OptionprobabilityOfTermination in class Options - the state to test for terminationparams - any parameters that were applied to this option when it was initiatedpublic void initiateInStateHelper(State s, java.lang.String[] params)
OptionOption.performActionHelper(State, String [])
For Markov options, this method probably does not need to do anything, but for non-Markov options, like Macro actions, it may need
to initialize some structures for determining termination and action selection.initiateInStateHelper in class Options - the state in which the option was initiatedparams - the parameters that were passed to the option for executionpublic boolean applicableInState(State st, java.lang.String[] params)
ActionapplicableInState in class Actionst - the state to perform the action onparams - a String array specifying the action object parameterspublic GroundedAction oneStepActionSelection(State s, java.lang.String[] params)
OptionOption.performActionHelper(State, String []) method until it is determined that the option terminates.oneStepActionSelection in class Options - the state in which an action should be selected.params - the parameters that were passed to the option when it was initiatedspublic java.util.List<Policy.ActionProb> getActionDistributionForState(State s, java.lang.String[] params)
OptiongetActionDistributionForState in class Options - the state for which this option's policy distribution should be returnedparams - the parameters that were passed to the option when it was initiated