Assignment Search Framework
|
Public Member Functions | |
TransitionSystem () | |
virtual | ~TransitionSystem () |
virtual bool | isApplicable (const state_t &state, const action_t &action) const |
virtual bool | isChildState (const state_t &parent, const state_t &child) const |
virtual double | getActionCost (const state_t &state, const action_t &action) const =0 |
virtual void | applyAction (state_t &state, const action_t &action) const =0 |
virtual void | getActions (const state_t &state, std::vector< action_t > &actions) const =0 |
virtual void | getSuccessors (const state_t &state, std::vector< state_t > &children) const |
virtual bool | isInvertible (const state_t &state, const action_t &action) const |
virtual action_t | getInverse (const state_t &state, const action_t &action) const |
virtual action_t | getDummyAction () const =0 |
virtual bool | isDummyAction (const action_t &action) const =0 |
bool | applyActionSequence (state_t &state, const std::vector< action_t > &actions) const |
bool | isApplicableSequence (const state_t &state, const std::vector< action_t > &actions) const |
An abstract class defining the way transition systems are to be applied.
TransitionSystem< state_t, action_t >::TransitionSystem | ( | ) |
Constructor for the abstract transition system class. Abstract constructor is empty.
|
virtual |
Destructor for the abstract transition system class. Abstract destructor is empty.
|
pure virtual |
Applies the given action to the given state.
Assumes the given action is applicable in the given state.
state | The state to update. |
action | The action to apply. |
Implemented in TilePuzzleTransitions, and MapPathfindingTransitions.
bool TransitionSystem< state_t, action_t >::applyActionSequence | ( | state_t & | state, |
const std::vector< action_t > & | actions | ||
) | const |
Applies the given sequence of actions to the given state.
Returns false if the sequence is not entirely applicable. The state will be left at the point immediately prior to the sequence no longer being applicable.
state | The state to apply the sequence to. |
actions | The sequence of actions to apply. |
|
pure virtual |
Returns the cost of applying the given action in the given state.
Assumes the action is actually applicable in that state.
state | The state to apply the action in. |
action | The action to apply. |
Implemented in TilePuzzleTransitions, and MapPathfindingTransitions.
|
pure virtual |
Gets the actions applicable in a given state and appends them to the given list.
state | The state to generate actions in. |
actions | The list of actions to append to. |
Implemented in TilePuzzleTransitions, and MapPathfindingTransitions.
|
pure virtual |
Returns the dummy action for this domain.
The dummy action should never actually be applicable and is not invertible.
Implemented in TilePuzzleTransitions, and MapPathfindingTransitions.
|
virtual |
Returns the inverse of a given action.
If no inverse exists, returns the dummy action.
state | The state the action is being applied in. |
action | The action to invert. |
Reimplemented in TilePuzzleTransitions, and MapPathfindingTransitions.
|
virtual |
Gets the successors of a given state and appends them to the given list.
By default just generates list of applicable actions and generates the corresponding children.
state | The state to generate successors for. |
children | The list to append the children to. |
|
virtual |
Checks if the action is applicable in the given state.
state | The state in the domain. |
action | The action to test for applicability. |
Reimplemented in TilePuzzleTransitions, and MapPathfindingTransitions.
bool TransitionSystem< state_t, action_t >::isApplicableSequence | ( | const state_t & | state, |
const std::vector< action_t > & | actions | ||
) | const |
Checks if the given sequence of actions is applicable to the given state.
state | The state to try the sequence on. |
actions | The sequence of actions to test. |
|
virtual |
Checks if the given states are adjacent.
parent | The potential parent state. |
child | The potential child state. |
|
pure virtual |
Checks if the given action is the dummy action for this domain.
action | The action to check. |
Implemented in TilePuzzleTransitions, and MapPathfindingTransitions.
|
virtual |
Checks if the given action is invertible in the given state.
Assumes the action is either the dummy action, or is applicable in the given state.
state | The state the action is being applied in. |
action | The action to check. |
Reimplemented in TilePuzzleTransitions, and MapPathfindingTransitions.