#include <sp_pexecutor.h>
Inheritance diagram for faudes::ParallelExecutor:
Technically, a ParallelExecutor is a vector of executors. Clocks are treated on a per executor basis. That is, values of clocks in one generator are not effected by the reset of another generator, even if the respestive clock variables have the same index and name.
<Executor> <Generators> "./some_generator.gen" "./other_generator.gen" </Generators> </Executor>
Definition at line 65 of file sp_pexecutor.h.
Public Types | |
typedef std::vector< Idx > | ParallelState |
Typedef for parallel discrete state. | |
typedef std::vector< std::map< Idx, tpTime::Type > > | ParallelClock |
Typedef for parallel clock values. | |
typedef Executor::TimedState | TimedState |
Provide typedef from Executor. | |
typedef std::vector< Executor >::const_iterator | Iterator |
Read-only access to individual executors. | |
Public Member Functions | |
ParallelExecutor (void) | |
Construct an emtpy ParallelExecuter. | |
ParallelExecutor (const std::string &rFileName) | |
Construct from file. | |
virtual | ~ParallelExecutor (void) |
Explicit destructor. | |
virtual void | Clear (void) |
Clear all data. | |
Idx | Size (void) const |
Number of tGenerators. | |
void | Insert (const std::string &rFileName) |
Add a tGenerator from file. | |
void | Insert (const tGenerator &rGen) |
Add a tGenerator. | |
const EventSet & | Alphabet (void) const |
Overall alphabet. | |
virtual void | Reset (void) |
Goto initial state. | |
Iterator | Begin (void) const |
Iterator | End (void) const |
const Executor & | At (int i) const |
Idx | EventIndex (const std::string &rName) const |
Event index lookup. | |
std::string | EventName (Idx index) const |
Event name lookup. | |
tpTime::Type | CurrentTime (void) const |
Get physical time. | |
int | CurrentStep (void) const |
Get logical time, ie number of transitions so far,. | |
bool | IsDeadlocked () const |
Test for deadlocked. | |
virtual bool | Valid (void) const |
Check validity of executors. | |
const ParallelTimedState & | CurrentParallelTimedState (void) const |
Get current state of the ParallelExecutor. | |
const ParallelState & | CurrentParallelState (void) const |
Get current discrete state vector of the ParallelExecutor. | |
virtual void | CurrentTime (tpTime::Type time) |
Set physical time. | |
virtual void | CurrentStep (int step) |
Set logical time (# of steps). | |
virtual bool | CurrentParallelTimedState (const ParallelTimedState &ptstate) |
Set current state of the ParallelExecutor. | |
virtual bool | ExecuteTime (tpTime::Type duration) |
Let time pass without executing a transition. | |
virtual bool | ExecuteEvent (Idx event) |
Execute transition. | |
const TimeInterval & | EnabledTime () const |
Get maximal duration that can pass without executing an event. | |
const EventSet & | EnabledEvents () const |
Get events that are enabled at current (timed) state. | |
const EventSet & | DisabledEvents () const |
Get events that are disabled at current (timed) state. | |
const TimeInterval & | EnabledInterval () const |
Get an interval on which the set of enabled events is constant. | |
TimeInterval | EnabledEventTime (Idx event) const |
Get interval on which the specified event is enabled. | |
TimeInterval | EnabledGuardTime (Idx event) const |
Get interval on which the respective guard is satisfied. | |
EventSet | ActiveEventSet (const ParallelState &stateVec) const |
Get events that are active in all tGenerators. | |
bool | Active (Idx ev, const ParallelState &stateVec) const |
Test whether an event is active in a given discrete state. | |
bool | Active (Idx ev) const |
Test whether an event is active at current (discrete) state. | |
std::string | PTSStr (const ParallelTimedState &ptstate) const |
Pretty printable string of timed parallel state. | |
std::string | PSStr (const ParallelState &pstate) const |
Pretty printable string of parallel state. | |
std::string | TEStr (const TimedEvent &tevent) const |
Pretty printable string of timed event. | |
std::string | CStr (Idx clock) const |
Pretty printable string of clock name. | |
std::string | EStr (Idx event) const |
Pretty printable string of event. | |
std::string | CurrentParallelTimedStateStr (void) const |
Pretty printable string of current state. | |
std::string | CurrentParallelStateStr (void) const |
Pretty printable string of parallel state. | |
void | ComputeEnabled (void) const |
this is public only for performance experiments --- dont use | |
void | ComputeEnabledNonConst (void) |
Compute enabled core routine (non const). | |
Protected Member Functions | |
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Reads parallel executor from TokenReader, see also public wrappers Read() in faudes::Type. | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write to TokenWriter, see also public wrappers Write() in faudes::Type. | |
virtual void | DoReadGenerators (TokenReader &rTr) |
Reads generator files section from TokenReader. | |
virtual void | DoWriteGenerators (TokenWriter &rTw) const |
Write generator files section to TokenWriter. | |
virtual void | Compile () |
compile internal data (eg overall alphabet) | |
Protected Attributes | |
Idx | mRecentEvent |
recent event | |
Private Types | |
typedef std::vector< Executor >::iterator | iterator |
Internal non-const iterator. | |
Private Member Functions | |
void | UpdateParallelTimedState (void) |
update parallel timed state() | |
Private Attributes | |
std::vector< Executor > | mExecutors |
list of executors | |
std::vector< std::string > | mExecutorNames |
list of executors | |
EventSet | mAlphabet |
overall alphabet | |
tpTime::Type | mCurrentTime |
global time (real) | |
int | mCurrentStep |
global time (step) | |
TimeInterval | mETime |
enabled time | |
EventSet | mEEvents |
enabled events | |
EventSet | mDEvents |
disabled events | |
TimeInterval | mEInterval |
enabled interval | |
bool | mEValid |
validity flag for fevents and ftime | |
ParallelTimedState | mCurrentParallelTimedState |
current state | |
Classes | |
class | ParallelTimedState |
Typedef for parallel timed state, incl token io. More... |
|
Internal non-const iterator.
Definition at line 551 of file sp_pexecutor.h. |
|
Read-only access to individual executors.
Definition at line 174 of file sp_pexecutor.h. |
|
Typedef for parallel clock values.
Definition at line 72 of file sp_pexecutor.h. |
|
Typedef for parallel discrete state.
Definition at line 69 of file sp_pexecutor.h. |
|
Provide typedef from Executor.
Definition at line 85 of file sp_pexecutor.h. |
|
Construct an emtpy ParallelExecuter.
Definition at line 20 of file sp_pexecutor.cpp. |
|
Construct from file. This constructor uses the DoRead method to initialize from file.
Definition at line 25 of file sp_pexecutor.cpp. |
|
Explicit destructor.
Definition at line 31 of file sp_pexecutor.cpp. |
|
Test whether an event is active at current (discrete) state. By "active" we refer to the untimed transition structure, that is, we ignore clock values etc.
Definition at line 496 of file sp_pexecutor.cpp. |
|
Test whether an event is active in a given discrete state. By "active" we refer to the untimed transition structure, that is, we ignore clock values etc.
Definition at line 501 of file sp_pexecutor.cpp. |
|
Get events that are active in all tGenerators. By "active" we refer to the untimed transition structure, that is, we ignore clock values etc.
Definition at line 485 of file sp_pexecutor.cpp. |
|
Overall alphabet.
Reimplemented in faudes::ProposingExecutor. Definition at line 194 of file sp_pexecutor.cpp. |
|
Definition at line 177 of file sp_pexecutor.h. |
|
Definition at line 175 of file sp_pexecutor.h. |
|
Clear all data. Removes all generators/executors and resets the current state to a void value. Reimplemented from faudes::Type. Reimplemented in faudes::DeviceExecutor, faudes::LoggingExecutor, and faudes::ProposingExecutor. Definition at line 99 of file sp_pexecutor.cpp. |
|
compile internal data (eg overall alphabet)
Reimplemented in faudes::LoggingExecutor. Definition at line 46 of file sp_pexecutor.cpp. |
|
this is public only for performance experiments --- dont use
Definition at line 199 of file sp_pexecutor.cpp. |
|
Compute enabled core routine (non const).
Definition at line 205 of file sp_pexecutor.cpp. |
|
Pretty printable string of clock name.
Definition at line 469 of file sp_pexecutor.cpp. |
|
Get current discrete state vector of the ParallelExecutor. By "the current discrete state" we refer to a vector of indices that indicate the current state of the untimed transition structure.
Definition at line 284 of file sp_pexecutor.cpp. |
|
Pretty printable string of parallel state.
Definition at line 480 of file sp_pexecutor.cpp. |
|
Set current state of the ParallelExecutor. This resets the parallel executor to the given state, incl clock values. Both, physical and logical time is also reset (to 0).
Definition at line 294 of file sp_pexecutor.cpp. |
|
Get current state of the ParallelExecutor. With "the current state" w refer to all data relevant for events generated in future. This data consists of a discrete state vector and a mapping from clocks to closk values.
Reimplemented in faudes::LoggingExecutor. Definition at line 289 of file sp_pexecutor.cpp. |
|
Pretty printable string of current state.
Definition at line 475 of file sp_pexecutor.cpp. |
|
Set logical time (# of steps). This does not affect clocks and, hence, is purely cosmetic. Note that, in contrast to physical time, the individual generators do not agree in logical time. The trace buffer will get out of order and should be cleared.
Reimplemented in faudes::LoggingExecutor. Definition at line 396 of file sp_pexecutor.cpp. |
|
Get logical time, ie number of transitions so far,.
Reimplemented in faudes::LoggingExecutor. Definition at line 404 of file sp_pexecutor.cpp. |
|
Set physical time. This does not affect clocks and, hence, is purely cosmetic. The trace buffer will record an invalid event.
Reimplemented in faudes::LoggingExecutor. Definition at line 383 of file sp_pexecutor.cpp. |
|
Get physical time.
Reimplemented in faudes::LoggingExecutor. Definition at line 391 of file sp_pexecutor.cpp. |
|
Get events that are disabled at current (timed) state. By "disabled" we refer to the synchronizes timed generators, that is, we do care about clock values, invariants and guards.
Definition at line 248 of file sp_pexecutor.cpp. |
|
Reads parallel executor from TokenReader, see also public wrappers Read() in faudes::Type.
Reimplemented from faudes::Type. Reimplemented in faudes::LoggingExecutor, and faudes::ProposingExecutor. Definition at line 140 of file sp_pexecutor.cpp. |
|
Reads generator files section from TokenReader.
Definition at line 159 of file sp_pexecutor.cpp. |
|
Write to TokenWriter, see also public wrappers Write() in faudes::Type.
Reimplemented from faudes::Type. Reimplemented in faudes::LoggingExecutor, and faudes::ProposingExecutor. Definition at line 114 of file sp_pexecutor.cpp. |
|
Write generator files section to TokenWriter.
Definition at line 124 of file sp_pexecutor.cpp. |
|
Get events that are enabled at current (timed) state. By "enabled" we refer to the synchronizes timed generators, that is, we do care about clock values, invariants and guards.
Definition at line 242 of file sp_pexecutor.cpp. |
|
Get interval on which the specified event is enabled. Returns empty, if the event is not active or never simultanuosly enabled in all executors.
Definition at line 260 of file sp_pexecutor.cpp. |
|
Get interval on which the respective guard is satisfied. Returns empty, if the event is not active or if the guards are never simultanuosly satisfied in all executors.
Definition at line 272 of file sp_pexecutor.cpp. |
|
Get an interval on which the set of enabled events is constant. Note: while this implementation tries to come up with a potentially large interval, it is not guaranteed to be maximal.
Definition at line 254 of file sp_pexecutor.cpp. |
|
Get maximal duration that can pass without executing an event.
Definition at line 235 of file sp_pexecutor.cpp. |
|
Definition at line 176 of file sp_pexecutor.h. |
|
Pretty printable string of event.
Definition at line 463 of file sp_pexecutor.cpp. |
|
Event index lookup. This convenience method refers to the global event symbol table.
Definition at line 191 of file sp_pexecutor.h. |
|
Event name lookup. This convenience method refers to the global event symbol table.
Definition at line 204 of file sp_pexecutor.h. |
|
Execute transition. Returns false if the transition cannot be executed at the current time.
Reimplemented in faudes::DeviceExecutor, faudes::LoggingExecutor, and faudes::ProposingExecutor. Definition at line 353 of file sp_pexecutor.cpp. |
|
Let time pass without executing a transition. Return false if the duration specified cannot elapse without an event being executed.
Reimplemented in faudes::LoggingExecutor, and faudes::ProposingExecutor. Definition at line 329 of file sp_pexecutor.cpp. |
|
Add a tGenerator. After inserting generators and before starting to execute, you must call Reset() to update internal datastructures.
Definition at line 90 of file sp_pexecutor.cpp. |
|
Add a tGenerator from file. This method uses the tGenerator's read to find the first generator in the file. If the generator found is not a tGenerator, timing data defaults to infinite invariants/guards and empty resets. After inserting generators and before starting to execute, you must call Reset() to update internal datastructures.
Definition at line 75 of file sp_pexecutor.cpp. |
|
Test for deadlocked. The parallel executor is deadlocked if neither time can pass nor an event can be executed. Prototypical examples for such a situation is that the indvidual executers fail to agree on a common time interval, at which shaered events are enabled.
Definition at line 409 of file sp_pexecutor.cpp. |
|
Pretty printable string of parallel state.
Definition at line 444 of file sp_pexecutor.cpp. |
|
Pretty printable string of timed parallel state.
Definition at line 417 of file sp_pexecutor.cpp. |
|
Goto initial state. Reset all clock values to zero, assign initial states to each executor. Reimplemented in faudes::LoggingExecutor. Definition at line 68 of file sp_pexecutor.cpp. |
|
Number of tGenerators.
Definition at line 107 of file sp_pexecutor.cpp. |
|
Pretty printable string of timed event.
Definition at line 457 of file sp_pexecutor.cpp. |
|
update parallel timed state()
Definition at line 36 of file sp_pexecutor.cpp. |
|
Check validity of executors. This is currently not implemented.
Reimplemented in faudes::LoggingExecutor. Definition at line 238 of file sp_pexecutor.h. |
|
overall alphabet
Definition at line 554 of file sp_pexecutor.h. |
|
current state
Definition at line 578 of file sp_pexecutor.h. |
|
global time (step)
Definition at line 560 of file sp_pexecutor.h. |
|
global time (real)
Definition at line 557 of file sp_pexecutor.h. |
|
disabled events
Definition at line 569 of file sp_pexecutor.h. |
|
enabled events
Definition at line 566 of file sp_pexecutor.h. |
|
enabled interval
Definition at line 572 of file sp_pexecutor.h. |
|
enabled time
Definition at line 563 of file sp_pexecutor.h. |
|
validity flag for fevents and ftime
Definition at line 575 of file sp_pexecutor.h. |
|
list of executors
Definition at line 548 of file sp_pexecutor.h. |
|
list of executors
Definition at line 545 of file sp_pexecutor.h. |
|
recent event
Definition at line 540 of file sp_pexecutor.h. |