DiaDes  0.1
DIAgnosis of Discrete-Event System
DdNet.hh
Go to the documentation of this file.
1 
2 /*
3  * @file DdNet.hh
4  * @author Yannick PencolĂ© <yannick.pencole at laas.fr>
5  *
6  * @date 7 August 2018, 15:31
7  */
8 
9 #ifndef __DIADES__PETRI__DDNET__HH__
10 #define __DIADES__PETRI__DDNET__HH__
11 
12 #include <unordered_set>
14 
15 
16 namespace Diades
17 {
18  namespace Petri
19  {
20 
22  {
23  protected:
24  std::unordered_set<Event> _observables;
25  std::unordered_set<Event> _unobservables;
26  vector<Marking> _finalMarkings;
27 
28  public:
29  DdNet();
30 
31  virtual ~DdNet(){}
32 
33  virtual void ddNet2Dot(const string & fileName) const;
34 
35  virtual void
37  {
38  _observables.insert(e);
39  _unobservables.erase(e);
40  }
41 
42  void
44  {
45  _observables.erase(e);
46  _unobservables.insert(e);
47  }
48 
49  bool
50  isObservable(const Event e) const
51  {
52  return _observables.find(e) != _observables.end();
53  }
54 
55 
61  virtual ostream & toDdnet(ostream & os) const;
62 
67  const unordered_set<Event> & observables() const
68  {
69  return _observables;
70  }
71 
76  const unordered_set<Event> & unobservables() const
77  {
78  return _unobservables;
79  }
80 
81  virtual Marking &
83  {
84  _finalMarkings.emplace_back();
85  return _finalMarkings.back();
86  }
87 
88  const vector<Marking> &
89  finalMarkings() const
90  {
91  return _finalMarkings;
92  }
93 
94 
95 
96 
97  void
98  ddNet2Dot(ostream & os) const;
99 
100  };
101  }
102 }
103 
104 
105 #endif /* __DIADES__PETRI__DDNET__HH__ */
106 
std::unordered_set< Event > _unobservables
Definition: DdNet.hh:25
const unordered_set< Event > & observables() const
Definition: DdNet.hh:67
const unordered_set< Event > & unobservables() const
Definition: DdNet.hh:76
PetriEventManager::EventId Event
Definition: LabelledNet.hh:39
virtual Marking & newFinalMarking()
Definition: DdNet.hh:82
virtual ostream & toDdnet(ostream &os) const
const vector< Marking > & finalMarkings() const
Definition: DdNet.hh:89
void setNonObservable(Event e)
Definition: DdNet.hh:43
bool isObservable(const Event e) const
Definition: DdNet.hh:50
virtual void setObservable(Event e)
Definition: DdNet.hh:36
virtual void ddNet2Dot(const string &fileName) const
Namespace of the Diades project.
std::unordered_set< Event > _observables
Definition: DdNet.hh:24
virtual ~DdNet()
Definition: DdNet.hh:31
vector< Marking > _finalMarkings
Definition: DdNet.hh:26