Go to the documentation of this file.
33 #ifndef TTA_FINITE_STATE_AUTOMATON_HH
34 #define TTA_FINITE_STATE_AUTOMATON_HH
68 int transitionCount = 0);
90 const std::string& name);
125 typedef std::map<std::string, FSAStateTransitionIndex>
static const FSAStateIndex ILLEGAL_STATE
A state id which denotes an illegal state.
int stateCount_
Count of states in the automaton.
int FSAStateIndex
Type used for indexing the states.
TransitionMap transitions_
The state transitions. In protected to allow fast access from derived classes.
virtual std::string stateName(FSAStateIndex state) const
virtual FSAStateIndex startState() const
virtual const std::string & transitionName(FSAStateTransitionIndex transition) const
std::vector< FSAStateIndex > TransitionVector
Vector which stores the target states of for each transition type.
FiniteStateAutomaton(FSAStateTransitionIndex defaultState=ILLEGAL_STATE, int transitionCount=0)
static const FSAStateIndex UNKNOWN_STATE
A state id which denotes an unknown (unresolved) state. Used for lazy construction of states.
TransitionNameIndex transitionIndices_
Indices of the state transition types.
std::map< std::string, FSAStateTransitionIndex > TransitionNameIndex
Type for finding the index for a transition using its name.
virtual void setTransition(FSAStateIndex source, FSAStateIndex destination, FSAStateTransitionIndex transition)
const FSAStateTransitionIndex defaultState_
The default target state for state transitions.
virtual std::string toDotString() const
virtual bool isLegalTransition(FSAStateIndex source, FSAStateTransitionIndex transition)
virtual FSAStateTransitionIndex transitionIndex(const std::string &transitionName) const
virtual FSAStateIndex addState()
int FSAStateTransitionIndex
Type used for indexing the transitions.
virtual void setTransitionName(FSAStateTransitionIndex transition, const std::string &name)
int transitionTypeCount_
Count of different transition types in the automaton.
std::vector< std::string > transitionNames_
Names of the state transitions types (indexed from 0).
virtual ~FiniteStateAutomaton()
virtual FSAStateTransitionIndex addTransitionType(const std::string &name)
std::set< FSAStateIndex > FSAStateIndexSet
Type for a set of state indices.
virtual FSAStateIndex destinationState(FSAStateIndex source, FSAStateTransitionIndex transition)
std::vector< TransitionVector > TransitionMap
Type for storing the transitions of each state. The vector stores for each state (indexed from 0) a v...