Detailed Description

Synchronized parallel execution of TimedGenerators.

Synchronisation

The ParallelExecutor executes a family of timed generators with synchronized shared events according to Alur semantics. That is, we assume disjoint clock sets and synchronize shared events w.r.t. occurence at clock time.

Implementation

The external interface of a ParallelExecutor is the same as the single Executor, in that it indicats enabled events and in that it provides methods for executing events or letting time pass.

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.

File IO

For token IO, the ParallelExecutor reads and writes the generators to execute within a section with default label "Executor". For disk space efficiency, the token IO format will use refernces by (relative) filename if the latter is known. Since TimedGenerators read any generator type from file, so does the ParallelExecutor. Example:

<Executor>
<Generators>
"./some_generator.gen"
"./other_generator.gen"
</Generators>
</Executor>

Definition at line 64 of file sp_pexecutor.h.

#include <sp_pexecutor.h>

Classes

class  ParallelTimedState
 Typedef for parallel timed state, incl token io. More...
 

Public Types

typedef std::vector< IdxParallelState
 Typedef for parallel discrete state. More...
 
typedef std::vector< std::map< Idx, Time::Type > > ParallelClock
 Typedef for parallel clock values. More...
 
typedef Executor::TimedState TimedState
 Provide typedef from Executor. More...
 
typedef std::vector< Executor >::const_iterator Iterator
 Read-only access to individual executors. More...
 

Public Member Functions

 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...
 
virtual void Clear (void)
 Clear all data. 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 EventSetAlphabet (void) const
 Overall alphabet. More...
 
virtual void Reset (void)
 Goto initial state. More...
 
Iterator Begin (void) const
 
Iterator End (void) const
 
const ExecutorAt (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...
 
virtual bool Valid (void) const
 Check validity of executors. More...
 
const ParallelTimedStateCurrentParallelTimedState (void) const
 Get current state of the ParallelExecutor. More...
 
const ParallelStateCurrentParallelState (void) const
 Get current discrete state vector of the ParallelExecutor. More...
 
virtual void CurrentTime (Time::Type time)
 Set clock time. More...
 
virtual void CurrentStep (int step)
 Set logical time (# of steps) More...
 
virtual bool CurrentParallelTimedState (const ParallelTimedState &ptstate)
 Set current state of the ParallelExecutor. More...
 
virtual bool ExecuteTime (Time::Type duration)
 Let time pass without executing a transition. More...
 
virtual bool ExecuteEvent (Idx event)
 Execute transition. More...
 
const TimeIntervalEnabledTime () const
 Get maximal duration that can pass without executing an event. More...
 
const EventSetEnabledEvents () const
 Get events that are enabled at current (timed) state. More...
 
const EventSetDisabledEvents () const
 Get events that are disabled at current (timed) state. More...
 
const TimeIntervalEnabledInterval () 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...
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 Constructor. More...
 
 Type (const Type &rType)
 Copy constructor. More...
 
virtual ~Type (void)
 Destructor. More...
 
virtual TypeNew (void) const
 Construct on heap. More...
 
virtual TypeCopy (void) const
 Construct on heap. More...
 
virtual const TypeCast (const Type *pOther) const
 Cast other object to this type. More...
 
virtual TypeAssign (const Type &rSrc)
 Assign configuration data from other object. 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 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...
 

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. More...
 
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. More...
 
virtual void DoReadGenerators (TokenReader &rTr)
 Reads generator files section from TokenReader. More...
 
virtual void DoWriteGenerators (TokenWriter &rTw) const
 Write generator files section to TokenWriter. More...
 
void DoAssign (const ParallelExecutor &rSrc)
 Assignment method. More...
 
virtual void Compile ()
 compile internal data (eg overall alphabet) 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 void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data of this object to TokenWriter in XML format. More...
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 Write configuration data in debugging format to TokenWriter. More...
 
virtual void DoSWrite (TokenWriter &rTw) const
 Write statistical data as a comment to TokenWriter. More...
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 Get objects's type definition. More...
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Protected Attributes

Idx mRecentEvent
 recent event More...
 

Private Types

typedef std::vector< Executor >::iterator iterator
 Internal non-const iterator. More...
 

Private Member Functions

void UpdateParallelTimedState (void)
 update parallel timed state() More...
 

Private Attributes

std::vector< ExecutormExecutors
 list of executors More...
 
std::vector< std::string > mExecutorNames
 list of executors More...
 
EventSet mAlphabet
 overall alphabet More...
 
Time::Type mCurrentTime
 global time (real) More...
 
int mCurrentStep
 global time (step) More...
 
TimeInterval mETime
 enabled time More...
 
EventSet mEEvents
 enabled events More...
 
EventSet mDEvents
 disabled events More...
 
TimeInterval mEInterval
 enabled interval More...
 
bool mEValid
 validity flag for fevents and ftime More...
 
ParallelTimedState mCurrentParallelTimedState
 current state More...
 

Member Typedef Documentation

◆ Iterator

typedef std::vector<Executor>::const_iterator faudes::ParallelExecutor::Iterator

Read-only access to individual executors.

Definition at line 180 of file sp_pexecutor.h.

◆ iterator

typedef std::vector<Executor>::iterator faudes::ParallelExecutor::iterator
private

Internal non-const iterator.

Definition at line 578 of file sp_pexecutor.h.

◆ ParallelClock

typedef std::vector< std::map<Idx,Time::Type> > faudes::ParallelExecutor::ParallelClock

Typedef for parallel clock values.

Definition at line 73 of file sp_pexecutor.h.

◆ ParallelState

Typedef for parallel discrete state.

Definition at line 70 of file sp_pexecutor.h.

◆ TimedState

Provide typedef from Executor.

Definition at line 86 of file sp_pexecutor.h.

Constructor & Destructor Documentation

◆ ParallelExecutor() [1/3]

faudes::ParallelExecutor::ParallelExecutor ( void  )

Construct an emtpy ParallelExecuter.

Definition at line 22 of file sp_pexecutor.cpp.

◆ ParallelExecutor() [2/3]

faudes::ParallelExecutor::ParallelExecutor ( const ParallelExecutor rOther)

Copy constructor.

Definition at line 27 of file sp_pexecutor.cpp.

◆ ParallelExecutor() [3/3]

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

Construct from file.

This constructor uses the DoRead method to initialize from file.

Parameters
rFileNameFilename
Exceptions
Exception
  • non-deteministic generator (id 501)
  • token mismatch (id 502)
  • IO errors (id 1)

Definition at line 33 of file sp_pexecutor.cpp.

◆ ~ParallelExecutor()

faudes::ParallelExecutor::~ParallelExecutor ( void  )
virtual

Explicit destructor.

Definition at line 39 of file sp_pexecutor.cpp.

Member Function Documentation

◆ Active() [1/2]

bool faudes::ParallelExecutor::Active ( Idx  ev) const

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.

Parameters
evEvent ro test
Returns
True for active in all generators

Definition at line 532 of file sp_pexecutor.cpp.

◆ Active() [2/2]

bool faudes::ParallelExecutor::Active ( Idx  ev,
const ParallelState stateVec 
) const

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.

Parameters
evEvent to test
stateVecParallelState
Returns
True for active in all generators

Definition at line 537 of file sp_pexecutor.cpp.

◆ ActiveEventSet()

EventSet faudes::ParallelExecutor::ActiveEventSet ( const ParallelState stateVec) const

Get events that are active in all TimedGenerators.

By "active" we refer to the untimed transition structure, that is, we ignore clock values etc.

Parameters
stateVecDiscrete state
Returns
Active EventSet

Definition at line 521 of file sp_pexecutor.cpp.

◆ Alphabet()

const EventSet & faudes::ParallelExecutor::Alphabet ( void  ) const

Overall alphabet.

Definition at line 229 of file sp_pexecutor.cpp.

◆ At()

const Executor& faudes::ParallelExecutor::At ( int  i) const
inline

Definition at line 183 of file sp_pexecutor.h.

◆ Begin()

Iterator faudes::ParallelExecutor::Begin ( void  ) const
inline

Definition at line 181 of file sp_pexecutor.h.

◆ Clear()

void faudes::ParallelExecutor::Clear ( void  )
virtual

Clear all data.

Removes all generators/executors and resets the current state to a void value.

Reimplemented from faudes::Type.

Reimplemented in faudes::ProposingExecutor, faudes::LoggingExecutor, and faudes::DeviceExecutor.

Definition at line 115 of file sp_pexecutor.cpp.

◆ Compile()

void faudes::ParallelExecutor::Compile ( void  )
protectedvirtual

compile internal data (eg overall alphabet)

Reimplemented in faudes::LoggingExecutor.

Definition at line 62 of file sp_pexecutor.cpp.

◆ ComputeEnabled()

void faudes::ParallelExecutor::ComputeEnabled ( void  ) const

Compute enabled events and enabled interval (fake const)

this is public only for performance experiments — dont use

Definition at line 234 of file sp_pexecutor.cpp.

◆ ComputeEnabledNonConst()

void faudes::ParallelExecutor::ComputeEnabledNonConst ( void  )

Compute enabled core routine (non const)

Definition at line 240 of file sp_pexecutor.cpp.

◆ CStr()

std::string faudes::ParallelExecutor::CStr ( Idx  clock) const

Pretty printable string of clock name.

Definition at line 505 of file sp_pexecutor.cpp.

◆ CurrentParallelState()

const ParallelExecutor::ParallelState & faudes::ParallelExecutor::CurrentParallelState ( void  ) const

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.

Returns
Discrete state vector

Definition at line 319 of file sp_pexecutor.cpp.

◆ CurrentParallelStateStr()

std::string faudes::ParallelExecutor::CurrentParallelStateStr ( void  ) const

Pretty printable string of parallel state

Definition at line 516 of file sp_pexecutor.cpp.

◆ CurrentParallelTimedState() [1/2]

bool faudes::ParallelExecutor::CurrentParallelTimedState ( const ParallelTimedState ptstate)
virtual

Set current state of the ParallelExecutor.

This resets the parallel executor to the given state, incl clock values. Both, clock time and logical time is also reset (to 0).

Returns
True for success

Reimplemented in faudes::LoggingExecutor.

Definition at line 329 of file sp_pexecutor.cpp.

◆ CurrentParallelTimedState() [2/2]

const ParallelExecutor::ParallelTimedState & faudes::ParallelExecutor::CurrentParallelTimedState ( void  ) const

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.

Returns
Discrete state vector and clock value maps

Definition at line 324 of file sp_pexecutor.cpp.

◆ CurrentParallelTimedStateStr()

std::string faudes::ParallelExecutor::CurrentParallelTimedStateStr ( void  ) const

Pretty printable string of current state.

Definition at line 511 of file sp_pexecutor.cpp.

◆ CurrentStep() [1/2]

void faudes::ParallelExecutor::CurrentStep ( int  step)
virtual

Set logical time (# of steps)

This does not affect clocks and, hence, is purely cosmetic. Note that, in contrast to clock time, the individual generators do not agree in logical time. The trace buffer will get out of order and should be cleared.

Parameters
stepNew logical time

Reimplemented in faudes::LoggingExecutor.

Definition at line 432 of file sp_pexecutor.cpp.

◆ CurrentStep() [2/2]

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

Get logical time, ie number of transitions so far,.

Definition at line 440 of file sp_pexecutor.cpp.

◆ CurrentTime() [1/2]

void faudes::ParallelExecutor::CurrentTime ( Time::Type  time)
virtual

Set clock time.

This does not affect clocks and, hence, is purely cosmetic. The trace buffer will record an invalid event.

Parameters
timeNew clock time

Reimplemented in faudes::LoggingExecutor.

Definition at line 419 of file sp_pexecutor.cpp.

◆ CurrentTime() [2/2]

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

Get clock time.

Definition at line 427 of file sp_pexecutor.cpp.

◆ DisabledEvents()

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

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.

Returns
Set of disabled events

Definition at line 283 of file sp_pexecutor.cpp.

◆ DoAssign()

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

Assignment method.

Parameters
rSrcSource to assign from

Definition at line 44 of file sp_pexecutor.cpp.

◆ DoRead()

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

Reads parallel executor from TokenReader, see also public wrappers Read() in faudes::Type.

Parameters
rTrTokenReader to read from
rLabelSection to read, defaults to "Executor"
pContextRead context to provide contextual information (ignored)
Exceptions
Exception
  • non-deterministic generator(s) (id 501)
  • token mismatch (id 502)
  • IO error (id 1)

Reimplemented from faudes::Type.

Reimplemented in faudes::ProposingExecutor, and faudes::LoggingExecutor.

Definition at line 175 of file sp_pexecutor.cpp.

◆ DoReadGenerators()

void faudes::ParallelExecutor::DoReadGenerators ( TokenReader rTr)
protectedvirtual

Reads generator files section from TokenReader.

Parameters
rTrTokenReader to read from
Exceptions
Exception
  • non-deterministic generator(s) (id 501)
  • token mismatch (id 502)
  • IO error (id 1)

Definition at line 194 of file sp_pexecutor.cpp.

◆ DoWrite()

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

Write to TokenWriter, see also public wrappers Write() in faudes::Type.

Parameters
rTwReference to TokenWriter
rLabelLabel of section to write, defaults to "Executor"
pContextWrite context to provide contextual information (ignored)
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::Type.

Reimplemented in faudes::ProposingExecutor, and faudes::LoggingExecutor.

Definition at line 130 of file sp_pexecutor.cpp.

◆ DoWriteGenerators()

void faudes::ParallelExecutor::DoWriteGenerators ( TokenWriter rTw) const
protectedvirtual

Write generator files section to TokenWriter.

Parameters
rTwReference to TokenWriter
Exceptions
Exception
  • IO errors (id 2)

Definition at line 159 of file sp_pexecutor.cpp.

◆ EnabledEvents()

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

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.

Returns
Set of enabled events

Definition at line 277 of file sp_pexecutor.cpp.

◆ EnabledEventTime()

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

Get interval on which the specified event is enabled.

Returns empty, if the event is not active or never simultanuosly enabled in all executors.

Parameters
event
Returns
TimeInterval

Definition at line 295 of file sp_pexecutor.cpp.

◆ EnabledGuardTime()

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

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.

Parameters
event
Returns
TimeInterval

Definition at line 307 of file sp_pexecutor.cpp.

◆ EnabledInterval()

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

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.

Returns
TimeInterval

Definition at line 289 of file sp_pexecutor.cpp.

◆ EnabledTime()

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

Get maximal duration that can pass without executing an event.

Returns
TimeInterval

Definition at line 270 of file sp_pexecutor.cpp.

◆ End()

Iterator faudes::ParallelExecutor::End ( void  ) const
inline

Definition at line 182 of file sp_pexecutor.h.

◆ EStr()

std::string faudes::ParallelExecutor::EStr ( Idx  event) const

Pretty printable string of event.

Definition at line 499 of file sp_pexecutor.cpp.

◆ EventIndex()

Idx faudes::ParallelExecutor::EventIndex ( const std::string &  rName) const
inline

Event index lookup.

This convenience method refers to the global event symbol table.

Parameters
rNameName of event to lookup
Returns
Valid index or 0 if non-existent

Definition at line 197 of file sp_pexecutor.h.

◆ EventName()

std::string faudes::ParallelExecutor::EventName ( Idx  index) const
inline

Event name lookup.

This convenience method refers to the global event symbol table.

Parameters
indexIndex of event to look up
Returns
Name or empty std::string if non-existent

Definition at line 210 of file sp_pexecutor.h.

◆ ExecuteEvent()

bool faudes::ParallelExecutor::ExecuteEvent ( Idx  event)
virtual

Execute transition.

Returns false if the transition cannot be executed at the current time.

Parameters
eventIndicate transition to execute
Returns
True on success

Reimplemented in faudes::ProposingExecutor, faudes::LoggingExecutor, and faudes::DeviceExecutor.

Definition at line 389 of file sp_pexecutor.cpp.

◆ ExecuteTime()

bool faudes::ParallelExecutor::ExecuteTime ( Time::Type  duration)
virtual

Let time pass without executing a transition.

Return false if the duration specified
cannot elapse without an event being executed.

Parameters
durationAmount of time that shall elapse.
Returns
True for success

Reimplemented in faudes::ProposingExecutor, and faudes::LoggingExecutor.

Definition at line 364 of file sp_pexecutor.cpp.

◆ Insert() [1/2]

void faudes::ParallelExecutor::Insert ( const std::string &  rFileName)

Add a TimedGenerator from file.

This method uses the TimedGenerator's read to find the first generator in the file. If the generator found is not a TimedGenerator, 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.

Parameters
rFileNameFile to read
Exceptions
Exception
  • non-deteministic generator (id 501)
  • token mismatch (id 502)
  • IO errors (id 1)

Definition at line 91 of file sp_pexecutor.cpp.

◆ Insert() [2/2]

void faudes::ParallelExecutor::Insert ( const TimedGenerator rGen)

Add a TimedGenerator.

After inserting generators and before starting to execute, you must call Reset() to update internal datastructures.

Parameters
rGenGenerator to add
Exceptions
Exception
  • non-deteministic generator (id 501)

Definition at line 106 of file sp_pexecutor.cpp.

◆ IsDeadlocked()

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

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.

Returns
True/false

Definition at line 445 of file sp_pexecutor.cpp.

◆ PSStr()

std::string faudes::ParallelExecutor::PSStr ( const ParallelState pstate) const

Pretty printable string of parallel state.

Definition at line 480 of file sp_pexecutor.cpp.

◆ PTSStr()

std::string faudes::ParallelExecutor::PTSStr ( const ParallelTimedState ptstate) const

Pretty printable string of timed parallel state.

Definition at line 453 of file sp_pexecutor.cpp.

◆ Reset()

void faudes::ParallelExecutor::Reset ( void  )
virtual

Goto initial state.

Reset all clock values to zero, assign initial states to each executor.

Reimplemented in faudes::ProposingExecutor, and faudes::LoggingExecutor.

Definition at line 84 of file sp_pexecutor.cpp.

◆ Size()

Idx faudes::ParallelExecutor::Size ( void  ) const

Number of TimedGenerators.

Definition at line 123 of file sp_pexecutor.cpp.

◆ TEStr()

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

Pretty printable string of timed event.

Definition at line 493 of file sp_pexecutor.cpp.

◆ UpdateParallelTimedState()

void faudes::ParallelExecutor::UpdateParallelTimedState ( void  )
private

update parallel timed state()

Definition at line 52 of file sp_pexecutor.cpp.

◆ Valid()

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

Check validity of executors.

This is currently not implemented.

Returns
True on success

Reimplemented in faudes::LoggingExecutor.

Definition at line 244 of file sp_pexecutor.h.

Member Data Documentation

◆ mAlphabet

EventSet faudes::ParallelExecutor::mAlphabet
private

overall alphabet

Definition at line 581 of file sp_pexecutor.h.

◆ mCurrentParallelTimedState

ParallelTimedState faudes::ParallelExecutor::mCurrentParallelTimedState
private

current state

Definition at line 605 of file sp_pexecutor.h.

◆ mCurrentStep

int faudes::ParallelExecutor::mCurrentStep
private

global time (step)

Definition at line 587 of file sp_pexecutor.h.

◆ mCurrentTime

Time::Type faudes::ParallelExecutor::mCurrentTime
private

global time (real)

Definition at line 584 of file sp_pexecutor.h.

◆ mDEvents

EventSet faudes::ParallelExecutor::mDEvents
private

disabled events

Definition at line 596 of file sp_pexecutor.h.

◆ mEEvents

EventSet faudes::ParallelExecutor::mEEvents
private

enabled events

Definition at line 593 of file sp_pexecutor.h.

◆ mEInterval

TimeInterval faudes::ParallelExecutor::mEInterval
private

enabled interval

Definition at line 599 of file sp_pexecutor.h.

◆ mETime

TimeInterval faudes::ParallelExecutor::mETime
private

enabled time

Definition at line 590 of file sp_pexecutor.h.

◆ mEValid

bool faudes::ParallelExecutor::mEValid
private

validity flag for fevents and ftime

Definition at line 602 of file sp_pexecutor.h.

◆ mExecutorNames

std::vector<std::string> faudes::ParallelExecutor::mExecutorNames
private

list of executors

Definition at line 575 of file sp_pexecutor.h.

◆ mExecutors

std::vector<Executor> faudes::ParallelExecutor::mExecutors
private

list of executors

Definition at line 572 of file sp_pexecutor.h.

◆ mRecentEvent

Idx faudes::ParallelExecutor::mRecentEvent
protected

recent event

Definition at line 567 of file sp_pexecutor.h.


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

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