|
|
||||||
|
syn_supreduce.cpp
Go to the documentation of this file.
154 // E(*siIt) \cap D(*sjIt) = E(*sjIt) \cap D(*siIt) = \emptyset and C(*siIt) = C(*sjIt) \Rightarrow M(*siIt) = M(*sjIt)
155 if( !(rSupStateInfo.at(*siIt).mEnabledEvents * rSupStateInfo.at(*sjIt).mDisabledEvents).Empty() ||
177 if(*rState2Class.find( goalStateI ) == *rState2Class.find( goalStateJ ) )// event leads to same class
196 bool flag = TestMergibility(goalStateI, goalStateJ, rWaitList, cNode, rSupGen, rSupStateInfo, rState2Class, rClass2States);
284 FD_DF("sup state: " << rsIt->first << " plant states " << rsIt->second.mPlantStates.ToString());
288 rsIt->second.mEnabledEvents = rSupGen.ActiveEventSet(rsIt->first); // all events enabled at current state2Class
293 rsIt->second.mDisabledEvents = rsIt->second.mDisabledEvents + rPlantGen.ActiveEventSet(*sIt); // compute active events in plant_det for state *sIt
294 rsIt->second.mPlantMarked = rsIt->second.mPlantMarked || rPlantGen.ExistsMarkedState(*sIt); // compute colors of corresponding plant states
297 rsIt->second.mDisabledEvents = rsIt->second.mDisabledEvents - rsIt->second.mEnabledEvents; // compute disable events (events that are not enabled
299 alwaysEnabledEvents = alwaysEnabledEvents - rsIt->second.mDisabledEvents; // subtract disabled events from always enabled events
310 std::cout << "state: " << rsIt->first << " enabled: " << rsIt->second.mEnabledEvents.ToString() << " disabled: " << rsIt->second.mDisabledEvents.ToString() << std::endl;*/ // REMOVE
314 for( ; eIt != alwaysEnabledEvents.End(); eIt++)// map that indicates if always enabled event is relevant for supervisor (true) or not (false)
335 // Evaluate min{k \in I | x_k \in [x_i]}; since StateSets are ordered by index, this simply means finding the first state in the class of x_i
336 if( mIt->first > *class2States[mIt->second].Begin() ){// state is already in other equivalence class
355 bool flag = TestMergibility(mIt->first,mbIt->first,waitList,mIt->first, rSupGen, supStateInfo, state2Class, class2States);
364 if(state2Class[*wlIt->begin() ] == state2Class[*(++(wlIt->begin() ) ) ])// no action is required if the states are already in the same class
366 class2States[state2Class[*wlIt->begin() ] ] = class2States[state2Class[*wlIt->begin()] ] + class2States[state2Class[*(++(wlIt->begin() ) ) ] ]; // union of state sets of both classes
371 state2Class[*sIt] = state2Class[*wlIt->begin() ]; // change class of all states that were merged
391 // Every state corresponds to a class that we found and we try to avoid adding trnasitions with always enabled events
425 newGoalState = class2ReducedStates[state2Class[tIt->X2] ]; // goal state of transition in the reduced supervisor
426 if(alwaysEnabledEvents.Exists(tIt->Ev) == true && newGoalState != newStateIdx )// always enabled event changes class and is thus relevant for supervisor
435 for(; uIt != usedEventsMap.end(); uIt++){// delete the unused events from the reduced supervisor
TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator Iterator on transition. Definition: cfl_transset.h:269 const TaStateSet< StateAttr > & States(void) const Return reference to state set. Definition: cfl_agenerator.h:1363 const TaEventSet< EventAttr > & Alphabet(void) const Return const reference to alphabet. Definition: cfl_agenerator.h:1358 bool SetTransition(Idx x1, Idx ev, Idx x2) Add a transition to generator by indices. Definition: cfl_agenerator.h:1197 void InjectAlphabet(const EventSet &rNewalphabet) Set mpAlphabet without consistency check. Definition: cfl_agenerator.h:1074 std::string ToString(const std::string &rLabel="", const Type *pContext=0) const Write configuration data to a string. Definition: cfl_types.cpp:169 EventSet ActiveEventSet(Idx x1) const Return active event set at state x1. Definition: cfl_generator.cpp:1938 TransSet::Iterator TransRelBegin(void) const Iterator to Begin() of transition relation. Definition: cfl_generator.cpp:1067 void SetInitState(Idx index) Set an existing state as initial state by index. Definition: cfl_generator.cpp:1432 TransSet::Iterator TransRelEnd(void) const Iterator to End() of transition relation. Definition: cfl_generator.cpp:1072 bool IsDeterministic(void) const Check if generator is deterministic. Definition: cfl_generator.cpp:2367 void SetMarkedState(Idx index) Set an existing state as marked state by index. Definition: cfl_generator.cpp:1507 Idx InsInitState(void) Create new anonymous state and set as initial state. Definition: cfl_generator.cpp:1287 bool ExistsInitState(Idx index) const Test existence of state in mInitStates. Definition: cfl_generator.cpp:1796 bool ExistsMarkedState(Idx index) const Test existence of state in mMarkedStates. Definition: cfl_generator.cpp:1806 virtual bool Disjoint(const TBaseSet &rOtherSet) const Test for this set to be disjoint witg other set. Definition: cfl_baseset.h:2089 void Deterministic(const Generator &rGen, Generator &rResGen) Make generator deterministic. Definition: cfl_determin.cpp:68 void Parallel(const Generator &rGen1, const Generator &rGen2, Generator &rResGen) Parallel composition. Definition: cfl_parallel.cpp:32 bool SupReduce(const System &rPlantGen, const System &rSupGen, System &rReducedSup) Supervisor Reduction algorithm. Definition: syn_supreduce.cpp:210 bool TestMergibility(Idx stateI, Idx stateJ, std::vector< std::set< Idx > > &rWaitList, Idx cNode, const System &rSupGen, const std::map< Idx, ReductionStateInfo > &rSupStateInfo, const std::map< Idx, Idx > &rState2Class, const std::vector< StateSet > &rClass2States) Definition: syn_supreduce.cpp:72 Data structure for identifying states in the same coset for supervisor reduction. Definition: syn_supreduce.cpp:47 Supervisor Reduction. libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen |