public class GroundedSingleAction extends AbstractGroundedAction
SingleAction
. That is, since SingleAction
objects may take parameters,
this class provides a grounded version of the action that has specific objects bound to its parameters. Additionally,
this class also specifies who the acting agent is.Modifier and Type | Field and Description |
---|---|
java.lang.String |
actingAgent
The name of the agent performing the action
|
SingleAction |
action
The single action the acting agent will be performing
|
params
Constructor and Description |
---|
GroundedSingleAction(java.lang.String actingAgent,
SingleAction a,
java.lang.String p)
Initializes this object with the name of the acting agent, the SingleAction reference, and the parameters used.
|
GroundedSingleAction(java.lang.String actingAgent,
SingleAction a,
java.lang.String[] p)
Initializes this object with the name of the acting agent, the SingleAction reference, and the parameters used.
|
Modifier and Type | Method and Description |
---|---|
boolean |
actionDomainIsObjectIdentifierDependent()
Returns true if the domain to which this action belongs is object identifier dependent
|
java.lang.String |
actionName()
Returns the action name for this grounded action.
|
AbstractGroundedAction |
copy()
Returns a copy of this grounded action.
|
boolean |
equals(java.lang.Object other) |
State |
executeIn(State s)
Executes the grounded action on a given state
|
int |
hashCode() |
boolean |
isExecutable()
Returns true if this grounded action can be directly executed on a state with the
AbstractGroundedAction.executeIn(State) method. |
java.lang.String |
justActionString()
Returns a string specifying the action name and parameters used in this GroundedSingleAction.
|
boolean |
parametersAreObjects()
Returns true if all parameters (if any) for this action represent OO-MDP objects in a state; false otherwise.
|
java.lang.String |
toString() |
isParameterized, translateParameters
public java.lang.String actingAgent
public SingleAction action
public GroundedSingleAction(java.lang.String actingAgent, SingleAction a, java.lang.String[] p)
actingAgent
- the acting agent.a
- the SingleAction
.p
- a String array specifying the parameters bound to a.public GroundedSingleAction(java.lang.String actingAgent, SingleAction a, java.lang.String p)
actingAgent
- the acting agent.a
- the SingleAction
.p
- a command delineated string specifying the parameters bound to a.public java.lang.String justActionString()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String actionName()
AbstractGroundedAction
actionName
in class AbstractGroundedAction
public boolean isExecutable()
AbstractGroundedAction
AbstractGroundedAction.executeIn(State)
method. For example, a single agent domain grounded action is executable; a stochastic games single grounded action
is not, because the action of all other agents must also be known in order to get the next state.isExecutable
in class AbstractGroundedAction
public State executeIn(State s)
AbstractGroundedAction
executeIn
in class AbstractGroundedAction
s
- the state on which to execute the actionpublic boolean actionDomainIsObjectIdentifierDependent()
AbstractGroundedAction
actionDomainIsObjectIdentifierDependent
in class AbstractGroundedAction
public AbstractGroundedAction copy()
AbstractGroundedAction
copy
in class AbstractGroundedAction
public boolean parametersAreObjects()
AbstractGroundedAction
GroundedAction
will query
its referenced Action
object; GroundedSingleAction
will query its referenced SingleAction
.parametersAreObjects
in class AbstractGroundedAction