|
Go to the documentation of this file.
41 FD_DX( "ProposingExecutor(" << this << ")::DoAssign(other)");
68 FD_DS( "ProposingExecutor::ResetProposer()");
72 faudes_gettimeofday(&now);
77 EventSet::Iterator eit;
89 FD_DS( "ProposingExecutor::ResetProposer(): done");
96 FD_DS( "ProposingExecutor::Reset()");
100 FD_DS( "ProposingExecutor::Reset(): done");
106 std::stringstream retstr;
107 EventSet::Iterator eit;
124 FD_DS( "ProposingExecutor::ExecuteTime(): LoggingExecutor to execute time "<< duration);
127 EventSet::Iterator eit;
154 FD_DS( "ProposingExecutor::ExecuteTime(): LoggingExecutor to execute time: done ");
169 FD_DS( "ProposingExecutor::ExecuteEvent(): ProposingExecutor to execute event "<< mSimEvents. Str(event));
173 FD_DS( "ProposingExecutor::ExecuteEvent(): executed "<< EventName(event));
177 FD_DS( "ProposingExecutor::ExecuteEvent(): new active events "<< newActiveEvents. ToString());
181 EventSet::Iterator eit;
191 FD_DS( "ProposingExecutor::ExecuteEvent(): invalidating trigger type event "<< EStr(*eit));
204 if(etime. In(schedule)) {
207 FD_DS( "ProposingExecutor::ExecuteEvent(): delay event " << EStr(*eit) << ": etime "
208 << etime. Str() << " scheduled " << schedule);
213 FD_DS( "ProposingExecutor::ExecuteEvent(): invalidating state for executed event "<< EStr(*eit));
237 if(newActiveEvents. Exists(*eit))
244 FD_DS( "ProposingExecutor::ExecuteEvent(): done");
253 if(executeEvent. mEvent==0) return true;
265 FD_DS( "ProposingExecutor::ProposeNextTransition()");
274 EventSet::Iterator eit;
281 FD_DS( "ProposingExecutor::ProposeNextTransition(): current time: " <<
283 FD_DS( "ProposingExecutor::ProposeNextTransition(): timed state: " <<
285 FD_DS( "ProposingExecutor::ProposeNextTransition(): active events: " <<
287 FD_DS( "ProposingExecutor::ProposeNextTransition(): enabled interval: " <<
288 enabledInterval. Str());
289 FD_DS( "ProposingExecutor::ProposeNextTransition(): enabled time: " <<
291 FD_DS( "ProposingExecutor::ProposeNextTransition(): enabled events: " << std::endl <<
296 std::vector<faudes::Idx> candidates;
301 for(eit=enabledEvents. Begin(); eit!=enabledEvents. End(); ++eit) {
305 if(pattr-> Priority().mPriority >prio) {
309 candidates.push_back(candidate);
312 if((pattr-> Priority().mPriority ==prio) && (prio>=0))
313 candidates.push_back(*eit);
317 if(candidates.size()>1) {
323 FD_DS( "ProposingExecutor::ProposeNextTransition(): propose by priority: " << mSimEvents. Str(candidate));
331 for(eit=enabledEvents. Begin(); eit!=enabledEvents. End(); ++eit){
341 candidates.push_back(candidate);
345 candidates.push_back(*eit);
350 if(candidates.size()>1) {
356 FD_DS( "ProposingExecutor::ProposeNextTransition(): propose by stochastic: " << mSimEvents. Str(candidate) << " for " << Time::Str(occurence));
363 if(!enabledTime. Empty()) {
365 passtime=enabledInterval. UB();
366 if(enabledInterval. Empty()) passtime=0;
377 FD_DS( "ProposingExecutor::ProposeNextTransition(): propose to pass time: "<< Time::Str(passtime));
386 for(eit=enabledEvents. Begin(); eit!=enabledEvents. End(); ++eit){
390 if(pattr-> Priority().mPriority >prio || prio==0) {
394 candidates.push_back(candidate);
397 if((pattr-> Priority().mPriority ==prio) && (prio <0))
398 candidates.push_back(*eit);
402 if(candidates.size()>1) {
408 FD_DS( "ProposingExecutor::ProposeNextTransition(): propose by priority: " << mSimEvents. Str(candidate));
416 FD_DS( "ProposingExecutor::ProposeNextTransition(): Deadlocked");
423 FD_DS( "ProposingExecutor::ProposeNextTransition(): Lifelock");
432 FD_DS( "ProposingExecutor::ExecuteNextTransition() *********************************************************** ");
446 if((execTimedEvent. mEvent==0) && (execTimedEvent. mTime==0)) break;
453 if(execTimedEvent. mEvent!=0) break;
456 currentTime+=execTimedEvent. mTime;
461 if(execTimedEvent. mEvent!=0) {
462 execTimedEvent. mTime=currentTime;
463 return execTimedEvent;
469 return execTimedEvent;
476 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << ")");
479 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): no stoxchastic attribute found");
485 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): event not expired");
503 if(atarget. Empty()) {
504 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): empty target");
508 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): for timed automaton target " << atarget. Str());
510 std::vector<Float> pdfparavec=pattr-> Stochastic().mParameter;
517 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): for restricted target " << atarget. Str());
518 if(atarget. Empty()) {
519 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): empty target");
531 occtime= ran_gauss(pdfparavec[2],pdfparavec[3],atarget. LB(),atarget. UB());
539 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << ") internal error: no valid stochastic defs");
545 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): sampling failed: A");
550 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): random sample " << schedule
551 << "(" << occtime << ")");
561 if(!atarget. In(schedule)) {
562 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): sampling failed: B");
580 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): re-sampling");
588 FD_DS( "ProposingExecutor::Schedule(" << EStr(event) << "): delay type: etime "
589 << etime. Str() << " delay for " << schedule);
594 schedule+=etime. LB();
595 if(etime. In(schedule)) {
610 std::string label=rLabel;
611 if(label== "") label = "Executor";
622 FD_DC( "ProposingExecutor::DoRead(rTr, " << rLabel<< ")");
623 std::string label=rLabel;
624 if(label== "") label = "Executor";
627 while(!rTr. Eos(label)) {
628 FD_DC( "ProposingExecutor::DoRead(rTr, " << rLabel<< "): loop");
642 conditions. Read(rTr, "Conditions", this);
659 std::stringstream errstr;
660 errstr << "Invalid token, generators, conditions or simeventattribute section expected, " << rTr. FileLine();
661 throw Exception( "ProposingExecutor::DoRead", errstr.str(), 502);
664 FD_DC( "ProposingExecutor::DoRead(rTr, " << rLabel<< "): done");
671 FD_DX( "ProposingExecutor(" << this << ")::RevertToStep("<< step << ")");
675 if(!res) return false;
libFAUDES 2.28a
--- 2016.09.13
--- c++ api documentaion by doxygen
|