Executer with IO device to handle external/physical events.
External/Physical Events and Time
This executor class is derived from the ProposingExecutor and uses a vDevice from the IO Device Plugin to handle input and output events and physical time. Technically, the class provides the routine SyncStep() that has to be called periodically to synchronize executor clock time with physical time and to perform input readings and output writings. There is also a convenience routine SyncRun() which runs a loop with SyncStep().
The SyncStep() procedure implements the below stages. It returns true, if indeed a transition was executed. It returns false on synchronistion errors or when the specified duration expired.
- get a proposal from ProposingEcexutor
- if physical time is ahead of the genartors current clock time, sync time by ExecuteTime; in the case that this is not consistent with the proposal, an error is reported;
- if the generators current clock time is ahead of physical time, an error is reported
- if a input event has been reported that can be executed at generators current time, execute it
- if the proposal schedules an event for the generators current time, execute it
- if a input event has been reported, execute it now; if this event is not accepted by the generator, report an error
- if the proposals time is not yet executed, wait for that amount of time to pass or a input event to be delivered.
Naturally, the DeviceExecutor requires the IO Device plugin in order to be functional. In the absence of the plugin, the DeviceExecutor will behave like a ProposingExecutor.
File IO
The DeviceExecutor inherits file IO from the ProposingExecutor. The device itself is initialized by vDevice methods (eg configured from File) and then passed to the DeviceExecutor by the method Devicep(). Thus, the DeviceExecutor does not need to implement additional token io facilities.
Definition at line 75 of file sp_dplpexecutor.h.
|
|
| DeviceExecutor () |
| Creates an emtpy DeviceExecutor. More...
|
|
| DeviceExecutor (const DeviceExecutor &) |
| Copy constructor. More...
|
|
| ~DeviceExecutor () |
| Explicit destructor. More...
|
|
DeviceExecutor * | New (void) |
| Dummy factory method. More...
|
|
|
virtual void | Reset (long int seed=0) |
| Reset the DeviceExecutor. More...
|
|
virtual void | Clear (void) |
| Clear all data (generators, simulation attributes etc) More...
|
|
bool | ExecuteEvent (Idx event) |
| Execute event. More...
|
|
| ProposingExecutor () |
| Creates an emtpy ProposingExecutor. More...
|
|
| ProposingExecutor (const ProposingExecutor &) |
| Copy constrcutor. More...
|
|
const SimEventAttribute & | EventAttribute (Idx index) const |
| Simulation event attribute lookup. More...
|
|
void | EventAttribute (Idx index, const SimEventAttribute &rAttr) |
| Set simulation event attribute. More...
|
|
void | Alphabet (const sEventSet &rAlphabet) |
| Set all simulation event attributes. More...
|
|
const sEventSet & | Alphabet (void) const |
| Access alphabet (incl simulation event attributes) More...
|
|
TimedEvent | ExecuteNextTransition () |
| Execute next transition. More...
|
|
const TimedEvent & | ProposeNextTransition () |
| Propose next transition. More...
|
|
std::string | EventStatesToString (void) const |
| Inspect stochastic event states (debugging) More...
|
|
virtual void | Reset (void) |
| Reset the ProposingExecutor. More...
|
|
bool | ExecuteTime (Time::Type duration) |
| Execute time duration. More...
|
|
bool | ExecuteEvent (Idx event) |
| Execute event. More...
|
|
bool | ExecuteTransition (const TimedEvent &tevent) |
| Execute event by transition. More...
|
|
bool | RevertToStep (Idx step) |
| Revert executor to past step. More...
|
|
| LoggingExecutor (void) |
| Construct an emtpy LoggingExecuter. More...
|
|
| LoggingExecutor (const LoggingExecutor &rOther) |
| Copy constructor. More...
|
|
| LoggingExecutor (const std::string &rFileName) |
| Construct from file. More...
|
|
virtual | ~LoggingExecutor (void) |
| Explicit destructor. More...
|
|
virtual bool | Valid (void) const |
| Check validity of executors. More...
|
|
Time::Type | CurrentTime (void) const |
| Get clock time. More...
|
|
void | CurrentTime (Time::Type time) |
| Set clock time. More...
|
|
int | CurrentStep (void) const |
| Get logical time, ie number of transitions so far,. More...
|
|
void | CurrentStep (int step) |
| Set logical time (# of steps) More...
|
|
bool | CurrentParallelTimedState (const ParallelTimedState &ptstate) |
| Set current state of the ParallelExecutor. More...
|
|
const ParallelTimedState & | CurrentParallelTimedState (void) const |
| Get current state of the ParallelExecutor. More...
|
|
void | LogOpen (TokenWriter &rTw, int mode) |
| Start logging to TokenWriter. More...
|
|
void | LogOpen (const std::string &rFileName, int logmode, std::ios::openmode openmode=std::ios::out|std::ios::trunc) |
| Start logging to file. More...
|
|
void | LogClose (void) |
| Stop logging. More...
|
|
const SimConditionSet & | Conditions (void) const |
| Read-only access to simulation conditions. More...
|
|
void | Conditions (const SimConditionSet &) |
| Set all simulation conditions. More...
|
|
const AttributeSimCondition & | Condition (const std::string &rName) const |
| Read-only access to a simulation condition by name. More...
|
|
const AttributeSimCondition & | Condition (Idx cond) const |
| Read-only access to a simulation condition by index. More...
|
|
Idx | SetCondition (const std::string &rName, const AttributeSimCondition &rCondition) |
| Set (or add) a condition by name. More...
|
|
void | SetCondition (Idx cond, const AttributeSimCondition &rCondition) |
| Set a condition by index
More...
|
|
void | ClrCondition (const std::string &rName) |
| Remove a condition by name
More...
|
|
void | ClrCondition (Idx cond) |
| Remove a condition by index
More...
|
|
void | ConditionsWrite (TokenWriter &rTw, const std::string &rLabel="SimConditions") const |
| Write conditions so labled section
More...
|
|
void | ConditionsRead (TokenReader &rTr, const std::string &rLabel="SimConditions") |
| Read conditions from labled section
More...
|
|
ConditionIterator | ConditionsBegin (void) const |
| Condition iterator: begin. More...
|
|
ConditionIterator | ConditionsEnd (void) const |
| Condition iterator: end
More...
|
|
bool | BreakCondition (void) const |
| Simulation state: true if some break condition is currently satisfied. More...
|
|
void | TraceClear (int length=-2) |
| Clear buffer and set max buffer. More...
|
|
int | TraceLength (void) const |
| Access buffer: current length. More...
|
|
TraceIterator | TraceBegin (void) const |
| Condition iterator: begin. More...
|
|
TraceIterator | TraceEnd (void) const |
| Condition iterator: end
More...
|
|
const TraceSample * | TraceAtTime (Time::Type time) const |
| Access buffer: sample by faudes time (returns first sample) More...
|
|
const TraceSample * | TraceAtStep (int step) const |
| Access buffer: sample by step. More...
|
|
const TraceSample * | TraceFirst (void) const |
| Access buffer: first sample. More...
|
|
const TraceSample * | TraceRecent (void) const |
| Access buffer: recent sample. More...
|
|
const TraceSample * | TraceCurrent (void) const |
| Access buffer: current sample. More...
|
|
void | TraceWrite (TokenWriter &rTw, const TraceSample &sample) const |
| Access buffer: tokenwriter output. More...
|
|
void | TraceWrite (const TraceSample &sample) const |
| Access buffer: console output. More...
|
|
std::string | TraceToString (const TraceSample &sample) const |
| Access buffer: convert to string. More...
|
|
void | TraceWrite (void) const |
| Access buffer: console output (list all) More...
|
|
| ParallelExecutor (void) |
| Construct an emtpy ParallelExecuter. More...
|
|
| ParallelExecutor (const ParallelExecutor &rOther) |
| Copy constructor. More...
|
|
| ParallelExecutor (const std::string &rFileName) |
| Construct from file. More...
|
|
virtual | ~ParallelExecutor (void) |
| Explicit destructor. More...
|
|
Idx | Size (void) const |
| Number of TimedGenerators. More...
|
|
void | Insert (const std::string &rFileName) |
| Add a TimedGenerator from file. More...
|
|
void | Insert (const TimedGenerator &rGen) |
| Add a TimedGenerator. More...
|
|
const EventSet & | Alphabet (void) const |
| Overall alphabet. More...
|
|
Iterator | Begin (void) const |
|
Iterator | End (void) const |
|
const Executor & | At (int i) const |
|
Idx | EventIndex (const std::string &rName) const |
| Event index lookup. More...
|
|
std::string | EventName (Idx index) const |
| Event name lookup. More...
|
|
Time::Type | CurrentTime (void) const |
| Get clock time. More...
|
|
int | CurrentStep (void) const |
| Get logical time, ie number of transitions so far,. More...
|
|
bool | IsDeadlocked () const |
| Test for deadlocked. More...
|
|
const ParallelTimedState & | CurrentParallelTimedState (void) const |
| Get current state of the ParallelExecutor. More...
|
|
const ParallelState & | CurrentParallelState (void) const |
| Get current discrete state vector of the ParallelExecutor. More...
|
|
const TimeInterval & | EnabledTime () const |
| Get maximal duration that can pass without executing an event. More...
|
|
const EventSet & | EnabledEvents () const |
| Get events that are enabled at current (timed) state. More...
|
|
const EventSet & | DisabledEvents () const |
| Get events that are disabled at current (timed) state. More...
|
|
const TimeInterval & | EnabledInterval () const |
| Get an interval on which the set of enabled events is constant. More...
|
|
TimeInterval | EnabledEventTime (Idx event) const |
| Get interval on which the specified event is enabled. More...
|
|
TimeInterval | EnabledGuardTime (Idx event) const |
| Get interval on which the respective guard is satisfied. More...
|
|
EventSet | ActiveEventSet (const ParallelState &stateVec) const |
| Get events that are active in all TimedGenerators. More...
|
|
bool | Active (Idx ev, const ParallelState &stateVec) const |
| Test whether an event is active in a given discrete state. More...
|
|
bool | Active (Idx ev) const |
| Test whether an event is active at current (discrete) state. More...
|
|
std::string | PTSStr (const ParallelTimedState &ptstate) const |
| Pretty printable string of timed parallel state. More...
|
|
std::string | PSStr (const ParallelState &pstate) const |
| Pretty printable string of parallel state. More...
|
|
std::string | TEStr (const TimedEvent &tevent) const |
| Pretty printable string of timed event. More...
|
|
std::string | CStr (Idx clock) const |
| Pretty printable string of clock name. More...
|
|
std::string | EStr (Idx event) const |
| Pretty printable string of event. More...
|
|
std::string | CurrentParallelTimedStateStr (void) const |
| Pretty printable string of current state. More...
|
|
std::string | CurrentParallelStateStr (void) const |
| Pretty printable string of parallel state
More...
|
|
void | ComputeEnabled (void) const |
| Compute enabled events and enabled interval (fake const) More...
|
|
void | ComputeEnabledNonConst (void) |
| Compute enabled core routine (non const) More...
|
|
| Type (void) |
| Constructor. More...
|
|
| Type (const Type &rType) |
| Copy constructor. More...
|
|
virtual | ~Type (void) |
| Destructor. More...
|
|
virtual Type * | New (void) const |
| Construct on heap. More...
|
|
virtual Type * | Copy (void) const |
| Construct on heap. More...
|
|
virtual const Type * | Cast (const Type *pOther) const |
| Cast other object to this type. More...
|
|
virtual Type & | Assign (const Type &rSrc) |
| Assign configuration data from other object. More...
|
|
virtual Type & | operator= (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 void | Name (const std::string &rName) |
| Set the objects's name. More...
|
|
virtual const std::string & | Name (void) const |
| Get objects's name. 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...
|
|