public class ParameterNaiveActionIdMap extends java.lang.Object implements ActionIdMap
| Modifier and Type | Field and Description |
|---|---|
protected Domain |
domain
The domain for which the action values should be created.
|
protected java.util.Map<java.lang.String,java.lang.Integer> |
map
The map from action names to their corresponding int value
|
| Constructor and Description |
|---|
ParameterNaiveActionIdMap(Domain d)
Initializes a mapping from the names of all actions in a given domain to an int value.
|
| Modifier and Type | Method and Description |
|---|---|
GroundedSGAgentAction |
getActionForId(int id)
Returns a corresponding GroundedSingleAction for a given int value
|
int |
getActionId(GroundedSGAgentAction gsa)
Returns an int value corresponding to the input action
|
int |
getActionId(java.lang.String actionName,
java.lang.String[] params)
Returns an int value corresponding to the input action name and parameters
|
int |
maxValue()
The maximum number of int values for actions
|
protected java.util.Map<java.lang.String,java.lang.Integer> map
protected Domain domain
public ParameterNaiveActionIdMap(Domain d)
d - the domain containing the actions.public int getActionId(GroundedSGAgentAction gsa)
ActionIdMapgetActionId in interface ActionIdMapgsa - the input actionpublic int getActionId(java.lang.String actionName,
java.lang.String[] params)
ActionIdMapgetActionId in interface ActionIdMapactionName - the input action nameparams - the input action parameterspublic int maxValue()
ActionIdMapmaxValue in interface ActionIdMappublic GroundedSGAgentAction getActionForId(int id)
ActionIdMapgetActionForId in interface ActionIdMapid - the int value indicating which GroundedSingleAction to return.