DiaDes  0.1
DIAgnosis of Discrete-Event System
FaultDiagnosis.hh
Go to the documentation of this file.
1 #ifndef __DIADES__AUTOMATA__FAULTDIAGNOSIS_HH_
2 #define __DIADES__AUTOMATA__FAULTDIAGNOSIS_HH_
3 
4 #include <unordered_map>
11 
12 
13 
14 namespace Diades
15 {
16  namespace Automata
17  {
18 
20 
21  public:
22  static string typeName() { return "Automata::FaultDiagnosis"; }
24 
25  public:
27 
28  private:
29  AlgoType _type;
30  set<Event> _faultEvents; // set of faulty events to diagnose
31  const ObservableComponent * _globalModel; // the global model if available
32  ClassicalDiagnoser * _diagnoser; // the classical diagnoser if available
33  vector<const ComposableModel *> _models; // the components if available
34  ComposableModel * _globalComposableModel; // the composable model if available
35  const SynchronisationRules * _rules; // the synchronisation rules if available
36 
37  list< vector<State> > * _currentState; // current diagnosis (state-part)
38  list< set<Event> > * _currentFaults; // current diagnosis (fault-part)
39  set<State> _currentGlobalStates; // currentGlobalStates if availaible
40 
41  list<Event> _observations; // sequence of observed events
42 
43 
44 
45 
46 
47  private:
48 
53  void componentDiagnose(const Event & obs);
54 
59  void globalModelDiagnose(const Event & obs);
60 
61 
66  void diagnoserDiagnose(const Event & obs);
67 
68 
69 
70  /*
71  *
72  */
73  bool createTransition(State stateToSynchronise,
74  const vector<Transition> & nextTransition,
75  const vector<State> & nextState,
76  State & targetState,
77  Graph::Graph & synchronisation,
78  NodeMap< vector<State> > & states,
79  EdgeMap< vector<Transition> > & transitions,
80  EdgeMap< set<int> > & supportedTransition);
81 
82 
83  /*
84  *
85  */
86  bool createState(Graph::Graph & synchronisation,const vector<State> & nextState,
87  NodeMap< vector<State> > & states, State & s) const;
88 
89  /*
90  *
91  */
92  bool nextConfiguration(const list< list<Transition> > & candidateTransitions,
93  list< list<Transition>::const_iterator > & configuration) const;
94 
95  public:
102  FaultDiagnosis(const vector<const ObservableComponent *> models,
103  const SynchronisationRules & rules,
104  const set<Event> & faults);
105 
111  FaultDiagnosis(const ObservableComponent & globalModel, const set<Event> & faults);
112 
118  FaultDiagnosis(ClassicalDiagnoser & diagnoser);
119 
125  void diagnose(const Event & obs);
126 
127 
132  void getDiagnosis(Diagnosis & diagnosis);
133 
134 
135 
136  };
137  };
138 };
139 
140 
141 
142 #endif /*FAULTDIAGNOSIS_HH_*/
list< vector< State > > * _currentState
const ObservableComponent * _globalModel
bool createState(Graph::Graph &synchronisation, const vector< State > &nextState, NodeMap< vector< State > > &states, State &s) const
void diagnoserDiagnose(const Event &obs)
FaultDiagnosis(const vector< const ObservableComponent *> models, const SynchronisationRules &rules, const set< Event > &faults)
Diades::Utils::Exception< FaultDiagnosis > Exception
list< set< Event > > * _currentFaults
StIndexes states
Definition: Run.cc:266
void diagnose(const Event &obs)
An observable Component defined as a automaton.
void getDiagnosis(Diagnosis &diagnosis)
ComposableModel * _globalComposableModel
const SynchronisationRules * _rules
Namespace of the Diades project.
ClassicalDiagnoser * _diagnoser
void componentDiagnose(const Event &obs)
bool nextConfiguration(const list< list< Transition > > &candidateTransitions, list< list< Transition >::const_iterator > &configuration) const
bool createTransition(State stateToSynchronise, const vector< Transition > &nextTransition, const vector< State > &nextState, State &targetState, Graph::Graph &synchronisation, NodeMap< vector< State > > &states, EdgeMap< vector< Transition > > &transitions, EdgeMap< set< int > > &supportedTransition)
Diades::Graph::Node State
Definition: BeliefState.hh:36
vector< const ComposableModel * > _models
void globalModelDiagnose(const Event &obs)