public abstract class GroundedSGAgentAction extends java.lang.Object implements AbstractGroundedAction
GroundedSGAgentAction is a high-level implementation
of the AbstractGroundedAction that is closely associated with the SGAgentAction
definition of actions that can be taken by agents in a multi-agent stochastic game. The role of a GroundedSGAgentAction
is to provide a reference to a corresponding SGAgentAction, a reference
to the name of the agent who is taking the action, and any other parameter assignment information that is necessary
for the agent to apply the action. The set of possible GroundedSGAgentAction instances
specifying the set of possible parameter assignments an action can apply will be generated by the associated
SGAgentAction method
SGAgentAction.getAllApplicableGroundedActions(burlap.oomdp.core.states.State, String).
See the SGAgentAction class documentation for more information on
defining parameterized SGAgentActions.
copy(),AbstractGroundedAction.initParamsWithStringRep(String[]) and,AbstractGroundedAction.getParametersAsString().copy() method should be override to return a new instance of your subclass with all parameter assignment information
copied over. The latter two methods are necessary for supporting all of the BURLAP's tools with parameterized actions, but
may not be needed for critical operations.
The AbstractGroundedAction.initParamsWithStringRep(String[]) allows the parameters of an action to be initialized from a string representation.
The AbstractGroundedAction.getParametersAsString() method gets a string representation of the parameters. If your action is
not parameterized, then you can simply use the SimpleGroundedSGAgentAction
implementation.
SGAgentAction definition with OO-MDP object parameters, you can use the existing
ObParamSGAgentAction, which is associated with the GroundedAction
subclass ObParamSGAgentAction.GroundedObParamSGAgentAction.| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
actingAgent
The name of the agent performing the action
|
SGAgentAction |
action
The single action the acting agent will be performing
|
| Constructor and Description |
|---|
GroundedSGAgentAction(java.lang.String actingAgent,
SGAgentAction a)
Initializes this object with the name of the acting agent, the SingleAction reference, and the parameters used.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
actionName()
Returns the action name for this grounded action.
|
boolean |
applicableInState(State s)
Returns whether this action is applicable (satisfies the preconditions) in the given input
State |
abstract GroundedSGAgentAction |
copy()
Returns a copy of this grounded action.
|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
boolean |
isParameterized()
Returns true if this action uses parameters
|
java.lang.String |
justActionString()
Returns a string specifying the action name and parameters used in this GroundedSingleAction.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetParametersAsString, initParamsWithStringReppublic java.lang.String actingAgent
public SGAgentAction action
public GroundedSGAgentAction(java.lang.String actingAgent,
SGAgentAction a)
actingAgent - the acting agent.a - the SGAgentAction.public boolean applicableInState(State s)
States - the input state to check againstState; false otherwisepublic java.lang.String justActionString()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String actionName()
AbstractGroundedActionactionName in interface AbstractGroundedActionpublic abstract GroundedSGAgentAction copy()
AbstractGroundedActioncopy in interface AbstractGroundedActionpublic boolean isParameterized()
AbstractGroundedActionisParameterized in interface AbstractGroundedAction