|
|
||||||
|
diag_decentralizeddiagnosis.cpp
Go to the documentation of this file.
1 /** @file diag_decentralizeddiagnosis.cpp Functions to test decentralized diagnosability and compute diagnosers.
24 bool IsCoDiagnosable(const System& rGen, const Generator& rSpec, const vector<const EventSet*>& rAlphabets, std::string& rReportString) {
50 CoVerifierState newVerifierState = CoVerifierState(rAlphabets.size(), rSpec.InitState(), rGen.InitState(),NORMAL);
51 for(Idx i = 0; i < rAlphabets.size(); i++) // all decentralized versions of the specification are initialized
74 cout << rSpec.StateName(currentState.second.mSpec2State) << " " << rGen.StateName(currentState.second.mPlantState) << " " << currentState.second.mLabel << ")" << endl;
85 newVerifierState = CoVerifierState(rAlphabets.size(), currentState.second.mSpec2State, currentState.second.mPlantState, NORMAL);
92 if(currentState.second.mLabel == CONFUSED ) // transition in spec1 from normal state// transition in spec1 from confused state
121 newVerifierState = CoVerifierState(rAlphabets.size(), currentState.second.mSpec2State, X2, NORMAL); // prepare the new verifier state
127 if(tIt == rSpec.TransRelEnd(currentState.second.mSpec2State,*eIt) ){ // violation of the specification
148 if(newVerifierState.mLabel == NORMAL || (currentState.second.mLabel == CONFUSED && newVerifierState.mPlantState == currentState.second.mPlantState) ){ // normal behavior or confused behavior extended in the specification (rule 3 or 4)
160 bool allSpecsParticipate = true; // indicates if the plant can proceed together with all specs that have the current event
164 if(plantIt != rGen.TransRelEnd(currentState.second.mPlantState, *eIt) ){// there plant has a transition with *eIt
166 if(specIt == rSpec.TransRelEnd(currentState.second.mSpec2State, *eIt) || currentState.second.mLabel == CONFUSED){
167 newVerifierState = CoVerifierState(rAlphabets.size(), currentState.second.mSpec2State, plantIt->X2, CONFUSED);
177 allSpecsParticipate = false; // this subsystem can detect that there is a deviationfrom the specification
241 if(rGen.TransRelBegin(currentState.second.mPlantState) == rGen.TransRelEnd(currentState.second.mPlantState) && currentState.second.mLabel == CONFUSED){
276 if(tIt != verifier.TransRelEnd(*stIt, negEvent) && sccIt->Exists(tIt->X2) ){ // there is a transition with negEvent within the SCC
293 bool DecentralizedDiagnoser(const System& rGen, const Generator& rSpec, const std::vector<const EventSet*>& rAlphabets, std::vector<Diagnoser*>& rDiags, std::string& rReportString){
317 void DecentralizedModularDiagnoser(const std::vector<const System*>& rGens, const Generator& rSpec, std::vector<Diagnoser*>& rDiags, std::string& rReportString){
337 bool IsCoDiagnosable(const System& rGen, const Generator& rSpec, const EventSetVector& rAlphabets){
349 bool DecentralizedDiagnoser(const System& rGen, const Generator& rSpec, const EventSetVector& rAlphabets, GeneratorVector& rDiags){
367 void DecentralizedModularDiagnoser(const SystemVector& rGens, const Generator& rSpec, GeneratorVector& rDiags){
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 EventSet ObservableEvents(void) const Get EventSet with observable events. Definition: cfl_cgenerator.h:1239 Provides the structure and methods to build and handle diagnosers. Definition: diag_generator.h:26 void DWrite(const Type *pContext=0) const Write configuration data to console, debugging format. Definition: cfl_types.cpp:225 bool SetTransition(Idx x1, Idx ev, Idx x2) Add a transition to generator by indices. Definition: cfl_generator.cpp:1626 const EventSet & Alphabet(void) const Return const reference to alphabet. Definition: cfl_generator.cpp:1878 Idx InsMarkedState(void) Create new anonymous state and set as marked state. Definition: cfl_generator.cpp:1318 TransSet::Iterator TransRelBegin(void) const Iterator to Begin() of transition relation. Definition: cfl_generator.cpp:1067 TransSet::Iterator TransRelEnd(void) const Iterator to End() of transition relation. Definition: cfl_generator.cpp:1072 Idx InsInitState(void) Create new anonymous state and set as initial state. Definition: cfl_generator.cpp:1287 bool InsEvent(Idx index) Add an existing event to alphabet by index. Definition: cfl_generator.cpp:1198 void GraphWrite(const std::string &rFileName, const std::string &rOutFormat="", const std::string &rDotExec="dot") const Produce graphical representation of this generator. Definition: cfl_generator.cpp:3847 void InjectAlphabet(const EventSet &rNewalphabet) Set mpAlphabet without consistency check. Definition: cfl_generator.cpp:1170 Functions to check a system's decentralized diagnosability. void LanguageDiagnoser(const System &rGen, const System &rSpec, Diagnoser &rDiagGen) Compute a standard diagnoser from an input generator and a specification. Definition: diag_languagediagnosis.cpp:275 bool ComputeScc(const Generator &rGen, const SccFilter &rFilter, std::list< StateSet > &rSccList, StateSet &rRoots) Compute strongly connected components (SCC) Definition: cfl_graphfncts.cpp:347 void Project(const Generator &rGen, const EventSet &rProjectAlphabet, Generator &rResGen) Deterministic projection. Definition: cfl_project.cpp:1349 TdiagGenerator< AttributeFailureTypeMap, AttributeDiagnoserState, AttributeCFlags, AttributeVoid > Diagnoser Definition: diag_generator.h:197 bool DecentralizedDiagnoser(const System &rGen, const Generator &rSpec, const EventSetVector &rAlphabets, GeneratorVector &rDiags) Function definition for run-time interface. Definition: diag_decentralizeddiagnosis.cpp:349 bool IsCoDiagnosable(const System &rGen, const Generator &rSpec, const EventSetVector &rAlphabets) Function definition for run-time interface. Definition: diag_decentralizeddiagnosis.cpp:337 void DecentralizedModularDiagnoser(const SystemVector &rGens, const Generator &rSpec, GeneratorVector &rDiags) Function definition for run-time interface. Definition: diag_decentralizeddiagnosis.cpp:367 VerifierStateLabel mLabel Definition: diag_decentralizeddiagnosis.h:30 std::vector< Idx > mSpec1State Definition: diag_decentralizeddiagnosis.h:27 libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen |