DiaDes  0.1
DIAgnosis of Discrete-Event System
Diagnose.hh
Go to the documentation of this file.
1 #ifndef __DIADES__AUTOMATA__DIAGNOSE_HH_
2 #define __DIADES__AUTOMATA__DIAGNOSE_HH_
3 
4 #include <boost/date_time/posix_time/posix_time.hpp>
5 #include "History.hh"
6 #include "FaultDiagProblem.hh"
7 
8 namespace Diades
9 {
10  namespace Automata
11  {
12  using boost::posix_time::time_duration;
13  typedef pair<time_duration,Event> EventOccurrence;
14 
15 
16  template<typename ALG>
17  class Diagnose
18  {
19  private:
21  public:
22  Diagnose(const FaultDiagProblem & problem):_hist()
23  {
24  ALG algorithm(problem);
25  algorithm.initialize();
26  while(!algorithm.finished())
27  {
28  algorithm.next();
29  if(algorithm.updated())
30  {
31  _hist.publishDiagnosis(microsec_clock::local_time(),algorithm.diagnosis());
32  }
33  }
34  }
35  const History & history() const
36  {
37  return _hist;
38  }
39  };
40 
41  };
42 };
43 
44 
45 #endif
void publishDiagnosis(ptime t, const Diagnosis &d)
Definition: History.hh:134
pair< time_duration, Event > EventOccurrence
Definition: Diagnose.hh:13
class History
const History & history() const
Definition: Diagnose.hh:35
Definition of a fault diagnosis problem in a discrete-event system.
Diagnose(const FaultDiagProblem &problem)
Definition: Diagnose.hh:22
Definition of a fault diagnosis problem in a discrete-event system.
Namespace of the Diades project.