public static class Policy.GroundedAnnotatedAction extends GroundedAction
GroundedAction
, with a string.
The resulting toString()
method will produce a string of the following form:GroundedAction
that is being annotated. The
leading * character indicates to GroundedAction
serializers (such as
the EpisodeAnalysis
serialization) that this GroundedAction
is an Policy.GroundedAnnotatedAction
.
GroundedAction
methods are delegated to the inputted
GroundedAction
.Modifier and Type | Field and Description |
---|---|
java.lang.String |
annotation
The string annotation to return in the
toString() method. |
GroundedAction |
delegate
The
GroundedAction delegate to be annotated that handles all
methods except the toString() method. |
action
Constructor and Description |
---|
Policy.GroundedAnnotatedAction(java.lang.String annotation,
GroundedAction delegate)
Initializes.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
actionName()
Returns the action name for this grounded action.
|
boolean |
applicableInState(State s) |
GroundedAction |
copy()
Returns a copy of this grounded action.
|
boolean |
equals(java.lang.Object other) |
EnvironmentOutcome |
executeIn(Environment env)
Executes this grounded action in the specified
Environment . |
State |
executeIn(State s)
Executes the grounded action on a given state
|
java.lang.String[] |
getParametersAsString()
Returns an array of string representations of this
AbstractGroundedAction 's parameters |
java.util.List<TransitionProbability> |
getTransitions(State s)
Returns the full set of possible state transitions when this
GroundedAction is applied in
the given state. |
int |
hashCode() |
void |
initParamsWithStringRep(java.lang.String[] params)
Initializes the parameter values of this
AbstractGroundedAction according
to the provided string representation of their values. |
boolean |
isParameterized()
Returns true if this action uses parameters
|
java.lang.String |
toString() |
GroundedAction |
translateParameters(State source,
State target)
A helper method that handles action translate in case this
GroundedAction implements
AbstractObjectParameterizedGroundedAction . |
public java.lang.String annotation
toString()
method.public GroundedAction delegate
GroundedAction
delegate to be annotated that handles all
methods except the toString()
method.public Policy.GroundedAnnotatedAction(java.lang.String annotation, GroundedAction delegate)
annotation
- the String annotation to be returned by the toString()
method.delegate
- the GroundedAction
delegate to be annotated.public java.lang.String actionName()
GroundedAction
actionName
in interface AbstractGroundedAction
actionName
in class GroundedAction
public boolean isParameterized()
AbstractGroundedAction
isParameterized
in interface AbstractGroundedAction
isParameterized
in class GroundedAction
public void initParamsWithStringRep(java.lang.String[] params)
AbstractGroundedAction
AbstractGroundedAction
according
to the provided string representation of their values.params
- an array in which each element is the string representation of one of this AbstractGroundedAction
's valuespublic java.lang.String[] getParametersAsString()
AbstractGroundedAction
AbstractGroundedAction
's parametersAbstractGroundedAction
's parameterspublic java.lang.String toString()
toString
in class GroundedAction
public boolean applicableInState(State s)
applicableInState
in class GroundedAction
public GroundedAction copy()
AbstractGroundedAction
copy
in interface AbstractGroundedAction
copy
in class GroundedAction
public EnvironmentOutcome executeIn(Environment env)
GroundedAction
Environment
.executeIn
in class GroundedAction
env
- the Environment
in which the action is to be executed.EnvironmentOutcome
specifying the outcome of this action.public State executeIn(State s)
GroundedAction
executeIn
in class GroundedAction
s
- the state on which to execute the actionpublic java.util.List<TransitionProbability> getTransitions(State s)
GroundedAction
GroundedAction
is applied in
the given state. If the underlying Action
definition does not implement
FullActionModel
, then a runtime exception will be thrown instead.getTransitions
in class GroundedAction
s
- the source state from which the transitions should be computed.List
of TransitionProbability
objects specifying all state transitions from the input state that have non-zero probability.public GroundedAction translateParameters(State source, State target)
GroundedAction
GroundedAction
implements
AbstractObjectParameterizedGroundedAction
. Works by calling the
AbstractObjectParameterizedGroundedAction.Helper.translateParameters(burlap.oomdp.core.AbstractGroundedAction, burlap.oomdp.core.states.State, burlap.oomdp.core.states.State)
method with this object as the action to translate.
If this is a AbstractObjectParameterizedGroundedAction
, then a new GroundedAction
with its object parameters mapped to the object names sin the target state
is returned.translateParameters
in class GroundedAction
source
- the source state in which this GroundedAction
's parameters were bound.target
- the target state in which the returned GroundedAction
will have its parameters bound.AbstractObjectParameterizedGroundedAction
, then a new GroundedAction
with its object parameters mapped to the object names sin the target statepublic int hashCode()
hashCode
in class GroundedAction
public boolean equals(java.lang.Object other)
equals
in class GroundedAction