DiaDes  0.1
DIAgnosis of Discrete-Event System
BoundedNet.hh
Go to the documentation of this file.
1 #ifndef __DIADES__PETRI__BOUNDEDNET_HH_
2 #define __DIADES__PETRI__BOUNDEDNET_HH_
3 
4 #include <sstream>
5 #include <diades/graph/Graph.hh>
9 #include <set>
10 #include <unordered_set>
11 #include <diades/petri/Marking.hh>
12 #include <diades/graph/Utils.hh>
13 
14 using namespace std;
15 
16 
17 namespace Diades {
18  namespace Petri {
25 
32 
33 
40 
50  class BoundedNet {
51  public:
52 
58  static string typeName() {
59  return "Diades::Petri::BoundedNet";
60  }
61 
67 
68 
69 
70  public:
71 
77  typedef enum {
78  P, T
79  } NodeType;
80 
81 
82  public:
83 
92  class ConstIterator {
93  private:
94  list<Arc>::const_iterator _it;
95  bool _pre;
96  public:
97 
109  ConstIterator(list<Arc>::const_iterator it, bool pre) :
110  _it(it), _pre(pre) {
111  }
112 
119  const Place & operator*() const {
120  if (_pre) {
121  return _it->sourceRef();
122  }
123  return _it->targetRef();
124  }
125 
131  ++_it;
132  return *this;
133  }
134 
140  list<Arc>::const_iterator _it2 = _it;
141  ++_it;
142  return ConstIterator(_it2, _pre);
143  }
144 
151  const Place * operator->(void) const {
152  if (_pre) {
153  return &_it->sourceRef();
154  }
155  return &_it->targetRef();
156  }
157 
163  bool operator==(const ConstIterator & it) const {
164  return (_pre == it._pre) && (_it == it._it);
165  }
166 
172  bool operator!=(const ConstIterator & it) const {
173  return !(*this == it);
174  }
175  };
176 
177  public:
178 
188  private:
190  const BoundedNet * _net;
192 
193  public:
203 
211  return *_it;
212  }
213 
221  return &(*_it);
222  }
223 
229  bool operator==(const PerTypeIterator & it) const {
230  return (_it == it._it) && (_net == it._net) && (_type == it._type);
231  }
232 
238  bool operator!=(const PerTypeIterator & it) const {
239  return !(*this == it);
240  }
241 
248  PerTypeIterator & operator++();
249 
256  PerTypeIterator operator++(int);
257  };
258 
259  friend class Iterator;
260  friend class PerTypeIterator;
261 
262  public:
269 
276 
277 
278 
279 
284  typedef set<Transition>::const_iterator TransitionEventIterator;
285 
286 
287  protected:
288 
289  typedef enum {
290  NotPostponable, Postponable
291  } TransitionType;
299  string _name;
301  unordered_map<string, Diades::Graph::Node> _placeOfName;
302  unordered_map<string, Diades::Graph::Node> _transitionOfName;
303 
304 
305 
306 
307  private:
308  size_t _nbPlaces;
310 
311 
312  protected:
313 
314 
315  private:
316  unsigned int _id;
317 
318  public:
319 
320 
321 
326 
330  BoundedNet();
331 
335  BoundedNet(const BoundedNet & net);
336 
337 
343  BoundedNet & operator=(const BoundedNet & net);
344 
345 
346 
347 
357  BoundedNet & append(const BoundedNet & net);
358 
362  virtual ~BoundedNet() {
363  }
364 
366 
367 
368 
373 
378  void setName(const string & name) {
379  require(Exception, !name.empty(), "setName: the given name is empty.");
380  _name = name;
381 
382  }
383 
388  const string & name() const {
389  ensure(Exception, !_name.empty(), "name: empty name -> invalid net");
390  return _name;
391  }
392 
397  unsigned int id() const {
398  return _id;
399  }
400 
405  void setId(unsigned id) {
406  _id = id;
407  }
408 
409 
410 
414  void clear();
415 
420  const Diades::Graph::Graph & graph() const {
421  return _graph;
422  }
423 
425 
430 
438  Place newPlace() {
439 
440  Place p;
441 
442  ++_nbPlaces;
443  p = _graph.newNode();
444  _nodeType[p] = P;
445  stringstream s;
446  s << "__p" << p.id();
447  _labelOfNode[p] = "";
448  setNameOfPlace(p, s.str());
449  ensure(Exception, p.valid(), "newPlace: invalid returned place");
450  ensure(Exception, &p.owner() == &graph(), "newPlace: invalid returned place");
451  return p;
452  }
453 
454 
461  Place newPlace(const string & name);
462 
467  void deletePlace(Place p);
468 
474  void setLabelOfPlace(Place place, const string & label) {
475  require(Exception, place.valid(), "setLabelOfPlace: invalid place");
476  require(Exception, &place.owner() == &graph(),
477  "setLabelOfPLace: this place is not own by the current net");
478  require(Exception, _nodeType[place] == P, "setLabelOfPlace: this is not a place but a transition");
479  _labelOfNode[place] = label;
480  }
481 
486  PlaceIterator beginOfPlaces() const {
487  return PerTypeIterator(this, _graph.nodeBegin(), P);
488  }
489 
494  PlaceIterator endOfPlaces() const {
495  return PerTypeIterator(this, _graph.nodeEnd(), P);
496  }
497 
504  size_t numberOfPlaces() const {
505  return _nbPlaces;
506  }
507 
513  const string & labelOfPlace(const Place & p) const {
514  require(Exception, p.valid(), "labelOfPlace: invalid place");
515  require(Exception, &p.owner() == &graph(),
516  "labelOfPLace: this place is not own by the current net");
517  require(Exception, _nodeType[p] == P, "labelOfPlace: this is not a place but a transition");
518  return _labelOfNode[p];
519  }
520 
527  const string & nameOfPlace(Place p) const {
528  require(Exception, p.valid(), "nameOfPlace: invalid place");
529  require(Exception, &p.owner() == &_graph, "nameOfPlace: the place does not belong to the Petri Net");
530  require(Exception, _nodeType[p] == P, "nameOfPlace: this is not a place but a transition");
531  return _nameOfNode[p];
532  }
533 
541  void setNameOfPlace(Place p, const string & name) {
542  require(Exception, p.valid(), "setNameOfPlace: invalid place");
543  require(Exception, &p.owner() == &_graph, "setNameOfPlace: the place does not belong to the Petri Net");
544  require(Exception, _nodeType[p] == P, "setNameOfPlace: this is not a place but a transition");
545  if (_placeOfName.find(name) == _placeOfName.end()) {
546  _nameOfNode[p] = name;
547  _placeOfName[name] = p;
548  }
549  }
550 
557  Place getPlace(const string & name) const {
558  auto it = _placeOfName.find(name);
559  if (it == _placeOfName.end()) {
560  return Place();
561  }
562  return it->second;
563  }
564 
565 
566 
568 
569 
574 
583  Arc getArc(Diades::Graph::Node n1, Diades::Graph::Node n2) const;
584 
585 
594  virtual bool enables(Transition t, const Marking & marking) const;
595 
596 
597 
606  virtual bool fire(Transition t, const Marking & marking, Marking & newMarking) const;
607 
608 
609 
616  virtual Transition newTransition(const set<Place> & pre, const set<Place> & post);
617 
618 
619  public:
620 
629  virtual Transition newTransition(const set<Place> & pre, const set<Place> & post, const string & name) {
630  require(Exception, !name.empty(), "newTransition: empty name");
631  Transition trans;
632  if (_transitionOfName.find(name) == _transitionOfName.end()) {
633  trans = newTransition(pre, post);
634  setNameOfTransition(trans, name);
635  }
636  return trans;
637  }
638 
645  virtual void setInhibition(Place p, Transition t) {
646  require(Exception, p.valid(), "setInhibition: invalid place");
647  require(Exception, &p.owner() == &_graph, "setInhibition: the place does not belong to the Petri Net");
648  require(Exception, _nodeType[p] == P, "setInhibition: this is not a place but a transition");
649  require(Exception, t.valid(), "setInhibition: invalid transition");
650  require(Exception, &t.owner() == &_graph, "setInhibition: the transition does not belong to the Petri Net");
651  require(Exception, _nodeType[t] == T, "setInhibition: this is not a transition but a place");
652  _inhibitors[p].insert(t);
653  _inhibited[t].insert(p);
654  }
655 
661  const std::unordered_set<Transition> & inhibitors(Place p) const {
662  return _inhibitors[p];
663  }
664 
671  virtual void unsetInhibition(Place p, Transition t) {
672  require(Exception, p.valid(), "unsetInhibition: invalid place");
673  require(Exception, &p.owner() == &_graph, "unsetInhibition: the place does not belong to the Petri Net");
674  require(Exception, _nodeType[p] == P, "unsetInhibition: this is not a place but a transition");
675  require(Exception, t.valid(), "unsetInhibition: invalid transition");
676  require(Exception, &t.owner() == &_graph, "unsetInhibition: the transition does not belong to the Petri Net");
677  require(Exception, _nodeType[t] == T, "unsetInhibition: this is not a transition but a place");
678  _inhibitors[p].erase(t);
679  _inhibited[t].erase(p);
680  }
681 
690  bool inhibits(Place p, Transition t) const {
691  require(Exception, p.valid(), "inhibits: invalid place");
692  require(Exception, &p.owner() == &_graph, "inhibits: the place does not belong to the Petri Net");
693  require(Exception, _nodeType[p] == P, "inhibits: this is not a place but a transition");
694  require(Exception, t.valid(), "inhibits: invalid transition");
695  require(Exception, &t.owner() == &_graph, "inhibits: the transition does not belong to the Petri Net");
696  require(Exception, _nodeType[t] == T, "inhibits: this is not a transition but a place");
697  return _inhibitors[p].find(t) != _inhibitors[p].end();
698  }
699 
706  size_t numberOfTransitions() const {
707  return _nbTransitions;
708  }
709 
716  size_t numberOfArcs() const {
717  return _graph.numberOfEdges();
718  }
719 
727  void addPre(Transition transition, Place place) {
728  require(Exception, place.valid(), "addPre: invalid place");
729  require(Exception, &place.owner() == &_graph, "addPre: the place does not belong to the Petri Net");
730  require(Exception, _nodeType[place] == P, "addPre: this is not a place but a transition");
731  require(Exception, transition.valid(), "addPre: invalid transition");
732  require(Exception, &transition.owner() == &_graph, "addPre: the transition does not belong to the Petri Net");
733  require(Exception, _nodeType[transition] == T, "addPre: this is not a transition but a place");
734  _graph.newEdge(place, transition);
735  }
736 
744  void addPost(Transition transition, Place place) {
745  require(Exception, place.valid(), "addPost: invalid place");
746  require(Exception, &place.owner() == &_graph, "addPost: the place does not belong to the Petri Net");
747  require(Exception, _nodeType[place] == P, "addPost: this is not a place but a transition");
748  require(Exception, transition.valid(), "addPost: invalid transition");
749  require(Exception, &transition.owner() == &_graph, "addPost: the transition does not belong to the Petri Net");
750  require(Exception, _nodeType[transition] == T, "addPost: this is not a transition but a place");
751  _graph.newEdge(transition, place);
752  }
753 
762  ConstIterator preTransBegin(Place place) const {
763  require(Exception, place.valid(), "preTransBegin: invalid place");
764  require(Exception, &place.owner() == &_graph, "preTransBegin: the place does not belong to the Petri Net");
765  require(Exception, _nodeType[place] == P, "preTransBegin: this is not a place but a transition");
766  return ConstIterator(place.inEdgeBegin(), true);
767  }
768 
777  ConstIterator preTransEnd(Place place) const {
778  require(Exception, place.valid(), "preTransEnd: invalid place");
779  require(Exception, &place.owner() == &_graph, "preTransEnd: the place does not belong to the Petri Net");
780  require(Exception, _nodeType[place] == P, "preTransEnd: this is not a place but a transition");
781  return ConstIterator(place.inEdgeEnd(), true);
782  }
783 
792  ConstIterator postTransBegin(Place place) const {
793  require(Exception, place.valid(), "postTransBegin: invalid place");
794  require(Exception, &place.owner() == &_graph, "postTransBegin: the place does not belong to the Petri Net");
795  require(Exception, _nodeType[place] == P, "postTransBegin: this is not a place but a transition");
796  return ConstIterator(place.outEdgeBegin(), false);
797  }
798 
807  ConstIterator postTransEnd(Place place) const {
808  require(Exception, place.valid(), "postTransEnd: invalid place");
809  require(Exception, &place.owner() == &_graph, "postTransEnd: the place does not belong to the Petri Net");
810  require(Exception, _nodeType[place] == P, "postTransEnd: this is not a place but a transition");
811  return ConstIterator(place.outEdgeEnd(), false);
812  }
813 
819  ConstIterator preBegin(Transition transition) const {
820  require(Exception, transition.valid(), "preBegin: invalid transition");
821  require(Exception, &transition.owner() == &_graph, "preBegin: the transition does not belong to the Petri Net");
822  require(Exception, _nodeType[transition] == T, "preBegin: this is not a transition but a place");
823  return ConstIterator(transition.inEdgeBegin(), true);
824  }
825 
831  ConstIterator preEnd(Transition transition) const {
832  require(Exception, transition.valid(), "preEnd: invalid transition");
833  require(Exception, &transition.owner() == &_graph, "preEnd: the transition does not belong to the Petri Net");
834  require(Exception, _nodeType[transition] == T, "preEnd: this is not a transition but a place");
835  return ConstIterator(transition.inEdgeEnd(), true);
836  }
837 
843  ConstIterator postBegin(Transition transition) const {
844  require(Exception, transition.valid(), "postBegin: invalid transition");
845  require(Exception, &transition.owner() == &_graph, "postBegin: the transition does not belong to the Petri Net");
846  require(Exception, _nodeType[transition] == T, "postBegin: this is not a transition but a place");
847 
848  return ConstIterator(transition.outEdgeBegin(), false);
849  }
850 
856  ConstIterator postEnd(Transition transition) const {
857  require(Exception, transition.valid(), "postEnd: invalid transition");
858  require(Exception, &transition.owner() == &_graph, "postEnd: the transition does not belong to the Petri Net");
859  require(Exception, _nodeType[transition] == T, "postEnd: this is not a transition but a place");
860 
861  return ConstIterator(transition.outEdgeEnd(), false);
862  }
863 
868  TransitionIterator beginOfTransitions() const {
869  return PerTypeIterator(this, _graph.nodeBegin(), T);
870  }
871 
876  TransitionIterator endOfTransitions() const {
877  return PerTypeIterator(this, _graph.nodeEnd(), T);
878  }
879 
886  void setNameOfTransition(Transition transition, const string & name) {
887  require(Exception, transition.valid(), "setNameOfTransition: invalid transition");
888  require(Exception, &transition.owner() == &_graph, "setNameOfTransition: the transition does not belong to the Petri Net");
889  require(Exception, _nodeType[transition] == T, "setNameOfTransition: this is not a transition but a place");
890  require(Exception, !name.empty(), "setNameOfTransition: empty name");
891  if (_transitionOfName.find(name) == _transitionOfName.end()) {
892  _nameOfNode[transition] = name;
893  _transitionOfName[name] = transition;
894  }
895  }
896 
902  const string & nameOfTransition(Transition transition) const {
903  require(Exception, transition.valid(), "nameOfTransition: invalid transition");
904  require(Exception, &transition.owner() == &_graph, "nameOfTransition: the transition does not belong to the Petri Net");
905  require(Exception, _nodeType[transition] == T, "nameOfTransition: this is not a transition but a place");
906  return _nameOfNode[transition];
907  }
908 
914  Transition transitionOfName(const string & name) const {
915  require(Exception, !name.empty(), "transitionOfName: empty name");
916  auto it = _transitionOfName.find(name);
917  if (it == _transitionOfName.end()) {
918  return Transition();
919  }
920  return it->second;
921  }
922 
929  bool inPre(Transition t, Place p) const;
930 
931 
938  bool inPost(Transition t, Place p) const;
939 
940 
945  virtual void deleteTransition(Transition t);
946 
954  virtual Transition duplicateTransition(Transition t);
955 
956 
958 
959 
964 
965 
966 
967 
969 
970 
975 
980  const Marking & initialMarking() const {
981  return _initialMarking;
982  }
983 
989  return _initialMarking;
990  }
991 
996  bool isMarked() const {
997  return !_initialMarking.empty();
998  }
999 
1000 
1002 
1003 
1004 
1009 
1010 
1016  virtual void net2Dot(const string & fileName) const;
1017 
1018 
1019 
1027  void net2Tina(ostream & os) const;
1028 
1036  void net2Tina(const string & filename) const;
1037 
1043  void printPrettyMarking(ostream & os, const Marking & marking) const;
1044 
1045  protected:
1046 
1047 
1058  void net2TinaWithHeader(ostream & os, const string & netHeader) const;
1059 
1060 
1065  virtual void writeEndOfDotFile(ostream & os) const {
1066  }
1067 
1073  virtual void nameOfTransition2Dot(ostream & os, Transition transition) const {
1074  require(Exception, transition.valid(), "nameOfTransition2Dot: invalid transition");
1075  require(Exception, &transition.owner() == &_graph, "nameOfTransition2Dot: the transition does not belong to the Petri Net");
1076  require(Exception, _nodeType[transition] == T, "nameOfTransition2Dot: this is not a transition but a place");
1077  }
1078 
1085  virtual void net2TinaEnd(ostream & os, const string & header) const {
1086  os << header << " " << name() << "\n";
1087  }
1088 
1094  virtual void net2TinaTransition(ostream & os,
1095  Transition trans) const;
1096 
1102  virtual void net2TinaTransitionInterval(ostream & os,
1103  Transition transition) const {
1104  require(Exception, transition.valid(), "net2TinaTransitionInterval: invalid transition");
1105  require(Exception, &transition.owner() == &_graph, "net2TinaTransitionInterval: the transition does not belong to the Petri Net");
1106  require(Exception, _nodeType[transition] == T, "net2TinaTransitionInterval: this is not a transition but a place");
1107 
1108  os << " [0,w[ ";
1109  }
1110 
1116  virtual void net2TinaTransitionName(ostream & os, Transition transition) const {
1117  require(Exception, transition.valid(), "net2TinaTransitionInterval: invalid transition");
1118  require(Exception, &transition.owner() == &_graph, "net2TinaTransitionInterval: the transition does not belong to the Petri Net");
1119  require(Exception, _nodeType[transition] == T, "net2TinaTransitionInterval: this is not a transition but a place");
1120 
1121  }
1122 
1123 
1124 
1133  virtual void copyNet(const BoundedNet & net,
1138 
1139  public:
1140 
1152  virtual void appendNet(const BoundedNet & net,
1157 
1158 
1165  template<typename Iterator>
1166  Place mergePlaces(Iterator first, Iterator last)
1167  {
1168  if(first != last)
1169  {
1170  Place result = newPlace();
1171  while(first != last)
1172  {
1173  Place current = *first;
1174  ++first;
1175  while(!inhibitors(current).empty())
1176  {
1177  auto transition = *inhibitors(current).begin();
1178  setInhibition(result,transition);
1179  unsetInhibition(current,transition);
1180  }
1181  if(initialMarking().getMark(current)!=0)
1182  {
1183  initialMarking().mark(result,initialMarking().getMark(result) + initialMarking().getMark(current));
1184  initialMarking().unmark(current);
1185  }
1186  if(!labelOfPlace(current).empty())
1187  {
1188  setLabelOfPlace(result,labelOfPlace(result)+ " " + labelOfPlace(current));
1189  }
1190  for(auto it = preTransBegin(current); it != preTransEnd(current); ++it)
1191  {
1192  addPost(*it,result);
1193  }
1194  for(auto it = postTransBegin(current); it != postTransEnd(current); ++it)
1195  {
1196  addPre(*it,result);
1197  }
1198  deletePlace(current);
1199  }
1200  return result;
1201  }
1202  else
1203  {
1204  return *beginOfPlaces();
1205  }
1206  }
1207 
1208 
1210 
1211  };
1212 
1213  };
1214 
1215 };
1216 
1217 #endif
1218 
1219 
ConstIterator(list< Arc >::const_iterator it, bool pre)
Definition: BoundedNet.hh:109
Diades::Graph::Node * operator->(void) const
Definition: BoundedNet.hh:220
Diades::Graph::Node & operator*() const
Definition: BoundedNet.hh:210
const string & nameOfPlace(Place p) const
Definition: BoundedNet.hh:527
Transition transitionOfName(const string &name) const
Definition: BoundedNet.hh:914
bool operator==(const ConstIterator &it) const
Definition: BoundedNet.hh:163
ConstIterator postBegin(Transition transition) const
Definition: BoundedNet.hh:843
void addPost(Transition transition, Place place)
Definition: BoundedNet.hh:744
Edge newEdge(Node source, Node target)
n-bounded Petri nets
Definition: BoundedNet.hh:50
Diades::Graph::NodeIterator _it
Definition: BoundedNet.hh:189
EdgeSizeType numberOfEdges() const
Definition: GraphInt.hh:323
PerTypeIterator PlaceIterator
Definition: BoundedNet.hh:275
const Marking & initialMarking() const
Definition: BoundedNet.hh:980
virtual void writeEndOfDotFile(ostream &os) const
Definition: BoundedNet.hh:1065
virtual void net2TinaTransitionName(ostream &os, Transition transition) const
Definition: BoundedNet.hh:1116
STL namespace.
NodeIterator nodeEnd()
Definition: GraphInt.hh:538
Diades::Graph::Node Place
Definition: BoundedNet.hh:24
#define ensure(Exception, expr, message)
Definition: Assertion.hh:98
static string typeName()
Definition: BoundedNet.hh:58
ConstIterator preTransEnd(Place place) const
Definition: BoundedNet.hh:777
PlaceIterator endOfPlaces() const
Definition: BoundedNet.hh:494
const Place * operator->(void) const
Definition: BoundedNet.hh:151
bool operator!=(const ConstIterator &it) const
Definition: BoundedNet.hh:172
Place mergePlaces(Iterator first, Iterator last)
Definition: BoundedNet.hh:1166
void setNameOfTransition(Transition transition, const string &name)
Definition: BoundedNet.hh:886
void setId(unsigned id)
Definition: BoundedNet.hh:405
virtual Transition newTransition(const set< Place > &pre, const set< Place > &post, const string &name)
Definition: BoundedNet.hh:629
void setName(const string &name)
Definition: BoundedNet.hh:378
const std::unordered_set< Transition > & inhibitors(Place p) const
Definition: BoundedNet.hh:661
bool operator==(const PerTypeIterator &it) const
Definition: BoundedNet.hh:229
PerTypeIterator TransitionIterator
Definition: BoundedNet.hh:268
ConstIterator postTransEnd(Place place) const
Definition: BoundedNet.hh:807
TransitionIterator beginOfTransitions() const
Definition: BoundedNet.hh:868
ConstIterator preBegin(Transition transition) const
Definition: BoundedNet.hh:819
const Diades::Graph::Graph & graph() const
Definition: BoundedNet.hh:420
AutFsm::Transition Transition
Definition: Run.cc:73
GraphIterator< Node > NodeIterator
Definition: GraphInt.hh:139
void deleteTransition(Component &comp, InputIterator first, InputIterator last)
Definition: Component.hh:1381
void addPre(Transition transition, Place place)
Definition: BoundedNet.hh:727
virtual void nameOfTransition2Dot(ostream &os, Transition transition) const
Definition: BoundedNet.hh:1073
unordered_map< string, Diades::Graph::Node > _transitionOfName
Definition: BoundedNet.hh:302
virtual void unsetInhibition(Place p, Transition t)
Definition: BoundedNet.hh:671
TransitionIterator endOfTransitions() const
Definition: BoundedNet.hh:876
Diades::Graph::NodeMap< int > _postponable
Definition: BoundedNet.hh:296
unsigned int id() const
Definition: BoundedNet.hh:397
void setLabelOfPlace(Place place, const string &label)
Definition: BoundedNet.hh:474
Diades::Graph::NodeMap< NodeType > _nodeType
Definition: BoundedNet.hh:293
virtual void net2TinaTransitionInterval(ostream &os, Transition transition) const
Definition: BoundedNet.hh:1102
#define require(Exception, expr, message)
Definition: Assertion.hh:90
Place getPlace(const string &name) const
Definition: BoundedNet.hh:557
Namespace of the Diades project.
Diades::Graph::NodeMap< string > _nameOfNode
Definition: BoundedNet.hh:294
set< Transition >::const_iterator TransitionEventIterator
Definition: BoundedNet.hh:284
bool operator!=(const PerTypeIterator &it) const
Definition: BoundedNet.hh:238
size_t numberOfArcs() const
Definition: BoundedNet.hh:716
Definition: Run.cc:83
const string & labelOfPlace(const Place &p) const
Definition: BoundedNet.hh:513
Diades::Graph::Edge Arc
Definition: BoundedNet.hh:39
ConstIterator on the Net.
bool inhibits(Place p, Transition t) const
Definition: BoundedNet.hh:690
list< Arc >::const_iterator _it
Definition: BoundedNet.hh:94
Diades::Utils::Exception< BoundedNet > Exception
Definition: BoundedNet.hh:66
Iterators over the places or the transitions of the Net.
Definition: BoundedNet.hh:187
PlaceIterator beginOfPlaces() const
Definition: BoundedNet.hh:486
ConstIterator preEnd(Transition transition) const
Definition: BoundedNet.hh:831
size_t numberOfTransitions() const
Definition: BoundedNet.hh:706
virtual void net2TinaEnd(ostream &os, const string &header) const
Definition: BoundedNet.hh:1085
Diades::Graph::Graph _graph
Definition: BoundedNet.hh:292
NodeIterator nodeBegin()
Definition: GraphInt.hh:529
ConstIterator preTransBegin(Place place) const
Definition: BoundedNet.hh:762
virtual void setInhibition(Place p, Transition t)
Definition: BoundedNet.hh:645
ConstIterator postEnd(Transition transition) const
Definition: BoundedNet.hh:856
ConstIterator postTransBegin(Place place) const
Definition: BoundedNet.hh:792
Diades::Graph::NodeMap< string > _labelOfNode
Definition: BoundedNet.hh:295
const string & name() const
Definition: BoundedNet.hh:388
void setNameOfPlace(Place p, const string &name)
Definition: BoundedNet.hh:541
unordered_map< string, Diades::Graph::Node > _placeOfName
Definition: BoundedNet.hh:301
bool empty() const
Definition: Marking.hh:120
Diades::Graph::NodeMap< std::unordered_set< Transition > > _inhibitors
Definition: BoundedNet.hh:297
size_t numberOfPlaces() const
Definition: BoundedNet.hh:504
const string & nameOfTransition(Transition transition) const
Definition: BoundedNet.hh:902
Diades::Graph::NodeMap< std::unordered_set< Place > > _inhibited
Definition: BoundedNet.hh:298