msmazes::FSMBuilder<> Class Template Reference
[Core FSM Layer]

#include <msmazes/core/fsm/builder.hpp>

List of all members.


Detailed Description

template<>
class msmazes::FSMBuilder<>

All FSM Builder models provided by the Core Library are derived from this class template, which handles common initialization tasks and implements most of the associated types and functions specified in the FSM Builder concept. In fact, the only steps left for derived models to handle are initialization of the underlying pattern and providing any custom argument validation policies as necessary.


Template parameters

Parameter Description Default
PatternType The type of the underlying pattern.
ArgumentValidationPolicyType The argument validation policy that will determine the acceptance or rejection of initialization arguments. DefaultArgumentValidationPolicy


Model of


Type requirements



Public Types

typedef implementation_defined ArgumentValidationPolicy
typedef implementation_defined Pattern
typedef implementation_defined Cell
typedef implementation_defined Direction
typedef unspecified MazeGraph
typedef unspecified InputIndex
typedef unspecified StateIndex

Public Member Functions

 FSMBuilder ()
 The default constructor.
virtual ~FSMBuilder ()
 The destructor.
const PatterngetPattern () const
const MazeGraphgetMazeGraph () const
bool isReady () const
template<typename TransitionFunction>
void buildTransitionFunction (TransitionFunction &transition_function) const
StateIndex getSourceState () const
StateIndex getTargetState () const
bool hasSolutionFromState (const StateIndex source_state) const
InputIndex getCorrectInput (const StateIndex source_state) const
const CellgetStateCell (const StateIndex state) const
Direction getStateDirection (const StateIndex state) const

Protected Types

typedef implementation_defined MazeStructType

Protected Member Functions

template<typename RNGEngine, typename MazeMaker, typename FSMInputMaker, typename MazePolicy, typename ArgumentPack>
bool initialize (RNGEngine &rng_engine, const MazeMaker &maze_maker, const FSMInputMaker &input_maker, const MazePolicy &policy, const ArgumentPack &p)
const MazeStructTypegetMazeStruct () const


Member Typedef Documentation

typedef implementation_defined msmazes::FSMBuilder<>::ArgumentValidationPolicy
 

The Argument Validation Policy in effect, as defined in the FSM Builder concept.

typedef implementation_defined msmazes::FSMBuilder<>::Pattern
 

The type of the underlying pattern, as defined in the FSM Builder concept.

typedef implementation_defined msmazes::FSMBuilder<>::Cell
 

The type of the cells in the underlying pattern, as defined in the FSM Builder concept.

typedef implementation_defined msmazes::FSMBuilder<>::Direction
 

The type representing the course or bearing that is followed when traversing an edge in the underlying pattern's internal graph, as defined in the FSM Builder concept.

typedef implementation_defined msmazes::FSMBuilder<>::MazeStructType [protected]
 

The type of the data structure that stores the underlying maze graph and the solution path's source and target vertices.

typedef unspecified msmazes::FSMBuilder<>::MazeGraph
 

The type of the underlying maze graph, as defined in the FSM Builder concept.

typedef unspecified msmazes::FSMBuilder<>::InputIndex
 

The type representing the index of an edge in the underlying maze graph, as defined in the FSM Builder concept.

typedef unspecified msmazes::FSMBuilder<>::StateIndex
 

The type representing the index of a vertex in the underlying maze graph, as defined in the FSM Builder concept.


Constructor & Destructor Documentation

msmazes::FSMBuilder<>::FSMBuilder  )  [inline]
 

Constructs this FSMBuilder, but does not initialize it.

virtual msmazes::FSMBuilder<>::~FSMBuilder  )  [inline, virtual]
 

Destroys this FSMBuilder.


Member Function Documentation

template<typename RNGEngine, typename MazeMaker, typename FSMInputMaker, typename MazePolicy, typename ArgumentPack>
bool msmazes::FSMBuilder<>::initialize RNGEngine &  rng_engine,
const MazeMaker &  maze_maker,
const FSMInputMaker &  input_maker,
const MazePolicy &  policy,
const ArgumentPack &  p
[inline, protected]
 

If the argument validation policy in effect accepts the specified arguments, initializes the underlying pattern with the specified Argument Pack object, builds the underlying maze graph, then returns true; otherwise, returns false.

Parameter Name Description Preconditions
rng_engine A non-const reference to the rng_engine_arg named argument.
maze_maker A const reference to the maze_maker_arg named argument.
input_maker A const reference to the fsm_input_maker_arg named argument.
  • FSMInputMaker must model the FSM Input Maker concept.
  • If MazeMaker doesn't build last-visited maps, then FSMInputMaker must not require them.
policy A const reference to the maze_policy_arg named argument.
If more than one maze policy can be used for MazeMaker, then policy must be an instance of one of those policies.
p A pack of arguments to be passed to the underlying pattern. Consult the documentation for the pattern's initialize() function to find out what parameters are used.

const MazeStructType& msmazes::FSMBuilder<>::getMazeStruct  )  const [inline, protected]
 

Returns the data structure that stores the underlying maze graph.

Returns:
a const reference to the underlying maze struct.

const Pattern& msmazes::FSMBuilder<>::getPattern  )  const [inline]
 

Returns a const reference to the underlying pattern, as defined in the FSM Builder concept.

const MazeGraph& msmazes::FSMBuilder<>::getMazeGraph  )  const [inline]
 

Returns a const reference to the underlying maze graph, as defined in the FSM Builder concept.

bool msmazes::FSMBuilder<>::isReady  )  const [inline]
 

Returns the readiness of this FSMBuilder, as defined in the FSM Builder concept.

template<typename TransitionFunction>
void msmazes::FSMBuilder<>::buildTransitionFunction TransitionFunction &  transition_function  )  const [inline]
 

Builds the specified transition function according to the structure of the underlying maze graph and its property maps, as defined in the FSM Builder concept.

StateIndex msmazes::FSMBuilder<>::getSourceState  )  const [inline]
 

Returns the finite state machine's source state, as defined in the <a class="concept"href="concept__fsm__builder.html">FSM Builder concept.

StateIndex msmazes::FSMBuilder<>::getTargetState  )  const [inline]
 

Returns the finite state machine's target state, as defined in the FSM Builder concept.

bool msmazes::FSMBuilder<>::hasSolutionFromState const StateIndex  source_state  )  const [inline]
 

Indicates whether or not it is possible for the finite state machine to reach the target state from the specified state, as defined in the FSM Builder concept.

InputIndex msmazes::FSMBuilder<>::getCorrectInput const StateIndex  source_state  )  const [inline]
 

Returns the input that brings the finite state machine one step closer to its target state, as defined in the FSM Builder concept.

const Cell& msmazes::FSMBuilder<>::getStateCell const StateIndex  state  )  const [inline]
 

Returns the cell that the maze graph's cell index map pairs the specified state with, as defined in the FSM Builder concept.

Direction msmazes::FSMBuilder<>::getStateDirection const StateIndex  state  )  const [inline]
 

Returns the direction from the last-visited cell to the cell that the maze graph's cell index map pairs the specified state with, as defined in the FSM Builder concept.


Multi-State Mazes in C++ is hosted by SourceForge.net. Use the Table of Contents for navigation.