public class JointAction extends AbstractGroundedAction implements java.lang.Iterable<GroundedSingleAction>
GroundedSingleAction
taken by that respective agent.
The GroundedSingleAction
objects of this class can also
be iterated over.Modifier and Type | Field and Description |
---|---|
java.util.Map<java.lang.String,GroundedSingleAction> |
actions |
params
Constructor and Description |
---|
JointAction() |
JointAction(java.util.List<GroundedSingleAction> actions)
Adds all
GroundedSingleAction objects in a list to this joint action. |
Modifier and Type | Method and Description |
---|---|
GroundedSingleAction |
action(java.lang.String agentName)
Returns the action taken by the agent with the given name
|
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.
|
void |
addAction(GroundedSingleAction action)
Adds a single
GroundedSingleAction object to this joint aciton |
protected static void |
allJointActionsHelper(java.util.List<java.util.List<GroundedSingleAction>> individualActionChoices,
int i,
java.util.LinkedList<GroundedSingleAction> currentSelections,
java.util.List<JointAction> allJointActions) |
JointAction |
copy()
Returns a copy of this grounded action.
|
boolean |
equals(java.lang.Object o) |
State |
executeIn(State s)
Executes the grounded action on a given state
|
java.util.List<GroundedSingleAction> |
getActionList()
Returns a list of the actions in this joint action.
|
java.util.List<java.lang.String> |
getAgentNames()
Returns a list of the names of all agents who are represented in this joint action.
|
static java.util.List<JointAction> |
getAllJointActions(State s,
java.util.List<Agent> agents) |
static java.util.List<JointAction> |
getAllJointActions(State s,
java.util.Map<java.lang.String,AgentType> agents) |
int |
hashCode() |
boolean |
isExecutable()
Returns true if this grounded action can be directly executed on a state with the
AbstractGroundedAction.executeIn(State) method. |
boolean |
isParameterized()
Returns true if this action uses parameters
|
java.util.Iterator<GroundedSingleAction> |
iterator() |
java.lang.String |
noParametersActionDescription()
Returns a string representation of this joint aciton without including the parameters of any parameterized actions.
|
boolean |
parametersAreObjects()
Returns true if all parameters (if any) for this action represent OO-MDP objects in a state; false otherwise.
|
int |
size()
Returns the number of actions in this joint action.
|
java.lang.String |
toString() |
AbstractGroundedAction |
translateParameters(State sourceState,
State targetState)
This method will translate this object's parameters that were assigned for a given source state, into object parameters in the
target state that are equal.
|
public java.util.Map<java.lang.String,GroundedSingleAction> actions
public JointAction()
public JointAction(java.util.List<GroundedSingleAction> actions)
GroundedSingleAction
objects in a list to this joint action.actions
- the actions to add to this joint action.public void addAction(GroundedSingleAction action)
GroundedSingleAction
object to this joint acitonaction
- the action to addpublic int size()
public java.util.List<GroundedSingleAction> getActionList()
public GroundedSingleAction action(java.lang.String agentName)
agentName
- the name of the agent whose taken action is to be returned.public java.util.List<java.lang.String> getAgentNames()
public java.lang.String noParametersActionDescription()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Iterator<GroundedSingleAction> iterator()
iterator
in interface java.lang.Iterable<GroundedSingleAction>
public JointAction copy()
AbstractGroundedAction
copy
in class AbstractGroundedAction
public boolean equals(java.lang.Object o)
equals
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 translateParameters(State sourceState, State targetState)
AbstractGroundedAction
translateParameters
in class AbstractGroundedAction
sourceState
- the source state from which this objects parameters were bound.targetState
- a target state with potentially different object identifiers for equivalent values.public boolean isParameterized()
AbstractGroundedAction
isParameterized
in class AbstractGroundedAction
public static java.util.List<JointAction> getAllJointActions(State s, java.util.List<Agent> agents)
public static java.util.List<JointAction> getAllJointActions(State s, java.util.Map<java.lang.String,AgentType> agents)
protected static void allJointActionsHelper(java.util.List<java.util.List<GroundedSingleAction>> individualActionChoices, int i, java.util.LinkedList<GroundedSingleAction> currentSelections, java.util.List<JointAction> allJointActions)
public boolean parametersAreObjects()
AbstractGroundedAction
GroundedAction
will query
its referenced Action
object; GroundedSingleAction
will query its referenced SingleAction
.parametersAreObjects
in class AbstractGroundedAction