19 int main(
int argc,
char* argv[])
23 cerr<<
"usage: ./exefaudes <gen-File>"<<endl;
34 cout <<
"##########################################" << endl;
35 cout <<
"# interactive simulation of " << sim.
Generator().Name() << endl;
36 cout <<
"# at state " << endl;
47 cout<<
">> Simulation is deadlocked."<<endl;
48 cout<<
">> Abort (a) or reset simulation (r)?"<<endl;
51 if(choice==
"a")
break;
52 else if(choice==
"r") {
56 cerr<<
">> ignoring invalid choice"<<endl;
63 cout <<
">> Time may pass up to " << etime.
Str() << endl;
64 cout <<
">> No events are enabled for " << einterval.
Str() << endl;
65 cout <<
">> Abort (a), or let time pass (t): ";
69 cout <<
">> Time may pass up to " << etime.
Str() << endl;
70 cout <<
">> The following events are enabled for time " << einterval.
Str() << endl;
72 cout<<
">> Abort (a), let time pass (t) or execute transition (e): ";
78 }
else if(choice==
"e") {
79 cout<<
">> Event index: ";
82 if(eevents.
Exists(event)==
false) {
83 cout<<
">> ignoring invalid event index "<<endl;
89 }
else if (choice==
"t") {
90 cout<<
">> Let time pass t: ";
93 if(! etime.
In(time)) {
94 cout<<
">> ignoring invalid time "<<endl;
99 cout<<
">> ignoring invalid choice "<<endl;
An Executor is a timed generator that maintains a current state.
const TimeInterval & EnabledTime() const
Get maximal interval of time that can pass without executing an event.
bool ExecuteTime(Time::Type time)
Let time pass.
const EventSet & EnabledEvents() const
Get set of events that are enabled at current (timed) state.
bool ExecuteEvent(Idx event)
Execute transition.
void CurrentTime(Time::Type time)
Set current time.
void Generator(const TimedGenerator &rGen)
Initialise from TimedGenerator.
const TimeInterval & EnabledInterval() const
Get maximal interval on which set of enabled events is constant.
void Reset()
Reset all clocks and assign initial state.
bool IsDeadlocked() const
Returns true if timed generator is in a deadlocked state.
std::string CurrentTimedStateStr(void) const
Pretty printable string of current state.
Set of indices with symbolic names.
bool Exists(const Idx &rIndex) const
Test existence of index.
Model of a time interval.
bool In(Time::Type time) const
Test whether a point satisfies interval.
std::string Str(void) const
Pretty printable string.
Int Type
Datatype for point on time axis.
void DWrite(const Type *pContext=0) const
Write configuration data to console, debugging format.
int main(int argc, char *argv[])
bool Empty(void) const
Test whether if the TBaseSet is Empty.
Includes all libFAUDES headers, incl plugings
libFAUDES resides within the namespace faudes.
uint32_t Idx
Type definition for index type (allways 32bit)