public abstract class SGAgentAction extends java.lang.Object
SGAgent) in a stochastic game. This class is analogous to the single-agent action definition class,
Action, except it does not include the transition dynamic information which is instead provided by a
JointActionModelthat takes the simultaneous action selections of all agents in a game and determines the outcome.
SGAgentActionis closely associated with an implementation of the
GroundedSGAgentActiondiffers from a
SGAgentActionin that the
GroundedSGAgentActionincludes parameter assignment information necessary for the agent to execute the action.
applicableInState(burlap.oomdp.core.states.State, GroundedSGAgentAction)method defines the preconditions of the action definition. The latter three methods are important for defining parameterized actions. Note that if you If you are defining a parameter-less action that has no preconditions (can be executed in any state), then you may simply use the
SimpleSGAgentActionimplementation for creating your action definition. Otherwise, the
isParameterized()method should return true and you will also need to implementing the remaining methods.
GroundedSGAgentActionimplementation stores a set of parameter assignments that need to be provided to apply your parameterized
SGAgentAction. For custom parameterizations, you will need to subclass
GroundedSGAgentActionto include data members for parameter assignments. The
getAssociatedGroundedAction(String)should then return an instance of your custom
GroundedSGAgentAction.actiondatamember pointing to this
GroundedSGAgentAction.actingAgentdata member pointing to the actingAgent argument. The parameter assignments in the returned
SGAgentActiondo not need to be specified; this method serves as a means for simply generating an instance of the associated
getAllApplicableGroundedActions(burlap.oomdp.core.states.State, String)method should return a list of
GroundedSGAgentActioninstances, covering all possible parameterizations of this action for the acting agent in the given state. However, the returned list should only include
GroundedSGAgentActioninstances that satisfy the
GroundedSGAgentActionsubclass is all that is required to implement a parameterized
SGAgentActionand by allowing you to define your own subclass of
GroundedSGAgentAction, you can have any kind of
SGAgentActionparametrization that you'd like. That said, a common form of
SGAgentActionparameterization is an action that operates on OO-MDP
ObjectInstancereferences in a state. If you would like to have a OO-MDP object parameterization, rather than define your own subclass, you should consider subclassing the
ObParamSGAgentActionclass. See it's documentation for more details.
|Modifier and Type||Field and Description|
|Constructor and Description|
Initializes this single action to be for the given domain and with the given name.
|Modifier and Type||Method and Description|
Returns true if this action can be applied in the given state by the given agent with the given parameters.
Returns all possible grounded versions of this single action for a given state and acting agent.
Returns all possible grounded versions of the provided list of SingleAction objects that an agent can take in the given state.
Returns true if this action is parameterized.
public java.lang.String actionName
public SGDomain domain
public SGAgentAction(SGDomain d, java.lang.String name)
d- the domain to which this action belongs
name- the name of this action
public abstract boolean applicableInState(State s, GroundedSGAgentAction gsa)
s- the state in which the action would be executed.
GroundedSGAgentActioncontaining the agent name and any parameters of the action
public abstract boolean isParameterized()
public abstract GroundedSGAgentAction getAssociatedGroundedAction(java.lang.String actingAgent)
GroundedSGAgentActioninstance that is associated with this
SGAgentActionfor the provided acting agent, without any parameters set (if there are parameters to set).
public abstract java.util.List<GroundedSGAgentAction> getAllApplicableGroundedActions(State s, java.lang.String actingAgent)
s- the state in which the agent would execute this action
actingAgent- the agent who would execute the action
public static java.util.List<GroundedSGAgentAction> getAllApplicableGroundedActionsFromActionList(State s, java.lang.String actingAgent, java.util.List<SGAgentAction> actions)
s- the state in which to execute actions
actingAgent- the agent who will be executing the actions
actions- the list of actions that to get the grounded version for
public int hashCode()
public boolean equals(java.lang.Object o)