|
|
||||||
|
mtc_observercomputation.cpp
Go to the documentation of this file.
8 output control consistency (OCC) and local control consistency (LCC) are provided. See for example
60 void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents) {
61 OP_DF("calcAbstAlphObs(" << rGenObs.Name() << "," << "rHighAlph, rNewHighAlph, rMapRelabeledEvents)");
66 // the controllable events that have been changed by the called function are set in the System cGenObs
71 void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Idx,set<Idx > > & rMapRelabeledEvents) {
72 OP_DF("calcAbstAlphObs(" << rGenObs.Name() << "," << "rControllableEvents, rHighAlph, rNewHighAlph, rMapRelabeledEvents)");
81 if(rMapRelabeledEvents.find(rtIt->first.Ev) == rMapRelabeledEvents.end() ){// if the event does not exist, yet, a nex element in the map is created
83 if(rGenObs.Alphabet().Exists(rtIt->second) )// FIXME: there seem to be relabeled transitions that do not exist
87 if(rGenObs.Alphabet().Exists(rtIt->second) )// FIXME: there seem to be relabeled transitions that do not exist
94 void calcAbstAlphObs(MtcSystem& rGenObs, EventSet& rControllableEvents, EventSet& rHighAlph, EventSet& rNewHighAlph, map<Transition,Idx>& rMapChangedTrans)
96 OP_DF("calcAbstAlphObs(" << rGenObs.Name() << ", rControllableEvents, rHighAlph, rNewHighAlph, rMapChangedTRans)");
109 // observer algorithm: In each step, a dynamic system is computed that fulfills the one-step observer condition.
110 // Iterative application of the bisimulation algorithm and the relabeling procedure yields an automaton rGenObs
111 // that, together with the new high-level alphabet rNewHighAlph fulfills the observer condition.
117 name = ("./Automata/Plots/" + rGenObs.Name() + "DynamicSystem_" + ToStringInteger(iterationCount));
126 name = ("./Automata/Plots/" + rGenObs.Name() + "Bisimulation_" + ToStringInteger(iterationCount));
132 // and relabel transitions in rGenObs if necessary. The high-level alphabet is modified accordingly
133 done=relabel(rGenObs, rControllableEvents, rNewHighAlph, mapStateToPartition, mapChangedTransReverse, rMapChangedTrans, mapRelabeledEvents);
140 OP_DF("calculateDynamicSystemObs(" << rGen.Name() << "," << rHighAlph.Name() << "," << rGenDyn.Name() << ")");
147 rGenDyn.InjectAlphabet(rHighAlph); // all high-level events are contained in the alphabet of rGenDyn
162 // map that maps a state (first Idx) to a reachable entry state (second Idx) via a high-level event (third Idx)
173 // maps a unique color index to the index of the associated transition label in teh dynamic system
176 colorLabel = ( rGenDyn.EventSymbolTablep())->UniqueSymbol("colorLabel" + rGen.ColorName(*csIt) + "_1");
186 OP_DF("calculateDynamicSystemObs: loop over all states; current state: " << rGen.StateName(*stateSetIt)
218 // check if state sIt is marked; if yes, create an m-transition (mLabel) between current state and sIt
231 // loop over all transitions of current state sIt to determine if high-level events are possible
241 " is an entry state and can be reached from current state" << rGen.SStr(*stateSetIt) << " by event " << rGen.EventName(tIt->Ev));
260 // This information is contained in the stateToEntryState map combined with the entryStateToLocalReach map.
Helper functions for projected generators. Container for colors: this is a NameSet with its own static symboltable. Definition: mtc_colorset.h:41 Iterator class for high-level api to TBaseSet. Definition: cfl_baseset.h:387 Iterator BeginByX2(Idx x2) const Iterator to first Transition specified by successor state x2. Definition: cfl_transset.h:1385 Iterator EndByX2(Idx x2) const Iterator to first Transition after specified successor state x2. Definition: cfl_transset.h:1396 TBaseSet< Transition, TransSort::X1EvX2 >::Iterator Iterator Iterator on transition. Definition: cfl_transset.h:269 const TaEventSet< EventAttr > & Alphabet(void) const Return const reference to alphabet. Definition: cfl_agenerator.h:1358 const ATransSet & TransRel(void) const Return reference to transition relation. Definition: cfl_agenerator.h:1368 EventSet ControllableEvents(void) const Get EventSet with controllable events. Definition: cfl_cgenerator.h:1124 Allows to create colored marking generators (CMGs) as the common five tupel consisting of alphabet,... Definition: mtc_generator.h:53 std::string ColorName(Idx colorIndex) const Look up the color name for a given color index. Definition: mtc_generator.h:1278 void Colors(ColorSet &rColors) const Insert all colors used in the generator to a given ColorSet. Definition: mtc_generator.h:1180 Triple (X1,Ev,X2) to represent current state, event and next state. Definition: cfl_transset.h:57 std::string ToString(const std::string &rLabel="", const Type *pContext=0) const Write configuration data to a string. Definition: cfl_types.cpp:169 StateSet::Iterator StatesBegin(void) const Iterator to Begin() of state set. Definition: cfl_generator.cpp:1057 const TransSet & TransRel(void) const Return reference to transition relation. Definition: cfl_generator.cpp:1888 bool SetTransition(Idx x1, Idx ev, Idx x2) Add a transition to generator by indices. Definition: cfl_generator.cpp:1626 TransSet::Iterator TransRelBegin(void) const Iterator to Begin() of transition relation. Definition: cfl_generator.cpp:1067 SymbolTable * EventSymbolTablep(void) const Get Pointer to EventSymbolTable currently used by this vGenerator. Definition: cfl_generator.cpp:813 EventSet::Iterator AlphabetBegin(void) const Iterator to Begin() of alphabet. Definition: cfl_generator.cpp:1047 std::string TStr(const Transition &rTrans) const Return pretty printable transition (eg for debugging) Definition: cfl_generator.cpp:3841 virtual void DotWrite(const std::string &rFileName) const Writes generator to dot input format. Definition: cfl_generator.cpp:3000 StateSet::Iterator StatesEnd(void) const Iterator to End() of state set. Definition: cfl_generator.cpp:1062 TransSet::Iterator TransRelEnd(void) const Iterator to End() of transition relation. Definition: cfl_generator.cpp:1072 bool InsEvent(Idx index) Add an existing event to alphabet by index. Definition: cfl_generator.cpp:1198 EventSet::Iterator AlphabetEnd(void) const Iterator to End() of alphabet. Definition: cfl_generator.cpp:1052 std::string SStr(Idx index) const Return pretty printable state name for index (eg for debugging) Definition: cfl_generator.cpp:3834 void InjectAlphabet(const EventSet &rNewalphabet) Set mpAlphabet without consistency check. Definition: cfl_generator.cpp:1170 void ComputeBisimulation(const Generator &rGenOrig, map< Idx, Idx > &rMapStateToPartition) Computation of the coarsest bisimulation relation for a specified generator. Definition: cfl_bisimulation.cpp:1272 Idx calcNaturalObserver(const MtcSystem &rGen, EventSet &rHighAlph) Calculate a colored natural observer by extending a given high-level alphabet. Definition: mtc_observercomputation.cpp:41 void ExtendHighAlphabet(const Generator &rGen, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition) Extension of the high-level alphabet to achieve the Lm-observer property. Definition: op_observercomputation.cpp:520 void calcAbstAlphObs(MtcSystem &rGenObs, EventSet &rControllableEvents, EventSet &rHighAlph, EventSet &rNewHighAlph, map< Transition, Idx > &rMapChangedTrans) Lm-observer computation. Definition: mtc_observercomputation.cpp:94 void calculateDynamicSystemObs(const MtcSystem &rGen, EventSet &rHighAlph, Generator &rGenDyn) Computation of the dynamic system for an Lm-observer. Definition: mtc_observercomputation.cpp:138 void LocalAccessibleReach(const Generator &rLowGen, const EventSet &rHighAlph, Idx lowState, StateSet &rAccessibleReach) Compute the accessible reach for a local automaton. Definition: cfl_localgen.cpp:161 bool relabel(Generator &rGenRelabel, EventSet &rControllableEvents, EventSet &rHighAlph, map< Idx, Idx > &rMapStateToPartition, map< Transition, Transition > &rMapChangedTransReverse, map< Transition, Idx > &rMapChangedTrans, map< Idx, EventSet > &rMapRelabeledEvents) Relabeling algorithm for the computation of an Lm-observer. Definition: op_observercomputation.cpp:1463 libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen |