public class JointAction extends java.lang.Object implements AbstractGroundedAction, java.lang.Iterable<GroundedSGAgentAction>
GroundedSGAgentAction taken by that respective agent.
The GroundedSGAgentAction objects of this class can also
be iterated over.| Modifier and Type | Field and Description |
|---|---|
java.util.Map<java.lang.String,GroundedSGAgentAction> |
actions |
| Constructor and Description |
|---|
JointAction() |
JointAction(java.util.List<GroundedSGAgentAction> actions)
Adds all
GroundedSGAgentAction objects in a list to this joint action. |
| Modifier and Type | Method and Description |
|---|---|
GroundedSGAgentAction |
action(java.lang.String agentName)
Returns the action taken by the agent with the given name
|
java.lang.String |
actionName()
Returns the action name for this grounded action.
|
void |
addAction(GroundedSGAgentAction action)
Adds a single
GroundedSGAgentAction object to this joint action. |
protected static void |
allJointActionsHelper(java.util.List<java.util.List<GroundedSGAgentAction>> individualActionChoices,
int i,
java.util.LinkedList<GroundedSGAgentAction> currentSelections,
java.util.List<JointAction> allJointActions) |
JointAction |
copy()
Returns a copy of this grounded action.
|
boolean |
equals(java.lang.Object o) |
java.util.List<GroundedSGAgentAction> |
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<SGAgent> agents) |
static java.util.List<JointAction> |
getAllJointActions(State s,
java.util.Map<java.lang.String,SGAgentType> agents) |
java.lang.String[] |
getParametersAsString()
Returns an array of string representations of this
AbstractGroundedAction's parameters |
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.util.Iterator<GroundedSGAgentAction> |
iterator() |
java.lang.String |
noParametersActionDescription()
Returns a string representation of this joint aciton without including the parameters of any parameterized actions.
|
int |
size()
Returns the number of actions in this joint action.
|
java.lang.String |
toString() |
AbstractGroundedAction |
translateParameters(State sourceState,
State targetState) |
public java.util.Map<java.lang.String,GroundedSGAgentAction> actions
public JointAction()
public JointAction(java.util.List<GroundedSGAgentAction> actions)
GroundedSGAgentAction objects in a list to this joint action.actions - the actions to add to this joint action.public void addAction(GroundedSGAgentAction action)
GroundedSGAgentAction object to this joint action. Replaces the action for the same
agent if an action for that agent is already specified.action - the action to addpublic int size()
public java.util.List<GroundedSGAgentAction> getActionList()
public GroundedSGAgentAction 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.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.util.Iterator<GroundedSGAgentAction> iterator()
iterator in interface java.lang.Iterable<GroundedSGAgentAction>public JointAction copy()
AbstractGroundedActioncopy in interface AbstractGroundedActionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String actionName()
AbstractGroundedActionactionName in interface AbstractGroundedActionpublic AbstractGroundedAction translateParameters(State sourceState, State targetState)
public boolean isParameterized()
AbstractGroundedActionisParameterized in interface AbstractGroundedActionpublic static java.util.List<JointAction> getAllJointActions(State s, java.util.List<SGAgent> agents)
public static java.util.List<JointAction> getAllJointActions(State s, java.util.Map<java.lang.String,SGAgentType> agents)
protected static void allJointActionsHelper(java.util.List<java.util.List<GroundedSGAgentAction>> individualActionChoices, int i, java.util.LinkedList<GroundedSGAgentAction> currentSelections, java.util.List<JointAction> allJointActions)
public void initParamsWithStringRep(java.lang.String[] params)
AbstractGroundedActionAbstractGroundedAction according
to the provided string representation of their values.initParamsWithStringRep in interface AbstractGroundedActionparams - an array in which each element is the string representation of one of this AbstractGroundedAction's valuespublic java.lang.String[] getParametersAsString()
AbstractGroundedActionAbstractGroundedAction's parametersgetParametersAsString in interface AbstractGroundedActionAbstractGroundedAction's parameters