DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <PetriNet.hh>
Classes | |
class | Iterator |
Iterator on the PetriNet. More... | |
class | PerTypeIterator |
Iterators over the places or the transitions of the PetriNet. More... | |
Public Types | |
enum | NodeType { P, T } |
typedef PerTypeIterator | TransitionIterator |
typedef PerTypeIterator | PlaceIterator |
typedef set< Event >::const_iterator | EventIterator |
typedef set< Transition >::const_iterator | TransitionEventIterator |
Public Member Functions | |
Constructors and destructor | |
PetriNet () | |
PetriNet (const PetriNet &p1, const PetriNet &p2, const set< Event > &synchronization, bool strict=true) | |
virtual | ~PetriNet () |
General accessors/modifiers | |
void | setName (const string &name) |
const string & | name () const |
unsigned int | id () const |
void | setId (unsigned id) |
int | numberOfPlaces () const |
int | numberOfTransitions () const |
void | clear () |
const Diades::Graph::Graph & | graph () const |
Event management | |
EventIterator | beginOfEvents () const |
EventIterator | endOfEvents () const |
const Event & | getEvent (Transition t) const |
virtual void | setEvent (Transition t, const Event &event) |
bool | containsEvent (const Event &event) const |
Place management | |
Place | newPlace () |
Place | newPlace (const string &label) |
PlaceIterator | beginOfPlaces () const |
PlaceIterator | endOfPlaces () const |
const string & | labelOfPlace (const Place &p) const |
const string & | getInfoLabel (Place p) const |
void | setInfoLabel (Place p, const string &info) |
Transition management | |
virtual Transition | newTransition (const set< Place > &pre, const set< Place > &post) |
virtual Transition | newTransition (const set< Place > &pre, const set< Place > &post, const string &label) |
void | addPre (Transition transition, Place place) |
void | addPost (Transition transition, Place place) |
bool | pre (const Vdd *marking, const Transition &t) const |
Iterator | preBegin (const Transition &transition) const |
Iterator | preEnd (const Transition &transition) const |
Iterator | postBegin (const Transition &transition) const |
Iterator | postEnd (const Transition &transition) const |
TransitionIterator | beginOfTransitions () const |
TransitionIterator | endOfTransitions () const |
const string & | labelOfTransition (const Transition &t) const |
bool | inPre (const Transition &t, const Place &p) const |
TransitionEventIterator | beginOfTransitionWithEvent (const Event &event) const |
TransitionEventIterator | endOfTransitionWithEvent (const Event &event) const |
virtual void | deleteTransition (Transition t) |
virtual Transition | duplicateTransition (Transition t) |
Methods for net synchronisation | |
void | setPostponable (Transition t) |
bool | isPostponable (Transition t) const |
void | setNotPostponable (Transition t) |
void | synchronize (const PetriNet &p1, const PetriNet &p2, const set< Event > &synchronization, bool strict) |
Basic Marking management | |
void | setMarking (const set< Place > &marking) |
bool | isMarked () const |
bool | isMarked (Place p) const |
void | mark (Place p) |
void | unmark (Place p) |
IO management | |
virtual void | net2Dot (const string &fileName) const |
virtual void | net2Tina (ostream &os) const |
void | printWarning (const string &s) const |
void | printFactory (const string &fileName) const |
Marking Graph computation/analysis | |
void | lock () const |
void | unlock () const |
const Vdd * | marking () const |
const Zsl * | getPreZsl (Transition t) const |
const Zsl * | getIncidenceZsl (Transition t) const |
const Vdd * | reachableNodes () const |
void | printVdd (const Vdd *result, string fileName) |
ZslFactory * | zslFactory () const |
VddFactory * | vddFactory () const |
Protected Types | |
enum | TransitionType { NotPostponable, Postponable } |
Protected Attributes | |
ZslFactory * | _zslFactory |
VddFactory * | _vddFactory |
Graph::Graph | _graph |
Graph::NodeMap< NodeType > | _nodeType |
Graph::NodeMap< string > | _labelNode |
Graph::NodeMap< string > | _infoNode |
Graph::NodeMap< Event > | _event |
Graph::NodeMap< int > | _postponable |
string | _name |
const Vdd * | _initialMarking |
set< Place > | _explicitInitialMarking |
unordered_map< string, Graph::Node > | _placeOfLabel |
vector< set< Transition > > | _transitionsOfEventId |
Graph::NodeMap< const Zsl * > | _preZslOfTransition |
Graph::NodeMap< const Zsl * > | _incidenceZslOfTransition |
const Vdd * | _reachableNodes |
set< Event > | _eventList |
bool | _readOnly |
Private Attributes | |
int | _nbPlace |
int | _nbTrans |
unsigned int | _id |
Friends | |
class | Iterator |
class | PerTypeIterator |
1-bounded Petri nets
This class implements 1-bounded finite Petri Nets with the use of Diades::Graph::Graph. Each Place/Transition is a Diades::Graph::Node. Arcs between places and transitions are encoded with Diades::Graph::Edge.
Definition at line 61 of file PetriNet.hh.
Iteration over the set of PetriNet::Event involved in the current PetriNet
Definition at line 288 of file PetriNet.hh.
Iteration over the set of places in a PetriNet. It is encoded by a PerTypeIterator (type PetriNet:P)
Definition at line 280 of file PetriNet.hh.
typedef set<Transition>::const_iterator Diades::Petri::PetriNet::TransitionEventIterator |
Definition at line 294 of file PetriNet.hh.
Iteration over the set of transitions in a PetriNet. It is encoded by a PerTypeIterator (type PetriNet:T)
Definition at line 273 of file PetriNet.hh.
A PetriNet is a set of nodes: some are places (type P), some are transitions (type T)
Enumerator | |
---|---|
P | |
T |
Definition at line 76 of file PetriNet.hh.
|
protected |
Enumerator | |
---|---|
NotPostponable | |
Postponable |
Definition at line 297 of file PetriNet.hh.
Diades::Petri::PetriNet::PetriNet | ( | ) |
Default constructor
Diades::Petri::PetriNet::PetriNet | ( | const PetriNet & | p1, |
const PetriNet & | p2, | ||
const set< Event > & | synchronization, | ||
bool | strict = true |
||
) |
Parameterized constructor
p1 | PetriNet to synchronize |
p2 | PetriNet to synchronize |
synchronization | synchronized Event |
strict | type of synchronization |
|
inlinevirtual |
Destructor
Definition at line 369 of file PetriNet.hh.
|
inline |
Add a new Place to post(transition)
transition | a Transition |
place | a Place |
Definition at line 699 of file PetriNet.hh.
|
inline |
Add a new Place to pre(transition)
transition | a Transition |
place | a Place |
Definition at line 687 of file PetriNet.hh.
|
inline |
Definition at line 454 of file PetriNet.hh.
|
inline |
Definition at line 578 of file PetriNet.hh.
|
inline |
Definition at line 769 of file PetriNet.hh.
|
inline |
event | an Event |
Definition at line 808 of file PetriNet.hh.
References require.
void Diades::Petri::PetriNet::clear | ( | ) |
Clear the current Petri Net
|
inline |
Is the event contained in the Petri Net
event | an Event |
Definition at line 518 of file PetriNet.hh.
|
virtual |
|
virtual |
Transition duplication
t | a Transition |
Reimplemented in Diades::Petri::TimePetriNet.
|
inline |
Definition at line 464 of file PetriNet.hh.
|
inline |
Definition at line 588 of file PetriNet.hh.
|
inline |
Definition at line 779 of file PetriNet.hh.
|
inline |
event | an Event |
Definition at line 822 of file PetriNet.hh.
References require.
|
inline |
t | a Transition of the PetriNet |
Definition at line 474 of file PetriNet.hh.
References require.
const Zsl* Diades::Petri::PetriNet::getIncidenceZsl | ( | Transition | t | ) | const |
|
inline |
p | a Place |
Get the information associated to Place p. This information can be set by setInfoLabel
Definition at line 612 of file PetriNet.hh.
References require.
const Zsl* Diades::Petri::PetriNet::getPreZsl | ( | Transition | t | ) | const |
|
inline |
Definition at line 439 of file PetriNet.hh.
|
inline |
Definition at line 405 of file PetriNet.hh.
bool Diades::Petri::PetriNet::inPre | ( | const Transition & | t, |
const Place & | p | ||
) | const |
t | a Transition |
p | a Place |
|
inline |
Definition at line 931 of file PetriNet.hh.
bool Diades::Petri::PetriNet::isMarked | ( | Place | p | ) | const |
|
inline |
t | a Transition |
Definition at line 875 of file PetriNet.hh.
References require.
|
inline |
p | a Place |
Definition at line 601 of file PetriNet.hh.
Referenced by Diades::Petri::ZslFactory::printZsl().
|
inline |
t | a Transition |
Definition at line 790 of file PetriNet.hh.
void Diades::Petri::PetriNet::lock | ( | ) | const |
void Diades::Petri::PetriNet::mark | ( | Place | p | ) |
p | a Place Add p to the marking of the PetriNet |
|
inline |
Definition at line 398 of file PetriNet.hh.
|
virtual |
fileName | the name of an output file Write in the file 'fileName' the dot description of the PetriNet |
Reimplemented in Diades::Petri::TimePetriNet.
|
virtual |
|
inline |
Place Diades::Petri::PetriNet::newPlace | ( | const string & | label | ) |
label | Label associated to the created Place |
|
virtual |
pre | precondition of the transition |
post | postcondition of the transition |
|
inlinevirtual |
pre | precondition of the transition |
post | postcondition of the transition |
label | Label associated to the created Transition |
Definition at line 665 of file PetriNet.hh.
References require.
|
inline |
Definition at line 423 of file PetriNet.hh.
Referenced by main().
|
inline |
Definition at line 428 of file PetriNet.hh.
Referenced by main().
|
inline |
transition | a Transition |
Definition at line 748 of file PetriNet.hh.
|
inline |
transition | a Transition |
Definition at line 759 of file PetriNet.hh.
bool Diades::Petri::PetriNet::pre | ( | const Vdd * | marking, |
const Transition & | t | ||
) | const |
marking | a possible marking of the PetriNet |
t | a Transition |
|
inline |
marking | a possible marking of the PetriNet |
t | a Transition |
transition | a Transition |
Definition at line 728 of file PetriNet.hh.
|
inline |
transition | a Transition |
Definition at line 738 of file PetriNet.hh.
void Diades::Petri::PetriNet::printFactory | ( | const string & | fileName | ) | const |
Print factory
fileName | the output file name |
void Diades::Petri::PetriNet::printVdd | ( | const Vdd * | result, |
string | fileName | ||
) |
Print the content of a given vdd into a file
vdd | a Vdd |
fileName | file name |
|
inline |
Print warning message
s | a string that contains a contextual information |
Definition at line 991 of file PetriNet.hh.
const Vdd* Diades::Petri::PetriNet::reachableNodes | ( | ) | const |
Compute the set of reachable states from the initial marking
|
inlinevirtual |
t | a Transition of the PetriNet |
event | an Event Associates the Event 'event' to the Transition 't' |
Definition at line 488 of file PetriNet.hh.
References Diades::Petri::Event::id(), and require.
|
inline |
|
inline |
p | a Place |
info | an information Associates to the Place p the information info. This information can be retrieved by getInfoLabel |
Definition at line 628 of file PetriNet.hh.
References require.
void Diades::Petri::PetriNet::setMarking | ( | const set< Place > & | marking | ) |
Set a marking
marking | the set of marked places The marking of the PetriNet is 'marking' |
|
inline |
void Diades::Petri::PetriNet::setNotPostponable | ( | Transition | t | ) |
Set a Transition not postponable. If a Transition is not postponable, it means that it must be synhronised with a Transition from the other PetriNet when performing the synchronise() operation.
t | a Transition |
void Diades::Petri::PetriNet::setPostponable | ( | Transition | t | ) |
Set a Transition postponable. A postponable Transition is a transition that can be independently fired even if the associated event is usually synchronised with an event from another Petri Net by the synchronise() operator. In other words, a postponable transition can be fired even if there is no transition in the other Petri Net that can be synchronised. In the case it is possible to synchronise this Transition with another one, the synchronisation results in two Transitions. One is the synchronised one, the one is the independent one. Transition
t | a Transition |
void Diades::Petri::PetriNet::synchronize | ( | const PetriNet & | p1, |
const PetriNet & | p2, | ||
const set< Event > & | synchronization, | ||
bool | strict | ||
) |
Synchronization operator
p1 | PetriNet to synchronize |
p2 | PetriNet to synchronize |
synchronization | synchronized Event |
strict | type of synchronization |
void Diades::Petri::PetriNet::unlock | ( | ) | const |
void Diades::Petri::PetriNet::unmark | ( | Place | p | ) |
p | a Place Remove p to the marking of the PetriNet |
|
inline |
Definition at line 1080 of file PetriNet.hh.
|
inline |
Definition at line 1071 of file PetriNet.hh.
|
friend |
Definition at line 264 of file PetriNet.hh.
|
friend |
Definition at line 265 of file PetriNet.hh.
|
protected |
Definition at line 302 of file PetriNet.hh.
|
protected |
Definition at line 312 of file PetriNet.hh.
|
protected |
Definition at line 306 of file PetriNet.hh.
|
protected |
Type of Transition
Definition at line 298 of file PetriNet.hh.
|
private |
Definition at line 324 of file PetriNet.hh.
|
mutableprotected |
Definition at line 310 of file PetriNet.hh.
|
protected |
Definition at line 301 of file PetriNet.hh.
|
mutableprotected |
Definition at line 305 of file PetriNet.hh.
|
protected |
Definition at line 300 of file PetriNet.hh.
|
protected |
Definition at line 304 of file PetriNet.hh.
|
private |
Definition at line 317 of file PetriNet.hh.
|
private |
Definition at line 318 of file PetriNet.hh.
|
protected |
Definition at line 299 of file PetriNet.hh.
|
protected |
Definition at line 307 of file PetriNet.hh.
|
protected |
Definition at line 303 of file PetriNet.hh.
|
mutableprotected |
Definition at line 309 of file PetriNet.hh.
|
mutableprotected |
Definition at line 311 of file PetriNet.hh.
|
mutableprotected |
Definition at line 321 of file PetriNet.hh.
|
protected |
Definition at line 308 of file PetriNet.hh.
|
mutableprotected |
Definition at line 65 of file PetriNet.hh.
|
mutableprotected |
Definition at line 64 of file PetriNet.hh.