#include <sp_plpexecutor.h>
Inheritance diagram for faudes::ProposingExecutor:
1.) SimPriorityEventAttribute, positive priority
2.) SimStochasticEventAttribute, stochastic timing
3.) passing by time
4.) SimPriorityEventAttribute, negative priority
Note that the above procedure will never come up with a proposal that fails to satisfy invariant and guard conditions. In this sense, the above procedure is compliant with Alur semantics of timed automata.
If the above procedure fails to indicate a transition to execute or time to let pass, the system is deadlocked. If the procedure sticks with case 3) and infinite duration, it might be either life locked (no enabled events) or just unwilling/unable to execute a negative priority event. The latter case can be used for sensor events in a hardware-in-the-loop simulation.
Note that type Extern or Delay schedules can disable the respective event in a way that potentially leads to blocking behaviour even if the timed automata is non-blocking by Alur semantics. This is a consequence of the fact that both types model additional phenomena that are synchronized with the timed automata, and it is perferctly reasonable that this synchronisation introduces blocking situations. In contrast, events of type Trigger are not affected by the blocking issue provided that guards lie within the respective invariant.
<Executor> <Generators> "./some_generator.gen" "./other_generator.gen" </Generators> <Conditions> ... ... </Conditions> <SimEventAttributes> ... ... </SimEventAttributes> </Executor>
Technical detail: since the trace buffer only covers the dynamic state of the parallel executor, the RevertToStep method cannot recover the stochastic event states. Including stochastic states with the trace buffer is considered to expensive.
Definition at line 139 of file sp_plpexecutor.h.
Public Member Functions | |
Constructors & Destructor | |
ProposingExecutor () | |
Creates an emtpy ProposingExecutor. | |
Simulation Event Attributes | |
const SimEventAttribute & | EventAttribute (Idx index) const |
Simulation event attribute lookup. | |
void | EventAttribute (Idx index, const SimEventAttribute &rAttr) |
Set simulation event attribute. | |
void | Alphabet (const sEventSet &rAlphabet) |
Set all simulation event attributes. | |
const sEventSet & | Alphabet (void) const |
Access alphabet (incl simulation event attributes). | |
Execution Proposal | |
TimedEvent | ExecuteNextTransition () |
Execute next transition. | |
const TimedEvent & | ProposeNextTransition () |
Propose next transition. | |
std::string | EventStatesToString (void) const |
Inspect stochastic event states (debugging). | |
Re-implemenented from ParallelExecutor | |
virtual void | Reset (long int seed=0) |
Reset the ProposingExecutor. | |
virtual void | Clear (void) |
Clear all data (generators, simulation attributes etc). | |
bool | ExecuteTime (tpTime::Type duration) |
Execute time duration. | |
bool | ExecuteEvent (Idx event) |
Execute event. | |
bool | ExecuteTransition (const TimedEvent &tevent) |
Execute event by transition. | |
bool | RevertToStep (Idx step) |
Revert executor to past step. | |
Private Member Functions | |
void | ResetProposer (long int seed=0) |
Reset stochastic state of events. | |
tpTime::Type | Schedule (Idx event, SimEventAttribute *pattr) |
Evaluate random variable to schedule event. | |
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Reads proposing executor from TokenReader, see also public wrappers Type::Read. | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Write to TokenWriter, see also public wrappers Type::Write. | |
Private Attributes | |
sEventSet | mSimEvents |
Simulation event attributes, incl stochastic and priority data. | |
bool | mPValid |
Valid proposal available. | |
TimedEvent | mProposal |
Available proposal. |
|
Creates an emtpy ProposingExecutor.
Definition at line 19 of file sp_plpexecutor.cpp. |
|
Access alphabet (incl simulation event attributes).
Reimplemented from faudes::ParallelExecutor. Definition at line 205 of file sp_plpexecutor.h. |
|
Set all simulation event attributes. Any previous attributes are removed. Any events not in rAlphabet become the default attribute attached (which is priority 0) Requires Reset().
Definition at line 43 of file sp_plpexecutor.cpp. |
|
Clear all data (generators, simulation attributes etc).
Reimplemented from faudes::LoggingExecutor. Reimplemented in faudes::DeviceExecutor. Definition at line 25 of file sp_plpexecutor.cpp. |
|
Reads proposing executor from TokenReader, see also public wrappers Type::Read.
Reimplemented from faudes::LoggingExecutor. Definition at line 603 of file sp_plpexecutor.cpp. |
|
Write to TokenWriter, see also public wrappers Type::Write.
Reimplemented from faudes::LoggingExecutor. Definition at line 591 of file sp_plpexecutor.cpp. |
|
Set simulation event attribute. Requires Reset().
Definition at line 38 of file sp_plpexecutor.cpp. |
|
Simulation event attribute lookup.
Definition at line 33 of file sp_plpexecutor.cpp. |
|
Inspect stochastic event states (debugging). return EventInfoMap string Definition at line 83 of file sp_plpexecutor.cpp. |
|
Execute event.
Reimplemented from faudes::LoggingExecutor. Reimplemented in faudes::DeviceExecutor. Definition at line 154 of file sp_plpexecutor.cpp. |
|
Execute next transition. Choose the transition to execute by priorities and stochastic properties.
Definition at line 416 of file sp_plpexecutor.cpp. |
|
Execute time duration.
Reimplemented from faudes::LoggingExecutor. Definition at line 109 of file sp_plpexecutor.cpp. |
|
Execute event by transition.
Definition at line 235 of file sp_plpexecutor.cpp. |
|
Propose next transition. Propose a transition to execute by priorities and stochastic properties.
Definition at line 248 of file sp_plpexecutor.cpp. |
|
Reset the ProposingExecutor. This includes a reset of the ParallelExecutor and the simulation event states.
Reimplemented in faudes::DeviceExecutor. Definition at line 73 of file sp_plpexecutor.cpp. |
|
Reset stochastic state of events.
Definition at line 51 of file sp_plpexecutor.cpp. |
|
Revert executor to past step. This will revert only the executor dynamic state (incl clock values, current time). The condition and event states, however, will not be reverted.
Reimplemented from faudes::LoggingExecutor. Definition at line 645 of file sp_plpexecutor.cpp. |
|
Evaluate random variable to schedule event. Referring to the specified stochastic attribute, take a random sample to schedule the next occurence of the event. The result is given as return value and is also recorded in the simulation state of the event attribute.
Definition at line 460 of file sp_plpexecutor.cpp. |
|
Available proposal.
Definition at line 326 of file sp_plpexecutor.h. |
|
Valid proposal available.
Definition at line 321 of file sp_plpexecutor.h. |
|
Simulation event attributes, incl stochastic and priority data.
Definition at line 316 of file sp_plpexecutor.h. |