Detailed Description

An Executor is a timed generator that maintains a current state.

The Executor is the lowest level building block for the libFAUDES simulator plugin. It maintains a current state that consists of

  • the discrete state;
  • a value map that assigns values to clock variables;
  • the current step aka logical time;
  • the current global clock aka clock time; as with faudes timed automata, clock time is in faudes-time units which may be mapped to physical time by a fixed conversion factor; see also DeviceExecutor. The state can be retrieved by the method Executor::CurrentState(void), and it is updated whenever time or transitions are executed via Executor::ExecuteTime(Time::Type) or Executor::ExecuteEvent(Idx). If you plan to execute multiple generators with synchronized shared events, you will find the class ParallelExecutor with a very similar interface more appropriate.

The Executor provides Methods that indicate which transitions currently are enabled, referring to the current state, the current clock values and the guard and invariant data from the TimedGenerator. In contrast to enabled events, there is also the notion of active events, which refers to the discrete state only, ignoring guards and invariants.

Technically, the Executor class is derived from the TimedGenerator, however inheritence is private. The common way to initialise an Executor object is to construct it from a const ref to a TimedGenerator, which sets up additional internal data structures. Read-only access to the underlying generator is given by the faudes::Executor::Generator() method.

Note: a prequisit of the current implementation is that the underlying generator is deterministic ie the current discrete state is uniquely determind by the external sequence of discrete events.

Definition at line 93 of file sp_executor.h.

#include <sp_executor.h>

Classes

struct  TimedState
 Typedef for timed state. More...
 

Public Member Functions

 Executor (void)
 Creates an emtpy Executer. More...
 
 Executor (const TimedGenerator &rGen)
 Construct from tgenerator. More...
 
 Executor (const std::string &rFileName)
 Construct from TimedGenerator file. More...
 
void Generator (const TimedGenerator &rGen)
 Initialise from TimedGenerator. More...
 
const TimedGeneratorGenerator (void) const
 Reference to the internal generator for inspection. More...
 
const std::string & Name (void) const
 Generator name (for convenience) More...
 
std::string StateName (Idx idx) const
 State name (for convenience) More...
 
std::string EventName (Idx idx) const
 Event name (for convenience) More...
 
void Clear (void)
 Clear all data incl TimedGenerator. More...
 
void Reset ()
 Reset all clocks and assign initial state. More...
 
const TimeIntervalEnabledTime () const
 Get maximal interval of time that can pass without executing an event. More...
 
const EventSetEnabledEvents () const
 Get set of events that are enabled at current (timed) state. More...
 
const EventSetDisabledEvents () const
 Get set of events that are disabled at current (timed) state. More...
 
const TimeIntervalEnabledInterval () const
 Get maximal interval on which set of enabled events is constant. More...
 
TimeInterval EnabledEventTime (Idx event) const
 Get interval on which an active event is enabled. More...
 
TimeInterval EnabledGuardTime (Idx event) const
 Get interval on which an active event satisfies its guard. More...
 
const EventSetActiveEventSet (void) const
 Get set of events that are active at current (untimed) state. More...
 
const TransSetActiveTransSet (void) const
 Get set of transitions that are active at current (untimed) state. More...
 
bool ExecuteTime (Time::Type time)
 Let time pass. More...
 
bool ExecuteEvent (Idx event)
 Execute transition. More...
 
bool CurrentTimedState (const TimedState &tstate)
 Set timed state. More...
 
const TimedStateCurrentTimedState (void) const
 Get timed state. More...
 
bool CurrentState (Idx index)
 Set discrete state. More...
 
Idx CurrentState (void) const
 Get discrete state. More...
 
bool CurrentClockValue (Idx clock, Time::Type time)
 Set value of clock variable. More...
 
Time::Type CurrentClockValue (Idx clock) const
 Get value of clock. More...
 
void CurrentTime (Time::Type time)
 Set current time. More...
 
Time::Type CurrentTime (void) const
 Get current time. More...
 
void CurrentStep (int step)
 Set logic time (# of steps) More...
 
int CurrentStep (void) const
 Get logic time ie numer of transitions so far. More...
 
bool IsDeadlocked () const
 Returns true if timed generator is in a deadlocked state. More...
 
virtual bool Valid (void) const
 Check if Executor is valid. More...
 
std::string CurrentTimedStateStr (void) const
 Pretty printable string of current state. More...
 
std::string TSStr (const TimedState &tstate) const
 Pretty printable string of timed state. More...
 
std::string TEStr (const TimedEvent &tevent) const
 Pretty printable string of timed event. More...
 
std::string CStr (Idx idx) const
 Pretty printable string of clock name. More...
 
std::string EStr (Idx idx) const
 Pretty printable string of event. More...
 
std::string SStr (Idx idx) const
 Pretty printable string of state. More...
 

Protected Member Functions

void DoAssign (const Executor &rSrc)
 Assignment method. More...
 
virtual void DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Reads configuration from TokenReader, see Typefor public wrappers. More...
 
virtual void DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Writes configuration to TokenWriter, see Type for public wrappers. More...
 
- Protected Member Functions inherited from faudes::TtGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >
 TtGenerator (void)
 Constructor. More...
 
 TtGenerator (const TtGenerator &rOtherGen)
 Copy constructor. More...
 
 TtGenerator (const vGenerator &rOtherGen)
 Copy constructor (no attributes) More...
 
virtual TtGeneratoroperator= (const TtGenerator &rOtherGen)
 Assignment operator (uses Assign) Note: you must reimplement this operator in derived classes in order to handle internal pointers correctly. More...
 
 TtGenerator (const std::string &rFileName)
 Construct from file. More...
 
TtGeneratorNew (void) const
 Construct on heap. More...
 
TtGeneratorCopy (void) const
 Construct copy on heap. More...
 
virtual const TypeCast (const Type *pOther) const
 Type test. More...
 
TtGenerator NewTGen (void) const
 Construct on stack. More...
 
SymbolTableClockSymbolTablep (void) const
 Get Pointer to mpClockSymbolTable. More...
 
void ClockSymbolTablep (SymbolTable *pClockSymTab)
 Set ClockSymbolTable. More...
 
Idx ClocksSize (void) const
 Number of clocks in mClocks. More...
 
const ClockSetClocks (void) const
 Get clockset as const reference. More...
 
ClockSetClocksp (void)
 Get clockset as pointer. More...
 
void InjectClocks (const ClockSet &newclocks)
 Overwrites mClocks with newclocks without consistency check. More...
 
std::string ClockName (Idx index) const
 Looks up clock name for given index. More...
 
Idx ClockIndex (const std::string &rName) const
 Looks up clock index for given name. More...
 
bool InsClock (Idx index)
 Add an existing clock to mClcoks by index. More...
 
Idx InsClock (const std::string &rName)
 Add named clock to generator. More...
 
void InsClocks (const ClockSet &rClockSet)
 Add new named clocks to generator. More...
 
bool DelClock (Idx index)
 Delete clock from generator by index. More...
 
bool DelClock (const std::string &rName)
 Delete clock from generator by name. More...
 
void DelClocks (const ClockSet &rClocks)
 Delete a set of clocks from generator. More...
 
bool ExistsClock (Idx index) const
 Test existence of clock in mClocks. More...
 
bool ExistsClock (const std::string &rName) const
 Test existence of clock in mClock. More...
 
ClockSet::Iterator FindClock (Idx index) const
 Returns a niterator to clock index in mClock. More...
 
ClockSet::Iterator FindClock (const std::string &rName) const
 Returns an iterator to clock index in mClock. More...
 
ClockSet ActiveClocks (void) const
 Returns all clocks used by all TimeConstraints and Resets. More...
 
ClockSet InactiveClocks (void) const
 Returns all clocks not used by any TimeConstraints or Reset. More...
 
void InsActiveClocks (void)
 Update Clocks to include all active clocks. More...
 
void DelInactiveClocks (void)
 Update Clocks not to include any inactive clocks. More...
 
ClockSet::Iterator ClocksBegin (void) const
 Iterator to Begin() of mClocks. More...
 
ClockSet::Iterator ClocksEnd (void) const
 Iterator to End() of mClocks. More...
 
void ConsistentTimeConstraint (const TimeConstraint &rTimeConstr) const
 Throw exception if timeconstraint refers to clocks not in clockset or symboltable mismatch. More...
 
void ConsistentClocks (const ClockSet &rClocks) const
 Throw exception if clocksset contains clocks not in generators clockset or symboltable mismatch. More...
 
const TimeConstraintInvariant (Idx idx) const
 Get invariant of state by index. More...
 
TimeConstraintInvariantp (Idx idx)
 Get invariant of state by index. More...
 
const TimeConstraintInvariant (const std::string &name) const
 Get invariant of state by name. More...
 
TimeConstraintInvariantp (const std::string &name)
 Get invariant of state by name. More...
 
void Invariant (Idx index, const TimeConstraint &rConstraints)
 Set invariant of state by index. More...
 
void Invariant (const std::string &name, const TimeConstraint &rConstraints)
 Set invariant of state by name. More...
 
void InsInvariant (const std::string &name, const TimeConstraint &rConstraints)
 Ins invariant of state by name. More...
 
void InsInvariant (Idx index, const TimeConstraint &rConstraints)
 Ins invariant of state by name. More...
 
void ClrInvariant (Idx idx)
 Clear invariant of state by index. More...
 
void ClrInvariant (const std::string &name)
 Clear invariant of state by name. More...
 
void ClearInvariants (void)
 Clear all invariants. More...
 
bool SetTransition (Idx x1, Idx ev, Idx x2)
 Add a transition to generator by indices. More...
 
bool SetTransition (const std::string &rX1, const std::string &rEv, const std::string &rX2)
 Add a transition to generator by names. More...
 
bool SetTransition (const Transition &rTransition, const TransAttr &rAttr)
 Add a transition with attribute to generator. More...
 
bool SetTransition (const Transition &rTrans, const TimeConstraint &rGuard=TimeConstraint(), const ClockSet &rResets=ClockSet())
 Inserts new TimedTransition constructed from parameters. More...
 
bool SetTransition (Idx x1, Idx ev, Idx x2, const TimeConstraint &rguard, const ClockSet &rResetClocks=ClockSet())
 Inserts new TimedTransition constructed from parameters. More...
 
bool SetTransition (const std::string &rX1, const std::string &rEv, const std::string &rX2, const TimeConstraint &rGuard=TimeConstraint(), const ClockSet &rResets=ClockSet())
 Inserts new TimedTransition constructed from parameters. More...
 
void Guard (const Transition &rTrans, const TimeConstraint &rGuard)
 Sets Guard of a transition. More...
 
void InsGuard (const Transition &rTrans, const TimeConstraint &rConstraints)
 adds constraints to Guard of a transition More...
 
const TimeConstraintGuard (const Transition &rTrans) const
 Gets Guard refernce of a transition. More...
 
TimeConstraintGuardp (const Transition &rTrans)
 Gets Guard pointer of ransition. More...
 
void ClrGuard (const Transition &rTrans)
 Clears Guard of a transition. More...
 
void Resets (const Transition &rTrans, const ClockSet &rResets)
 Sets Resets of a transition. More...
 
void InsResets (const Transition &rTrans, const ClockSet &rMoreResets)
 adds Resets of a transition More...
 
const ClockSetResets (const Transition &rTrans) const
 Gets Resets refernce of a transition. More...
 
ClockSetResetsp (const Transition &rTrans)
 Gets Resets pointer of ransition. More...
 
void ClrResets (const Transition &rTrans)
 Clears Resets of a transition. More...
 
std::string CStr (Idx index) const
 Return pretty printable clock name for index. More...
 
virtual bool UpdateAttributes (void)
 Updates internal attributes. More...
 
- Protected Member Functions inherited from faudes::TcGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >
 TcGenerator (void)
 Creates an emtpy System object. More...
 
 TcGenerator (const vGenerator &rOtherGen)
 System from a std Generator. More...
 
 TcGenerator (const TcGenerator &rOtherGen)
 System from a System. More...
 
 TcGenerator (const std::string &rFileName)
 construct a System from file More...
 
TcGenerator NewCGen (void) const
 Construct on stack. More...
 
virtual TcGeneratoroperator= (const TcGenerator &rOtherGen)
 Assignment operator (uses Assign) More...
 
virtual TcGeneratorAssign (const Type &rSource)
 Assignment method. More...
 
void InsControllableEvent (Idx index)
 Add an existing controllable event to generator. More...
 
Idx InsControllableEvent (const std::string &rName)
 Add new named controllable event to generator. More...
 
void InsUncontrollableEvent (Idx index)
 Add an existing uncontrollable event to generator. More...
 
Idx InsUncontrollableEvent (const std::string &rName)
 Add new named uncontrollable event to generator. More...
 
void SetControllable (Idx index)
 Mark event controllable (by index) More...
 
void SetControllable (const std::string &rName)
 Mark event controllable (by name) More...
 
void SetControllable (const EventSet &rEvents)
 Mark set of events controllable (by index) More...
 
void ClrControllable (Idx index)
 Mark event uncontrollable (by index) More...
 
void ClrControllable (const std::string &rName)
 Mark event uncontrollable (by name) More...
 
void ClrControllable (const EventSet &rEvents)
 Mark set of events uncontrollable (by index) More...
 
bool Controllable (Idx index) const
 Is event controllable (by index) More...
 
bool Controllable (const std::string &rName) const
 Is event controllable (by name) More...
 
EventSet ControllableEvents (void) const
 Get EventSet with controllable events. More...
 
EventSet UncontrollableEvents (void) const
 Get EventSet with uncontrollable events. More...
 
void InsObservableEvent (Idx index)
 Add an existing observable event to generator. More...
 
Idx InsObservableEvent (const std::string &rName)
 Add new named observable event to generator. More...
 
void InsUnobservableEvent (Idx index)
 Add an existing unobservable event to generator. More...
 
Idx InsUnobservableEvent (const std::string &rName)
 Add new named unobservable event to generator. More...
 
void SetObservable (Idx index)
 Mark event observable (by index) More...
 
void SetObservable (const std::string &rName)
 Mark event observable (by name) More...
 
void SetObservable (const EventSet &rEvents)
 Mark set of events observable. More...
 
void ClrObservable (Idx index)
 Mark event unobservable (by index) More...
 
void ClrObservable (const std::string &rName)
 Mark event unobservable (by name) More...
 
void ClrObservable (const EventSet &rEvents)
 Mark set of events unobservable. More...
 
bool Observable (Idx index) const
 Is event observable (by index) More...
 
bool Observable (const std::string &rName) const
 Is event observable (by name) More...
 
EventSet ObservableEvents (void) const
 Get EventSet with observable events. More...
 
EventSet UnobservableEvents (void) const
 Get EventSet with unobservable events. More...
 
void InsForcibleEvent (Idx index)
 Add an existing forcible event to generator. More...
 
Idx InsForcibleEvent (const std::string &rName)
 Add new named forcible event to generator. More...
 
void InsUnforcibleEvent (Idx index)
 Add an existing unforcible event to generator. More...
 
Idx InsUnforcibleEvent (const std::string &rName)
 Add new named unforcible event to generator. More...
 
void SetForcible (Idx index)
 Mark event forcible (by index) More...
 
void SetForcible (const std::string &rName)
 Mark event forcible (by name) More...
 
void SetForcible (const EventSet &rEvents)
 Mark set of events forcible. More...
 
void ClrForcible (Idx index)
 Mark event unforcible (by index) More...
 
void ClrForcible (const std::string &rName)
 Mark event unforcible (by name) More...
 
void ClrForcible (const EventSet &rEvents)
 Mark set of events unforcible. More...
 
bool Forcible (Idx index) const
 Is event forcible (by index) More...
 
bool Forcible (const std::string &rName) const
 Is event forcible (by name) More...
 
EventSet ForcibleEvents (void) const
 Get EventSet with forcible events. More...
 
EventSet UnforcibleEvents (void) const
 Get EventSet with unforcible events. More...
 
void InsHighlevelEvent (Idx index)
 Add an existing abstraction event to generator. More...
 
Idx InsHighlevelEvent (const std::string &rName)
 Add new named abstraction event to generator. More...
 
void InsLowlevelEvent (Idx index)
 Add an existing low-level event to generator. More...
 
Idx InsLowlevelEvent (const std::string &rName)
 Add new named low-level event to generator. More...
 
void SetHighlevel (Idx index)
 Mark event as highlevel event (by index) More...
 
void SetHighlevel (const std::string &rName)
 Mark event as highlevel event (by name) More...
 
void SetHighlevel (const EventSet &rEvents)
 Mark set of events as high-level events. More...
 
void SetLowlevel (Idx index)
 Mark event as low-level event (by index) More...
 
void SetLowlevel (const std::string &rName)
 Mark event as low-level event (by name) More...
 
void SetLowlevel (const EventSet &rEvents)
 Mark set of events as low-level events. More...
 
bool Highlevel (Idx index) const
 Test for high-level event (by index) More...
 
bool Highlevel (const std::string &rName) const
 Test for high-level event (by name) More...
 
bool Lowlevel (Idx index) const
 Test for low-level event (by index) More...
 
bool Lowlevel (const std::string &rName) const
 Test for low-level event (by name) More...
 
EventSet HighlevelEvents (void) const
 Get EventSet of all high-level events. More...
 
EventSet LowlevelEvents (void) const
 Get EventSet of all low-level events. More...
 
- Protected Member Functions inherited from faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >
virtual void NewCore (void)
 Allocate my heap members (attribute dependent types) More...
 
virtual void UpdateCore (void)
 Update my secondary pointers for new core. More...
 
void DoAssign (const TaGenerator &rGen)
 Assignment. More...
 
 TaGenerator (void)
 Construct an emtpy Generator. More...
 
 TaGenerator (const TaGenerator &rOtherGen)
 Copy-constructor (from TaGenerator, incl attributes) More...
 
 TaGenerator (const vGenerator &rOtherGen)
 Copy-constructor (from vGenerator, set attributes to default) More...
 
 TaGenerator (const std::string &rFileName)
 Construct from file. More...
 
virtual TaGenerator NewAGen (void) const
 Construct on stack. More...
 
virtual ~TaGenerator (void)
 Destructor. More...
 
virtual TaGeneratoroperator= (const TaGenerator &rOtherGen)
 Assignment operator (uses Assign(Generator&) ) More...
 
virtual void Move (TaGenerator &rGen)
 Destructive copy to other TaGenerator Copy method with increased performance at the cost of invalidating the source data. More...
 
virtual void Move (Generator &rGen)
 Destructive copy to other Generator. More...
 
const TaEventSet< EventAttr > & Alphabet (void) const
 Return const reference to alphabet. More...
 
const TaStateSet< StateAttr > & States (void) const
 Return reference to state set. More...
 
const ATransSetTransRel (void) const
 Return reference to transition relation. More...
 
void TransRel (TransSetX1EvX2 &res) const
 Get copy of trantision relation sorted by other compare operator, e.g. More...
 
void TransRel (TransSetEvX1X2 &res) const
 
void TransRel (TransSetEvX2X1 &res) const
 
void TransRel (TransSetX2EvX1 &res) const
 
void TransRel (TransSetX2X1Ev &res) const
 
void TransRel (TransSetX1X2Ev &res) const
 
bool InsEvent (Idx index)
 Add an existing event to alphabet by index. More...
 
Idx InsEvent (const std::string &rName)
 Add named event to generator. More...
 
bool InsEvent (Idx index, const EventAttr &rAttr)
 Add an existing event to alphabet by index, incl. More...
 
Idx InsEvent (const std::string &rName, const EventAttr &rAttr)
 Add named event with attribute to generator. More...
 
void InjectAlphabet (const EventSet &rNewalphabet)
 Set mpAlphabet without consistency check. More...
 
void InjectAlphabet (const TaEventSet< EventAttr > &rNewalphabet)
 Set mpAlphabet without consistency check. More...
 
Idx InsState (void)
 Add new anonymous state to generator. More...
 
Idx InsState (const StateAttr &attr)
 Add new anonymous state with attribute to generator. More...
 
bool InsState (Idx index)
 Add (perhaps new) state to generator. More...
 
Idx InsState (const std::string &rName)
 Add new named state to generator. More...
 
Idx InsState (const std::string &rName, const StateAttr &attr)
 Add new named state with attribute to generator. More...
 
bool InsState (Idx index, const StateAttr &attr)
 Add (perhaps new) state with attribute to generator. More...
 
void InjectStates (const StateSet &rNewStates)
 Inject a complete state set without consistency checks. More...
 
void InjectStates (const TaStateSet< StateAttr > &rNewStates)
 Inject a complete state set without consistency checks. More...
 
bool SetTransition (Idx x1, Idx ev, Idx x2)
 Add a transition to generator by indices. More...
 
bool SetTransition (const std::string &rX1, const std::string &rEv, const std::string &rX2)
 Add a transition to generator by names. More...
 
bool SetTransition (const Transition &rTransition)
 Add a transition to generator. More...
 
bool SetTransition (const Transition &rTransition, const TransAttr &rAttr)
 Add a transition with attribute to generator. More...
 
void InjectTransRel (const TransSet &rNewtransrel)
 Set transition relation without consistency check. More...
 
void InjectTransRel (const ATransSet &rNewtransrel)
 Set transition relation without consistency check. More...
 
void EventAttribute (Idx index, const EventAttr &rAttr)
 Set attribute for existing event. More...
 
void EventAttribute (Idx index, const Type &rAttr)
 Set attribute for existing event. More...
 
const EventAttr & EventAttribute (Idx index) const
 Event attribute lookup. More...
 
const EventAttr & EventAttribute (const std::string &rName) const
 Event attribute lookup. More...
 
EventAttr * EventAttributep (Idx index)
 Event attribute pointer (to access Attribute methods) note: may insert explicit default attribute. More...
 
EventAttr * EventAttributep (const std::string &rName)
 Event attribute pointer (to access Attribute methods) note: may insert explicit default attribute. More...
 
void StateAttribute (Idx index, const StateAttr &rAttr)
 Set attribute for existing state. More...
 
void StateAttribute (Idx index, const Type &rAttr)
 Set attribute for existing state. More...
 
const StateAttr & StateAttribute (Idx index) const
 State attribute lookup. More...
 
StateAttr * StateAttributep (Idx index)
 State attribute pointer (to access Attribute methods) note: may insert explicit default attribute. More...
 
void TransAttribute (const Transition &rTrans, const TransAttr &rAttr)
 Set attribute for existing transition. More...
 
void TransAttribute (const Transition &rTrans, const Type &rAttr)
 Set attribute for existing transition. More...
 
const TransAttr & TransAttribute (const Transition &rTrans) const
 Get attribute for existing transition. More...
 
TransAttr * TransAttributep (const Transition &rTrans)
 Get attribute pointer for existing transition note: may insert explicit default attribute. More...
 
void GlobalAttribute (const GlobalAttr &rAttr)
 Set global attribute. More...
 
void GlobalAttribute (const Type &rAttr)
 Set global attribute. More...
 
const GlobalAttr & GlobalAttribute (void) const
 Get global attribute ref. More...
 
GlobalAttr * GlobalAttributep (void)
 Get global attribute pointer. More...
 
- Protected Member Functions inherited from faudes::vGenerator
virtual void DeleteCore (void)
 Free my heap members (attribute dependent types) More...
 
void ConfigureAttributeTypes (const AttributeVoid *pNewGlobalPrototype, const StateSet *pNewStatesPrototype, const EventSet *pNewAlphabetPrototype, const TransSet *pNewTransRelPrototype)
 Configure attribute types. More...
 
void DoAssign (const vGenerator &rSrc)
 Assignment for matching type. More...
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write generator in debugging format to TokenWriter, see Type::DWrite for public wrappers. More...
 
virtual void DoSWrite (TokenWriter &rTw) const
 Write generator statistics as comment to TokenWriter, see Type::SWrite for public wrappers. More...
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write generator to TokenWriter, see Type::XWrite for public wrappers. More...
 
void ReadAlphabet (TokenReader &rTr)
 Read the generator's alphabet from a TokenReader. More...
 
void WriteStates (TokenWriter &rTw) const
 Write generators stateset to TokenWriter. More...
 
void ReadStates (TokenReader &rTr)
 Read the generator's stateset from a TokenReader. More...
 
void XReadStateSet (TokenReader &rTr, StateSet &rStateSet, const std::string &rLabel="") const
 Read a stateset from TokenReader in XML format. More...
 
void ReadTransRel (const std::string &rFileName)
 Read the generator's transition relation from a file. More...
 
void ReadTransRel (TokenReader &rTr)
 Read the generator's transition relation from a TokenReader. More...
 
void XReadTransRel (TokenReader &rTr)
 Read the generator's transition relation from a TokenReader. More...
 
void XWriteStateSet (TokenWriter &rTw, const StateSet &rStateSet, const std::string &rLabel="") const
 Write a stateset to TokenWriter in XML format. More...
 
void XWriteTransRel (TokenWriter &rTw) const
 Write transition relation to tokenwriter in XML format. More...
 
 vGenerator (void)
 Default constructor. More...
 
 vGenerator (const vGenerator &rOtherGen)
 Copy-constructror. More...
 
 vGenerator (const std::string &rFileName)
 Construct from file. More...
 
virtual ~vGenerator (void)
 Destructor. More...
 
virtual vGeneratorAssignWithoutAttributes (const vGenerator &rGen)
 Copy from other vGenerator, ignore attributes. More...
 
virtual vGeneratoroperator= (const vGenerator &rOtherGen)
 Assignment operator (uses Assign method) More...
 
virtual void Version (const std::string &rVersion, vGenerator &rResGen) const
 Create another version of this generator. More...
 
virtual void Version (Idx version, vGenerator &rResGen) const
 Create another version of this generator. More...
 
virtual void Version (const std::string &rPattern, const std::string &rReplacement, vGenerator &rResGen) const
 Create another version of this generator. More...
 
void Name (const std::string &rName)
 Set the generator's name. More...
 
void ClearStates (void)
 Clear all states and transitions, maintain alphabet. More...
 
Idx AlphabetSize (void) const
 Get number of events in alphabet. More...
 
Idx Size (void) const
 Get generator size (number of states) More...
 
Idx TransRelSize (void) const
 Get number of transitions. More...
 
Idx InitStatesSize (void) const
 Get number of initial states. More...
 
Idx MarkedStatesSize (void) const
 Get number of marked states. More...
 
bool Empty (void) const
 Check if generator is empty (no states) More...
 
bool AlphabetEmpty (void) const
 Check if alphabet is Empty. More...
 
bool TransRelEmpty (void) const
 Check if transition relation is empty. More...
 
bool InitStatesEmpty (void) const
 Check if set of initial states are empty. More...
 
bool MarkedStatesEmpty (void) const
 Check if set of marked states are empty. More...
 
SymbolTableEventSymbolTablep (void) const
 Get Pointer to EventSymbolTable currently used by this vGenerator. More...
 
virtual void EventSymbolTablep (SymbolTable *pSymTab)
 Set EventSymbolTable to be used by this vGenerator. More...
 
virtual void EventSymbolTablep (const vGenerator &rOtherGen)
 Set EventSymbolTable as given by rOtherGen. More...
 
EventSet NewEventSet (void) const
 Create EventSet with generator's EventSymbolTable (on stack). More...
 
EventSetNewEventSetp (void) const
 Create EventSet with generator's EventSymbolTable (on heap). More...
 
Idx EventIndex (const std::string &rName) const
 Event index lookup. More...
 
std::string EventName (Idx index) const
 Event name lookup. More...
 
void EventName (Idx index, const std::string &rName)
 Set name for existing event. More...
 
std::string UniqueEventName (const std::string &rName) const
 Create a new unique symbolic event name. More...
 
bool EventRename (Idx event, const std::string &rNewName)
 Rename event in this generator. More...
 
bool EventRename (const std::string &rOldName, const std::string &rNewName)
 Rename event in this generator. More...
 
const SymbolTableStateSymbolTable (void) const
 Get StateSymbolTable. More...
 
void StateSymbolTable (const SymbolTable &rSymTab)
 Set StateSymbolTable. More...
 
Idx StateIndex (const std::string &rName) const
 State index lookup. More...
 
std::string StateName (Idx index) const
 State name lookup. More...
 
void StateName (Idx index, const std::string &rName)
 Set name of state. More...
 
void ClearStateNames (void)
 Remove all names from generator's StateSymbolTable. More...
 
void ClrStateName (Idx index)
 Clear name for individual state. More...
 
void ClrStateName (const std::string &rName)
 Clear name for individual state. More...
 
bool StateNamesEnabled (void) const
 Whether libFAUEDS functions are requested to generate state names. More...
 
void StateNamesEnabled (bool flag)
 Enable/disable libFAUEDS functions to automatically generate state names. More...
 
void SetDefaultStateNames (void)
 Assign each state a default name based on its index. More...
 
void EnforceStateNames (const std::string &rTemplate)
 For all states without a symbolic name, assign a name based on suggested template and the index. More...
 
std::string UniqueStateName (const std::string &rName) const
 Create a new unique symbolic state name. More...
 
EventSet::Iterator AlphabetBegin (void) const
 Iterator to Begin() of alphabet. More...
 
EventSet::Iterator AlphabetEnd (void) const
 Iterator to End() of alphabet. More...
 
bool ExistsEvent (Idx index) const
 Test existence of event in alphabet. More...
 
bool ExistsEvent (const std::string &rName) const
 Test existence of event in alphabet. More...
 
EventSet::Iterator FindEvent (Idx index) const
 Returns a iterator to event index in alphabet. More...
 
EventSet::Iterator FindEvent (const std::string &rName) const
 Returns a iterator to event index in alphabet. More...
 
const EventSetAlphabet (void) const
 Return const reference to alphabet. More...
 
StateSet::Iterator StatesBegin (void) const
 Iterator to Begin() of state set. More...
 
StateSet::Iterator StatesEnd (void) const
 Iterator to End() of state set. More...
 
bool ExistsState (Idx index) const
 Test existence of state in state set. More...
 
bool ExistsState (const std::string &name) const
 Test existence of state in state set. More...
 
StateSet::Iterator FindState (Idx index) const
 Returns a iterator to state index in state set. More...
 
StateSet::Iterator FindState (const std::string &rName) const
 Returns a iterator to state with specified name. More...
 
const StateSetStates (void) const
 Return reference to state set. More...
 
Idx InitState (void) const
 Return initial state. More...
 
StateSet::Iterator InitStatesBegin (void) const
 Iterator to Begin() of mInitStates. More...
 
StateSet::Iterator InitStatesEnd (void) const
 Iterator to End() of mInitStates. More...
 
bool ExistsInitState (Idx index) const
 Test existence of state in mInitStates. More...
 
StateSet::Iterator FindInitState (Idx index) const
 Iterator to state index in mInitStates. More...
 
const StateSetInitStates (void) const
 Const ref to initial states. More...
 
StateSet::Iterator MarkedStatesBegin (void) const
 Iterator to Begin() of mMarkedStates. More...
 
StateSet::Iterator MarkedStatesEnd (void) const
 Iterator to End() of mMarkedStates. More...
 
bool ExistsMarkedState (Idx index) const
 Test existence of state in mMarkedStates. More...
 
StateSet::Iterator FindMarkedState (Idx index) const
 Returns a iterator to state index in mMarkedStates. More...
 
const StateSetMarkedStates (void) const
 Return const ref of marked states. More...
 
TransSet::Iterator TransRelBegin (void) const
 Iterator to Begin() of transition relation. More...
 
TransSet::Iterator TransRelEnd (void) const
 Iterator to End() of transition relation. More...
 
TransSet::Iterator TransRelBegin (Idx x1) const
 Iterator to begin of transitions with x1 as predecessor state. More...
 
TransSet::Iterator TransRelEnd (Idx x1) const
 iterator to end of transitions with x1 as predecessor state. More...
 
TransSet::Iterator TransRelBegin (Idx x1, Idx ev) const
 iterator to begin of transitions with x1 as predecessor state and event ev. More...
 
TransSet::Iterator TransRelEnd (Idx x1, Idx ev) const
 Iterator to end of transitions with x1 as predecessor state and event ev. More...
 
TransSet::Iterator FindTransition (const std::string &rX1, const std::string &rEv, const std::string &rX2) const
 iterator to transition given by x1, ev, x2 More...
 
TransSet::Iterator FindTransition (Idx x1, Idx ev, Idx x2) const
 Iterator to transition given by x1, ev, x2. More...
 
TransSet::Iterator FindTransition (const Transition &rTrans) const
 Iterator to transition. More...
 
bool ExistsTransition (const std::string &rX1, const std::string &rEv, const std::string &rX2) const
 Test for transition given by x1, ev, x2. More...
 
bool ExistsTransition (Idx x1, Idx ev, Idx x2) const
 Test for transition given by x1, ev, x2. More...
 
bool ExistsTransition (const Transition &rTrans) const
 test for transition More...
 
bool ExistsTransition (Idx x1, Idx ev) const
 Test for transition given by x1, ev. More...
 
bool ExistsTransition (Idx x1) const
 Test for transition given by x1. More...
 
const TransSetTransRel (void) const
 Return reference to transition relation. More...
 
void TransRel (TransSetX1EvX2 &res) const
 Get copy of trantision relation sorted by other compare operator, e.g. More...
 
void TransRel (TransSetEvX1X2 &res) const
 
void TransRel (TransSetEvX2X1 &res) const
 
void TransRel (TransSetX2EvX1 &res) const
 
void TransRel (TransSetX2X1Ev &res) const
 
void TransRel (TransSetX1X2Ev &res) const
 
Transition TransitionByNames (const std::string &rX1, const std::string &rEv, const std::string &rX2) const
 Convebience function. More...
 
bool InsEvent (Idx index)
 Add an existing event to alphabet by index. More...
 
Idx InsEvent (const std::string &rName)
 Add named event to generator. More...
 
void InsEvents (const EventSet &events)
 Add new named events to generator. More...
 
bool DelEvent (Idx index)
 Delete event from generator by index. More...
 
bool DelEvent (const std::string &rName)
 Delete event from generator by name. More...
 
void DelEvents (const EventSet &rEvents)
 Delete a set of events from generator. More...
 
bool DelEventFromAlphabet (Idx index)
 Delete event from alphabet without consistency check. More...
 
void InjectAlphabet (const EventSet &rNewalphabet)
 Set mpAlphabet without consistency check. More...
 
void RestrictAlphabet (const EventSet &rNewalphabet)
 Restricts mpAlphabet incl removing resp. More...
 
Idx InsState (void)
 Add new anonymous state to generator. More...
 
bool InsState (Idx index)
 Add (perhaps new) state to generator. More...
 
Idx InsState (const std::string &rName)
 Add new named state to generator. More...
 
void InsStates (const StateSet &rStates)
 Add anonymous states to generator. More...
 
bool DelState (Idx index)
 Delete a state from generator by index. More...
 
bool DelState (const std::string &rName)
 Delete a state from generator by name. More...
 
void DelStates (const StateSet &rDelStates)
 Delete a set of states Cleans mpStates, mInitStates, mMarkedStates, mpTransrel, and mpStateSymboltable. More...
 
bool DelStateFromStates (Idx index)
 Delete a state from generator without consistency check. More...
 
StateSet::Iterator DelStateFromStates (StateSet::Iterator pos)
 Delete a state from generator without consistency check. More...
 
void RestrictStates (const StateSet &rStates)
 Restrict states Cleans mpStates, mInitStates, mMarkedStates, mpTransrel, and mpStateSymboltable. More...
 
void InjectState (Idx index)
 Inject an existing state index into generators mStates Use with care! For use in performance optimized functions. More...
 
void InjectStates (const StateSet &rNewStates)
 Inject a complete state set without consistency checks (without attributes) More...
 
Idx InsInitState (void)
 Create new anonymous state and set as initial state. More...
 
bool InsInitState (Idx index)
 Add (perhaps new) state to generator and turn it into a initial state. More...
 
Idx InsInitState (const std::string &rName)
 Create a new named state and set as initial state. More...
 
void InsInitStates (const StateSet &rStates)
 Add (perhaps new) anonymous initial states to generator
More...
 
Idx InsMarkedState (void)
 Create new anonymous state and set as marked state. More...
 
bool InsMarkedState (Idx index)
 Add (perhaps new) state to generator and turn it into a marked state. More...
 
Idx InsMarkedState (const std::string &rName)
 Create a new named state and set as marked state. More...
 
void InsMarkedStates (const StateSet &rStates)
 Add (perhaps new) anonymous initial states to generator
More...
 
void SetInitState (Idx index)
 Set an existing state as initial state by index. More...
 
void SetInitState (const std::string &rName)
 Set an existing state as initial state by name. More...
 
void InjectInitStates (const StateSet &rNewInitStates)
 Replace mInitStates with StateSet given as parameter without consistency checks. More...
 
void ClrInitState (Idx index)
 Unset an existing state as initial state by index. More...
 
void ClrInitState (const std::string &rName)
 Unset an existing state as initial state by name. More...
 
StateSet::Iterator ClrInitState (StateSet::Iterator pos)
 Unset an existing state as initial state by iterator. More...
 
void ClearInitStates (void)
 Clear all mInitStates. More...
 
void SetMarkedState (Idx index)
 Set an existing state as marked state by index. More...
 
void SetMarkedState (const std::string &rName)
 Set an existing state as marked state by name. More...
 
void ClrMarkedState (Idx index)
 Unset an existing state as marked state by index. More...
 
void ClrMarkedState (const std::string &rName)
 Unset an existing state as marked state by name. More...
 
StateSet::Iterator ClrMarkedState (StateSet::Iterator pos)
 Unset an existing state as marked state by iterator. More...
 
void ClearMarkedStates (void)
 Clear all marked states. More...
 
void InjectMarkedStates (const StateSet &rNewMarkedStates)
 Replace mMarkedStates with StateSet given as parameter without consistency checks. More...
 
bool SetTransition (Idx x1, Idx ev, Idx x2)
 Add a transition to generator by indices. More...
 
bool SetTransition (const std::string &rX1, const std::string &rEv, const std::string &rX2)
 Add a transition to generator by names. More...
 
bool SetTransition (const Transition &rTransition)
 Add a transition to generator. More...
 
void ClrTransition (Idx x1, Idx ev, Idx x2)
 Remove a transition by indices. More...
 
void ClrTransition (const Transition &rTrans)
 Remove a transition by transition object. More...
 
TransSet::Iterator ClrTransition (TransSet::Iterator it)
 Remove a transition by iterator. More...
 
void ClrTransitions (Idx x1, Idx ev)
 Remove a transitions by state and event. More...
 
void ClrTransitions (Idx x1)
 Remove a transitions by state. More...
 
void ClearTransRel (void)
 Clear all transitions. More...
 
void InjectTransition (const Transition &rTrans)
 Set transition without consistency check. More...
 
void InjectTransRel (const TransSet &rNewtransrel)
 Set transition relation without consistency check (no attributes) More...
 
virtual void ClearAttributes (void)
 Clear Attributes. More...
 
virtual void ClearEventAttributes (void)
 Clear event attributes. More...
 
virtual void ClrEventAttribute (Idx index)
 Clear attribute for existing event. More...
 
virtual void EventAttributes (const EventSet &rEventSet)
 Set attributes for existing events. More...
 
virtual void ClearStateAttributes (void)
 Clear state attributes. More...
 
virtual void ClrStateAttribute (Idx index)
 Clear attribute for existing state. More...
 
virtual void ClearTransAttributes (void)
 Clear transition attributes. More...
 
virtual void ClrTransAttribute (const Transition &rTrans)
 Clear attribute for existing transition. More...
 
virtual void ClearGlobalAttribute (void)
 Clear global attribute. More...
 
virtual void GlobalAttributeTry (const Type &rAttr)
 Set global attribute. More...
 
StateSet AccessibleSet (void) const
 Compute set of accessible states. More...
 
bool Accessible (void)
 Make generator accessible. More...
 
bool IsAccessible (void) const
 Check if generator is accessible. More...
 
StateSet CoaccessibleSet (void) const
 Compute set of Coaccessible states. More...
 
bool Coaccessible (void)
 Make generator Coaccessible. More...
 
bool IsCoaccessible (void) const
 Check if generator is Coaccessible. More...
 
StateSet BlockingStates (void) const
 Compute set of blocking states. More...
 
StateSet TerminalStates (void) const
 Compute set of terminal states. More...
 
StateSet TerminalStates (const StateSet &rStates) const
 Compute set of terminal states. More...
 
bool IsComplete (void) const
 Check if generator is complete. More...
 
bool IsComplete (const StateSet &rStates) const
 Check if generator is complete. More...
 
bool IsComplete (const EventSet &rSigmaO) const
 Check if generator is complete w.r.t. More...
 
bool Complete (void)
 Make generator Complete. More...
 
bool Complete (const EventSet &rSigmaO)
 Make generator Complete w.r.t. More...
 
StateSet TrimSet (void) const
 Compute set of trim states. More...
 
bool Trim (void)
 Make generator trim. More...
 
bool IsTrim (void) const
 Check if generator is trim. More...
 
bool OmegaTrim (void)
 Make generator omega-trim. More...
 
bool IsOmegaTrim (void) const
 Check if generator is omega-trim. More...
 
EventSet UsedEvents (void) const
 Return used events (executed in transitions) More...
 
EventSet UnusedEvents (void) const
 Return unused events. More...
 
void MinimizeAlphabet (void)
 Set the alphabet to used events. More...
 
EventSet ActiveEventSet (Idx x1) const
 Return active event set at state x1. More...
 
TransSet ActiveTransSet (Idx x1) const
 Return active transition set at state x1. More...
 
StateSet TransRelStates (void) const
 Return the states covered by transitions. More...
 
Idx SuccessorState (Idx x1, Idx ev) const
 Return the successor state of state x1 with event ev. More...
 
StateSet SuccessorStates (Idx x1) const
 Return the successor states of state x1. More...
 
StateSet SuccessorStates (Idx x1, Idx ev) const
 Return the successor states of state x1 with event ev. More...
 
bool IsDeterministic (void) const
 Check if generator is deterministic. More...
 
void SetMinStateIndexMap (void) const
 Set minimal index map for file io of generator states. More...
 
void ClearMinStateIndexMap (void) const
 Clear minimal index map for 1:1 file io. More...
 
Idx MinStateIndex (Idx index) const
 Get state index as is it will be written to file. More...
 
void MinStateIndex (void)
 Re-enumerate states. More...
 
Idx MaxStateIndex (void) const
 Get maximum state index used in this generator. More...
 
const std::map< Idx, Idx > & MinStateIndexMap (void) const
 Get state index translation map. More...
 
std::string EStr (Idx index) const
 Pretty printable event name for index (eg for debugging). More...
 
std::string SStr (Idx index) const
 Return pretty printable state name for index (eg for debugging) More...
 
std::string TStr (const Transition &rTrans) const
 Return pretty printable transition (eg for debugging) More...
 
void GraphWrite (const std::string &rFileName, const std::string &rOutFormat="", const std::string &rDotExec="dot") const
 Produce graphical representation of this generator. More...
 
bool operator< (const vGenerator &rOtherGen) const
 Order for sorting containers of generators. More...
 
void WriteAlphabet (void) const
 Write generators alphabet to console. More...
 
std::string AlphabetToString (void) const
 Write generators alphabet to string. More...
 
void WriteAlphabet (TokenWriter &rTw) const
 Write generators alphabet to tokenwriter. More...
 
void WriteStateSet (const StateSet &rStateSet) const
 Write a stateset to console (no re-indexing). More...
 
std::string StateSetToString (const StateSet &rStateSet) const
 Write a stateset to string (no re-indexing). More...
 
std::string StateSetToText (const StateSet &rStateSet) const
 Write a stateset to formated text (no re-indexing). More...
 
void WriteStateSet (TokenWriter &rTw, const StateSet &rStateSet) const
 Write a stateset to TokenWriter. More...
 
void DWriteStateSet (TokenWriter &rTw, const StateSet &rStateSet) const
 Write a stateset to TokenWriter (debug version, no re-indexing) More...
 
std::string StatesToString (void) const
 Write stateset of this generator to a string (no re-indexing) More...
 
std::string StatesToText (void) const
 Write stateset of this generator to formated text (no re-indexing) More...
 
std::string MarkedStatesToString (void) const
 Write set of marked states to a string (no re-indexing) More...
 
std::string InitStatesToString (void) const
 Write set of initial states to a string (no re-indexing) More...
 
void WriteTransRel (void) const
 Write transition relation to console (no re-indexing) More...
 
std::string TransRelToString (void) const
 Write transition relation to string (no re-indexing) More...
 
std::string TransRelToText (void) const
 Write transition relation to formated text (no re-indexing) More...
 
void WriteTransRel (TokenWriter &rTw) const
 Write transition relation to tokenwriter. More...
 
void DWriteTransRel (TokenWriter &rTw) const
 Write transition relation to tokenwriter (debug version) More...
 
virtual void DotWrite (const std::string &rFileName) const
 Writes generator to dot input format. More...
 
virtual void DDotWrite (const std::string &rFileName) const
 Writes generator to dot input format (no re-indexing). More...
 
virtual void XDotWrite (const std::string &rFileName) const
 Writes generator to dot input format for export to VioLib. More...
 
void ReadStateSet (TokenReader &rTr, const std::string &rLabel, StateSet &rStateSet) const
 Read a state set. More...
 
bool ReindexOnWrite (void) const
 Test whether file-i/o uses minimal state indicees. More...
 
void ReindexOnWrite (bool flag)
 Enable/disable minimal state indicees for file-i/o. More...
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 Assign configuration data from other object. More...
 
bool DoEqual (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 Get objects's type definition. More...
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 
 Type (void)
 Constructor. More...
 
 Type (const Type &rType)
 Copy constructor. More...
 
virtual ~Type (void)
 Destructor. More...
 
virtual Typeoperator= (const Type &rSrc)
 Assign configurationdata from other object. More...
 
virtual bool Equal (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator== (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual bool operator!= (const Type &rOther) const
 Test equality of configuration data. More...
 
virtual const std::string & TypeName (void) const
 Get objects's type name. More...
 
void Write (const Type *pContext=0) const
 Write configuration data to console. More...
 
void Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 Write configuration data to a file. More...
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 Write configuration data to a file. More...
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to TokenWriter. More...
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to an XML file. More...
 
void XWrite (const Type *pContext=0) const
 Write configuration data in XML format to concole Note: this write function uses the virtual function DoXWrite(), to be reimplemented by derived classes. More...
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in XML format to TokenWriter. More...
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a string. More...
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data to a formated string. More...
 
void DWrite (const Type *pContext=0) const
 Write configuration data to console, debugging format. More...
 
void DWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 Write configuration data to a file, debugging format. More...
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debug format to TokenWriter. More...
 
void SWrite (TokenWriter &rTw) const
 Write statistics comment to TokenWriter. More...
 
void SWrite (void) const
 Write statistics comment to console. More...
 
std::string ToSText (void) const
 Write statistics to a string. More...
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from file with label specified. More...
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from a string. More...
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 Read configuration data from TokenReader with label sepcified. More...
 

Private Member Functions

void Compile (void)
 Prepare internal data structurs from generator. More...
 
void ComputeEnabled (void) const
 Compute enabled events and enabled interval (fake const) More...
 
void ComputeEnabledNonConst (void)
 Compute enabled core routine (non const) More...
 

Private Attributes

TimedState mCurrentTimedState
 Current state incl clock values. More...
 
Time::Type mCurrentTime
 Current clock time. More...
 
int mCurrentStep
 Current logic time. More...
 
TimeInterval mETime
 Record enabled time. More...
 
EventSet mEEvents
 Record enabled events. More...
 
TimeInterval mEInterval
 Record rime on shich mEEvents is constant
More...
 
std::map< Idx, TimeIntervalmEGuardInterval
 Record interval in which each guard is enabled
More...
 
EventSet mDEvents
 Record disabled events. More...
 
EventSet mAEvents
 Record active events (ie regardles time) More...
 
TransSet mATrans
 Record active transitions (regardles time) More...
 
bool mEValid
 Validity flag for the above data. More...
 
std::map< Transition, std::map< Idx, TimeInterval > > mTransClockIntervalMap
 Compiled generator data: map transition to clock to interval constraint. More...
 
std::map< Idx, std::map< Idx, TimeInterval > > mStateClockIntervalMap
 Compiled generator data: map state to clock to interval constraint. More...
 

Additional Inherited Members

- Protected Types inherited from faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >
typedef TaTransSet< TransAttr > ATransSet
 Convenience typdef for member transiton set. More...
 
- Static Protected Member Functions inherited from faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >
static const TaNameSet< EventAttr > & AlphabetTaGen (void)
 Static default alphabet prototype (incl. More...
 
static const TaIndexSet< StateAttr > & StatesTaGen (void)
 Static default state set prototype (incl. More...
 
static const ATransSetTransRelTaGen (void)
 Static default transition relation prototype (incl. More...
 
static const GlobalAttr & GlobalTaGen (void)
 Static default global attribute prototype (configures global attribute type) More...
 
- Static Protected Member Functions inherited from faudes::vGenerator
static const EventSetAlphabetVoid (void)
 Static default alphabet prototype (incl. More...
 
static const StateSetStatesVoid (void)
 Static default state set prototype (incl. More...
 
static const TransSetTransRelVoid (void)
 Static default transition relation prototype (incl. More...
 
static const AttributeVoidGlobalVoid (void)
 Static default global attribute prototype (configures global attribute type) More...
 
static SymbolTableGlobalEventSymbolTablep (void)
 Get Pointer to global EventSymbolTable. More...
 
static void StateNamesEnabledDefault (bool flag)
 Sets the default for automatic state name generation. More...
 
static void ReindexOnWriteDefault (bool flag)
 Enable/disable reindexing states for file-i/o. More...
 
static bool ReindexOnWriteDefault (void)
 Enable/disable reindexing states for file-i/o. More...
 
- Protected Attributes inherited from faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >
TaNameSet< EventAttr > * pAlphabet
 Alphabet, pointer with actual attribute type. More...
 
TaIndexSet< StateAttr > * pStates
 State set, pointer with actual attribute type. More...
 
ATransSetpTransRel
 Transition relation, pointer with actual attribute type. More...
 
GlobalAttr * pGlobalAttribute
 Global attribute, pointer with actual attribute type. More...
 
- Protected Attributes inherited from faudes::vGenerator
std::string mMyName
 Name of generator. More...
 
Idx mId
 Number of generator. More...
 
SymbolTable mStateSymbolTable
 State symbol table (local per Generator) More...
 
SymbolTablempStateSymbolTable
 Pointer to State symbol table. More...
 
SymbolTablempEventSymbolTable
 Pointer to Event symbol table. More...
 
bool mStateNamesEnabled
 Automatic state names. More...
 
bool mReindexOnWrite
 Reindex states on file-i/o. More...
 
EventSetmpAlphabet
 Pointer to alphabet (actual type depends on attributes) More...
 
StateSetmpStates
 Pointer to state set (actual type depends on attributes) More...
 
TransSetmpTransRel
 Pointer to ransition relation (actual type depends on attributes) More...
 
AttributeVoidmpGlobalAttribute
 Pointer to lobal attribute (actual type depends on attributes) More...
 
const EventSetpAlphabetPrototype
 Pointer to alphabet prototype (incl. More...
 
const StateSetpStatesPrototype
 Pointer to state set prototype (incl. More...
 
const TransSetpTransRelPrototype
 Pointer to transition relation prototype (incl. More...
 
const AttributeVoidpGlobalPrototype
 Pointer to global attribute prototype (configures global attribute type) More...
 
StateSet mInitStates
 Initial states. More...
 
StateSet mMarkedStates
 Marked states. More...
 
std::map< Idx, IdxmMinStateIndexMap
 Map State indices to consecutive indices. More...
 
- Static Protected Attributes inherited from faudes::vGenerator
static Idx msObjectCount = 0
 Number of generator objects. More...
 
static bool msStateNamesEnabledDefault = true
 Default for automatic statenames. More...
 
static bool msReindexOnWriteDefault = false
 Default for automatic statenames. More...
 

Constructor & Destructor Documentation

◆ Executor() [1/3]

faudes::Executor::Executor ( void  )

Creates an emtpy Executer.

Definition at line 22 of file sp_executor.cpp.

◆ Executor() [2/3]

faudes::Executor::Executor ( const TimedGenerator rGen)

Construct from tgenerator.

Construction from a TimedGenerator will copy all given TimedGenerator data and complie it to some additional Executor specific data. Thus, if the original TimedGenerator changes the Executor will not reflect these changes.

Parameters
rGenInput generator
Exceptions
Exception
  • Nondetrministic input generator (id 501)

Definition at line 29 of file sp_executor.cpp.

◆ Executor() [3/3]

faudes::Executor::Executor ( const std::string &  rFileName)

Construct from TimedGenerator file.

Parameters
rFileNameFile to read
Exceptions
Exception
  • IO errors (id 1)
  • token mismatch (id 50, 51, 52, 80, 85)
  • nondetrministic generator (id 501)

Definition at line 35 of file sp_executor.cpp.

Member Function Documentation

◆ ActiveEventSet()

const EventSet & faudes::Executor::ActiveEventSet ( void  ) const

Get set of events that are active at current (untimed) state.

Returns
Set of active events

Definition at line 273 of file sp_executor.cpp.

◆ ActiveTransSet()

const TransSet & faudes::Executor::ActiveTransSet ( void  ) const

Get set of transitions that are active at current (untimed) state.

Returns
Set of active trans

Definition at line 279 of file sp_executor.cpp.

◆ Clear()

void faudes::Executor::Clear ( void  )
virtual

Clear all data incl TimedGenerator.

Reimplemented from faudes::TaGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >.

Definition at line 91 of file sp_executor.cpp.

◆ Compile()

void faudes::Executor::Compile ( void  )
private

Prepare internal data structurs from generator.

Definition at line 53 of file sp_executor.cpp.

◆ ComputeEnabled()

void faudes::Executor::ComputeEnabled ( void  ) const
private

Compute enabled events and enabled interval (fake const)

Definition at line 138 of file sp_executor.cpp.

◆ ComputeEnabledNonConst()

void faudes::Executor::ComputeEnabledNonConst ( void  )
private

Compute enabled core routine (non const)

Definition at line 144 of file sp_executor.cpp.

◆ CStr()

std::string faudes::Executor::CStr ( Idx  idx) const

Pretty printable string of clock name.

Definition at line 496 of file sp_executor.cpp.

◆ CurrentClockValue() [1/2]

Time::Type faudes::Executor::CurrentClockValue ( Idx  clock) const

Get value of clock.

Parameters
clockIndex of clock variable
Returns
time Value of clock variable

Definition at line 422 of file sp_executor.cpp.

◆ CurrentClockValue() [2/2]

bool faudes::Executor::CurrentClockValue ( Idx  clock,
Time::Type  time 
)

Set value of clock variable.

Returns false if clock not in clockset.

Parameters
clockIndex of clock variable to set
timeTime to set
Returns
True/false – success

Definition at line 414 of file sp_executor.cpp.

◆ CurrentState() [1/2]

bool faudes::Executor::CurrentState ( Idx  index)

Set discrete state.

Returns false if state is not in state set.

Parameters
indexState index
Returns
True/false – success

Definition at line 401 of file sp_executor.cpp.

◆ CurrentState() [2/2]

Idx faudes::Executor::CurrentState ( void  ) const

Get discrete state.

Returns
Discret state by index

Definition at line 409 of file sp_executor.cpp.

◆ CurrentStep() [1/2]

void faudes::Executor::CurrentStep ( int  step)

Set logic time (# of steps)

Parameters
stepNew logic time

Definition at line 441 of file sp_executor.cpp.

◆ CurrentStep() [2/2]

int faudes::Executor::CurrentStep ( void  ) const

Get logic time ie numer of transitions so far.

Definition at line 447 of file sp_executor.cpp.

◆ CurrentTime() [1/2]

void faudes::Executor::CurrentTime ( Time::Type  time)

Set current time.

Parameters
timeNew current time

Definition at line 430 of file sp_executor.cpp.

◆ CurrentTime() [2/2]

Time::Type faudes::Executor::CurrentTime ( void  ) const

Get current time.

Returns
time Current time

Definition at line 436 of file sp_executor.cpp.

◆ CurrentTimedState() [1/2]

bool faudes::Executor::CurrentTimedState ( const TimedState tstate)

Set timed state.

Returns false if state or clock values are invalid.

Parameters
tstateState to set.
Returns
True/false – success

Definition at line 382 of file sp_executor.cpp.

◆ CurrentTimedState() [2/2]

const Executor::TimedState & faudes::Executor::CurrentTimedState ( void  ) const

Get timed state.

Returns
Current discrete state and clock values.

Definition at line 396 of file sp_executor.cpp.

◆ CurrentTimedStateStr()

std::string faudes::Executor::CurrentTimedStateStr ( void  ) const

Pretty printable string of current state.

Definition at line 479 of file sp_executor.cpp.

◆ DisabledEvents()

const EventSet & faudes::Executor::DisabledEvents ( void  ) const

Get set of events that are disabled at current (timed) state.

Returns
Set of disabled events

Definition at line 261 of file sp_executor.cpp.

◆ DoAssign()

void faudes::Executor::DoAssign ( const Executor rSrc)
protected

Assignment method.

Parameters
rSrcSource to assign from

Definition at line 128 of file sp_executor.cpp.

◆ DoRead()

void faudes::Executor::DoRead ( TokenReader rTr,
const std::string &  rLabel = "",
const Type pContext = 0 
)
protectedvirtual

Reads configuration from TokenReader, see Typefor public wrappers.

Parameters
rTrTokenReader to read from
rLabelSection to read
pContextRead context to provide contextual information
Exceptions
Exception
  • IO error (id 1)

Reimplemented from faudes::vGenerator.

Definition at line 115 of file sp_executor.cpp.

◆ DoWrite()

void faudes::Executor::DoWrite ( TokenWriter rTw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Writes configuration to TokenWriter, see Type for public wrappers.

Parameters
rTwTokenWriter to write to
rLabelSection to write
pContextWrite context to provide contextual information
Exceptions
Exception
  • IO error (id 2)

Reimplemented from faudes::vGenerator.

Definition at line 122 of file sp_executor.cpp.

◆ EnabledEvents()

const EventSet & faudes::Executor::EnabledEvents ( void  ) const

Get set of events that are enabled at current (timed) state.

Returns
Set of enabled events

Definition at line 255 of file sp_executor.cpp.

◆ EnabledEventTime()

TimeInterval faudes::Executor::EnabledEventTime ( Idx  event) const

Get interval on which an active event is enabled.

Parameters
eventActive event
Returns
TimeInterval (empty if event not active or active with guard violated)

Definition at line 285 of file sp_executor.cpp.

◆ EnabledGuardTime()

TimeInterval faudes::Executor::EnabledGuardTime ( Idx  event) const

Get interval on which an active event satisfies its guard.

Parameters
eventActive event
Returns
TimeInterval (empty if event not active or active with guard violated)

Definition at line 304 of file sp_executor.cpp.

◆ EnabledInterval()

const TimeInterval & faudes::Executor::EnabledInterval ( void  ) const

Get maximal interval on which set of enabled events is constant.

Returns
TimeInterval

Definition at line 267 of file sp_executor.cpp.

◆ EnabledTime()

const TimeInterval & faudes::Executor::EnabledTime ( void  ) const

Get maximal interval of time that can pass without executing an event.

This corresponds to the inveriant of the current timed state.

Returns
TimeInterval

Definition at line 249 of file sp_executor.cpp.

◆ EStr()

std::string faudes::Executor::EStr ( Idx  idx) const

Pretty printable string of event.

Definition at line 491 of file sp_executor.cpp.

◆ EventName()

std::string faudes::Executor::EventName ( Idx  idx) const
inline

Event name (for convenience)

Definition at line 174 of file sp_executor.h.

◆ ExecuteEvent()

bool faudes::Executor::ExecuteEvent ( Idx  event)

Execute transition.

Returns false if the transition is not enabled and hence cannot be executed at the current time

Parameters
eventIndicate transition to execute
Returns
True/false – success

Definition at line 354 of file sp_executor.cpp.

◆ ExecuteTime()

bool faudes::Executor::ExecuteTime ( Time::Type  time)

Let time pass.

Returns false if the specified amount of time cannot elapse without an event being executed

Parameters
timeAmount of time that shall elapse.
Returns
True/false – success

Definition at line 317 of file sp_executor.cpp.

◆ Generator() [1/2]

void faudes::Executor::Generator ( const TimedGenerator rGen)

Initialise from TimedGenerator.

Parameters
rGenInput generator

Definition at line 46 of file sp_executor.cpp.

◆ Generator() [2/2]

const TimedGenerator & faudes::Executor::Generator ( void  ) const

Reference to the internal generator for inspection.

Returns
const reference of mTGen

Definition at line 41 of file sp_executor.cpp.

◆ IsDeadlocked()

bool faudes::Executor::IsDeadlocked ( void  ) const

Returns true if timed generator is in a deadlocked state.

Returns
true/false

Definition at line 452 of file sp_executor.cpp.

◆ Name()

const std::string& faudes::Executor::Name ( void  ) const
inlinevirtual

Generator name (for convenience)

Reimplemented from faudes::vGenerator.

Definition at line 161 of file sp_executor.h.

◆ Reset()

void faudes::Executor::Reset ( void  )

Reset all clocks and assign initial state.

Definition at line 102 of file sp_executor.cpp.

◆ SStr()

std::string faudes::Executor::SStr ( Idx  idx) const

Pretty printable string of state.

Definition at line 501 of file sp_executor.cpp.

◆ StateName()

std::string faudes::Executor::StateName ( Idx  idx) const
inline

State name (for convenience)

Definition at line 167 of file sp_executor.h.

◆ TEStr()

std::string faudes::Executor::TEStr ( const TimedEvent tevent) const

Pretty printable string of timed event.

Definition at line 484 of file sp_executor.cpp.

◆ TSStr()

std::string faudes::Executor::TSStr ( const TimedState tstate) const

Pretty printable string of timed state.

Definition at line 460 of file sp_executor.cpp.

◆ Valid()

virtual bool faudes::Executor::Valid ( void  ) const
inlinevirtual

Check if Executor is valid.

Not implemented, should check for determinism and consitency of current state and clock values.

Returns
Success

Reimplemented from faudes::TtGenerator< GlobalAttr, StateAttr, EventAttr, TransAttr >.

Definition at line 395 of file sp_executor.h.

Member Data Documentation

◆ mAEvents

EventSet faudes::Executor::mAEvents
private

Record active events (ie regardles time)

Definition at line 511 of file sp_executor.h.

◆ mATrans

TransSet faudes::Executor::mATrans
private

Record active transitions (regardles time)

Definition at line 514 of file sp_executor.h.

◆ mCurrentStep

int faudes::Executor::mCurrentStep
private

Current logic time.

Definition at line 484 of file sp_executor.h.

◆ mCurrentTime

Time::Type faudes::Executor::mCurrentTime
private

Current clock time.

Definition at line 481 of file sp_executor.h.

◆ mCurrentTimedState

TimedState faudes::Executor::mCurrentTimedState
private

Current state incl clock values.

Definition at line 478 of file sp_executor.h.

◆ mDEvents

EventSet faudes::Executor::mDEvents
private

Record disabled events.

Definition at line 508 of file sp_executor.h.

◆ mEEvents

EventSet faudes::Executor::mEEvents
private

Record enabled events.

Definition at line 499 of file sp_executor.h.

◆ mEGuardInterval

std::map<Idx,TimeInterval> faudes::Executor::mEGuardInterval
private

Record interval in which each guard is enabled

Definition at line 505 of file sp_executor.h.

◆ mEInterval

TimeInterval faudes::Executor::mEInterval
private

Record rime on shich mEEvents is constant

Definition at line 502 of file sp_executor.h.

◆ mETime

TimeInterval faudes::Executor::mETime
private

Record enabled time.

Definition at line 496 of file sp_executor.h.

◆ mEValid

bool faudes::Executor::mEValid
private

Validity flag for the above data.

Definition at line 517 of file sp_executor.h.

◆ mStateClockIntervalMap

std::map<Idx, std::map<Idx,TimeInterval> > faudes::Executor::mStateClockIntervalMap
private

Compiled generator data: map state to clock to interval constraint.

Definition at line 523 of file sp_executor.h.

◆ mTransClockIntervalMap

std::map<Transition, std::map<Idx,TimeInterval> > faudes::Executor::mTransClockIntervalMap
private

Compiled generator data: map transition to clock to interval constraint.

Definition at line 520 of file sp_executor.h.


The documentation for this class was generated from the following files:

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen