public interface ActionType
ActionType
acts as a generator for Action
objects. Its job is to define any preconditions for an
Action
, so that Action
objects with unsatisfied preconditions for an input state are not generated
in the state as well determine the set of valid parameterizations for a given input state. For example, in
a BlocksWorld
, the number of stack actions is dependent on the number
of clear blocks, and blocks that are not clear cannot be stacked on other blocks because their precondition
is not satisfied.
You can also use an ActionType
to generate different parameterizations of an Action
, even when
the parameters are not state dependent, but it is usually not necessary to do so and you might instead consider
creating a separate ActionType
for each parameterization.
Modifier and Type | Method and Description |
---|---|
java.util.List<Action> |
allApplicableActions(State s)
Returns all possible actions of this type that can be applied in the provided
State . |
Action |
associatedAction(java.lang.String strRep)
Returns an
Action whose parameters are specified by the given String representation (if
the ActionType manages multiple parameterizations) |
java.lang.String |
typeName()
The unique name of this
ActionType |
java.lang.String typeName()
ActionType
String
name of this ActionType
Action associatedAction(java.lang.String strRep)
Action
whose parameters are specified by the given String
representation (if
the ActionType
manages multiple parameterizations)java.util.List<Action> allApplicableActions(State s)
State
.s
- the State
in which all applicable actions of this ActionType
object should be returned.Action
s of this ActionType
object in in the given State