23 FD_DX(
"ParallelExecutor(" <<
this <<
")::ParallelExecutor()");
28 FD_DX(
"ParallelExecutor(" <<
this <<
")::ParallelExecutor(other)");
34 FD_DX(
"ParallelExecutor(" <<
this <<
")::ParallelExecutor(" << rFileName <<
")");
40 FD_DX(
"ParallelExecutor(" <<
this <<
")::~ParallelExecutor()");
45 FD_DX(
"ParallelExecutor(" <<
this <<
")::DoAssign(other)");
64 FD_DX(
"ParallelExecutor(" <<
this <<
")::Compile(): with #" <<
Size() <<
" generators");
80 FD_DX(
"ParallelExecutor(" <<
this <<
")::Compile(): done");
85 FD_DX(
"ParallelExecutor(" <<
this <<
")::Reset()");
92 FD_DX(
"ParallelExecutor(" <<
this <<
")::Insert(" << rFileName <<
")" );
99 FD_DX(
"ParallelExecutor(" <<
this <<
")::Insert(" << rFileName
107 FD_DX(
"ParallelExecutor(" <<
this <<
")::Insert(rGen): " << rGen.
Name() <<
" at #" <<
Size());
116 FD_DX(
"ParallelExecutor(" <<
this <<
")::Clear()");
132 std::string label=rLabel;
133 if(label==
"") label =
"Executor";
178 FD_DX(
"ParallelExecutor(" <<
this <<
")::DoRead(tr, " << rLabel <<
")");
180 std::string label=rLabel;
181 if(label==
"") label =
"Executor";
196 std::string dirname=
"";
200 FD_DX(
"ParallelExecutor(" <<
this <<
")::DoReadGenerators(tr): dirname " << dirname);
204 while(!rTr.
Eos(
"Generators")) {
221 std::stringstream errstr;
222 errstr <<
"Invalid token" << rTr.
FileLine();
223 throw Exception(
"ParallelExecutor::DoReadGenerators", errstr.str(), 502);
243 FD_DX(
"ParallelExecutor(" <<
this <<
")::ComputeEnabled(): members");
247 FD_DX(
"ParallelExecutor(" <<
this <<
")::ComputeEnabled(): time");
252 FD_DX(
"ParallelExecutor(" <<
this <<
")::ComputeEnabled(): e/d events");
261 FD_DX(
"ParallelExecutor(" <<
this <<
")::ComputeEnabled(): interval");
299 for(xit=
Begin(); xit !=
End(); xit++){
300 retInterval.
Intersect(xit->EnabledEventTime(event));
302 FD_DX(
"ParalelExecutor(" <<
this <<
")::EnabledEventTime(" << event <<
"):"<< retInterval.
Str());
311 for(xit=
Begin(); xit !=
End(); xit++){
312 retInterval.
Intersect(xit->EnabledGuardTime(event));
314 FD_DX(
"ParalelExecutor(" <<
this <<
")::EnabledGuardTime(" << event <<
"):"<< retInterval.
Str());
330 FD_DX(
"ParalelExecutor(" <<
this <<
")::CurrentParallelState(ptstate): set " <<
PTSStr(ptstate));
332 if(ptstate.
State.size()!=
Size())
return false;
333 if(ptstate.
Clock.size()!=
Size())
return false;
342 res = res && xit->CurrentTimedState(tstate);
357 FD_DX(
"ParalelExecutor(" <<
this <<
")::CurrentParallelState(ptstate): done");
366 if(time==0)
return true;
369 FD_DX(
"ParalelExecutor(" <<
this <<
")::ExecuteTime(time): execution of " << time
370 <<
" conflicts with enabled status " );
380 success &= xit->ExecuteTime(time);
392 FD_DX(
"ParallelExecutor(" <<
this <<
")::ExecuteEvent(): execution of event " <<
EStr(event)
393 <<
" conflicts with enabled status " );
399 if(xit->Generator().ExistsEvent(event))
400 success &= xit->ExecuteEvent(event);
403 FD_DX(
"ParallelExecutor(" <<
this <<
")::ExecuteEvent(): execution of event " <<
EStr(event)
404 <<
" conflicts with internal state data " );
422 xit->CurrentTime(time);
454 if(
Size()!=ptstate.
State.size())
return(
"(undef)");
455 std::stringstream res;
457 for(
unsigned int i=0; i<
Size(); i++){
459 if(i+1<
Size()) res <<
" x ";
461 res <<
") (clocks (";
462 for(
unsigned int i=0; i<
Size(); i++){
464 ClockSet::Iterator cit;
466 if(cit!=execp->
Generator().ClocksBegin()) res <<
" ";
467 res <<
CStr(*cit) <<
"=";
468 std::map<Idx,Time::Type>::const_iterator cvit=ptstate.
Clock[i].find(*cit);
469 if(cvit!=ptstate.
Clock[i].end()) res << cvit->second;
473 if(i+1<
Size()) res <<
" x (";
481 if(
Size()!=pstate.size())
return(
"(undef)");
482 std::stringstream res;
484 for(
unsigned int i=0; i<
Size(); i++){
485 res <<
mExecutors[i].Generator().SStr(pstate[i]);
486 if(i+1<
Size()) res <<
" x ";
494 if(
Size()==0)
return "(undef)";
495 return Begin()->TEStr(tevent);
500 if(
Size()==0)
return "(undef)";
501 return Begin()->EStr(event);
506 if(
Size()==0)
return "(undef)";
507 return Begin()->CStr(clock);
525 for(i=0, xit=
Begin(); xit!=
End(); xit++, i++) {
526 retEventSet.
EraseSet( xit->Generator().Alphabet() - xit->Generator().ActiveEventSet(stateVec[i]));
540 for(xit=
Begin(), i=0; xit!=
End(); ++xit, i++){
541 if(xit->Generator().Alphabet().Exists(ev))
542 if(xit->Generator().TransRelBegin(stateVec[i],ev)
543 == xit->Generator().TransRelEnd(stateVec[i],ev))
553 std::string label=rLabel;
554 if(label!=
"DiscreteState")
555 if(label!=
"TimedState")
557 FD_DC(
"ParallelExecutor::ParallelTimedState::DoWrite(): section " << rLabel <<
" context " << pContext);
560 if(exe)
if(exe->
Size()!=
State.size()) exe=0;
561 if(exe)
if(exe->
Size()!=
Clock.size()) exe=0;
563 if(rLabel==
"TimedState") rTw.
WriteBegin(
"TimedState");
566 for(
unsigned int i=0; i<
State.size(); i++) {
575 if(rLabel==
"TimedState")
576 for(
unsigned int i=0; i<
Clock.size(); i++)
577 if(
Clock.at(i).size()>0) doclocks=
true;
581 for(
unsigned int i=0; i<
Clock.size(); i++) {
583 std::map<Idx,Time::Type>::const_iterator cit;
584 for(cit=
Clock.at(i).begin(); cit!=
Clock.at(i).end(); cit++) {
586 if(exe) name=exe->
At(i).
Generator().ClockName(cit->first);
596 if(rLabel==
"TimedState") rTw.
WriteEnd(
"TimedState");
601 (void) rLabel; (void) pContext; (void) rTr;
602 FD_DC(
"ParallelExecutor::ParallelTimedState::DoRead()");