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 |
---|---|
GroundedSingleAction |
getActionForId(int id)
Returns a corresponding GroundedSingleAction for a given int value
|
int |
getActionId(GroundedSingleAction 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(GroundedSingleAction gsa)
ActionIdMap
getActionId
in interface ActionIdMap
gsa
- the input actionpublic int getActionId(java.lang.String actionName, java.lang.String[] params)
ActionIdMap
getActionId
in interface ActionIdMap
actionName
- the input action nameparams
- the input action parameterspublic int maxValue()
ActionIdMap
maxValue
in interface ActionIdMap
public GroundedSingleAction getActionForId(int id)
ActionIdMap
getActionForId
in interface ActionIdMap
id
- the int value indicating which GroundedSingleAction to return.