public abstract class SimpleAction extends Action
Action
for actions that are not parameterized, are primitive,
and have no preconditions (applicable everywhere). Only the Action.performActionHelper(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method needs to be implemented by a subclass and the FullActionModel.getTransitions(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method if the subclass implements the FullActionModel
interface. There is also an existing
subclass for simple deterministic actions (SimpleAction.SimpleDeterministicAction
) that fills in the FullActionModel.getTransitions(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method using the implementation of Action.performActionHelper(burlap.oomdp.core.states.State, burlap.oomdp.singleagent.GroundedAction)
method.Modifier and Type | Class and Description |
---|---|
static class |
SimpleAction.SimpleDeterministicAction
A abstract class for deterministic actions that are not parameterized, are primitive,
and have no preconditions (applicable everywhere).
|
actionObservers, domain, name
Constructor and Description |
---|
SimpleAction() |
SimpleAction(java.lang.String name,
Domain domain) |
Modifier and Type | Method and Description |
---|---|
boolean |
applicableInState(State s,
GroundedAction groundedAction)
Returns true if this action can be applied in this specified state with the parameters
specified by the provided
GroundedAction
Default behavior is that an action can be applied in any state,
but this will need be overridden if that is not the case. |
java.util.List<GroundedAction> |
getAllApplicableGroundedActions(State s)
Returns all possible groundings of this action that can be applied in the provided
State . |
GroundedAction |
getAssociatedGroundedAction()
Returns a
GroundedAction instance that points to this Action ,
but does not have any parameters--if any--set. |
boolean |
isParameterized()
Returns true if this action is parameterized; false otherwise.
|
boolean |
isPrimitive()
Returns whether this action is a primitive action of the domain or not.
|
addActionObserver, clearAllActionsObservers, deterministicTransition, equals, getAllApplicableGroundedActionsFromActionList, getDomain, getGroundedAction, getName, hashCode, performAction, performActionHelper, performInEnvironment
public SimpleAction()
public SimpleAction(java.lang.String name, Domain domain)
public boolean applicableInState(State s, GroundedAction groundedAction)
Action
GroundedAction
Default behavior is that an action can be applied in any state,
but this will need be overridden if that is not the case.applicableInState
in class Action
s
- the state to perform the action ongroundedAction
- the GroundedAction
specifying the parameters to usepublic boolean isPrimitive()
Action
isPrimitive
in class Action
public boolean isParameterized()
Action
isParameterized
in class Action
Action
is parameterized; false if it is not.public GroundedAction getAssociatedGroundedAction()
Action
GroundedAction
instance that points to this Action
,
but does not have any parameters--if any--set.getAssociatedGroundedAction
in class Action
GroundedAction
instance.public java.util.List<GroundedAction> getAllApplicableGroundedActions(State s)
Action
State
. To check if a grounded
action is applicable in the state, the Action.applicableInState(State, burlap.oomdp.singleagent.GroundedAction)
method is checked.
The default behavior of this method is to treat the parameters as possible object bindings, finding all bindings
that satisfy the object class typing specified and then checking them against the Action.applicableInState(State, burlap.oomdp.singleagent.GroundedAction)
method. However, this class can also be overridden to provide custom
grounding behavior or non-object based parametrization.getAllApplicableGroundedActions
in class Action
s
- the State
in which all applicable grounded actions of this Action
object should be returned.GroundedAction
s of this Action
object in in the given State