DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <Net.hh>
Classes | |
class | ConstIterator |
class | PerTypeIterator |
Iterators over the places or the transitions of the Net. More... | |
Public Types | |
enum | NodeType { P, T } |
typedef Diades::Utils::Exception< Net > | Exception |
typedef PerTypeIterator | TransitionIterator |
typedef PerTypeIterator | PlaceIterator |
typedef set< Event >::const_iterator | EventIterator |
typedef set< Transition >::const_iterator | TransitionEventIterator |
Public Member Functions | |
Constructors and destructor | |
Net () | |
Net (const Net &p1, const Net &p2, const set< Event > &synchronization, bool strict=true) | |
virtual | ~Net () |
General accessors/modifiers | |
void | setName (const string &name) |
const string & | name () const |
unsigned int | id () const |
void | setId (unsigned id) |
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, Event event) |
bool | containsEvent (Event event) const |
Place management | |
Place | newPlace () |
Place | newPlace (const string &label) |
void | setLabelOfPlace (const Place &place, const string &label) |
PlaceIterator | beginOfPlaces () const |
PlaceIterator | endOfPlaces () const |
size_t | numberOfPlaces () const |
const string & | labelOfPlace (const Place &p) const |
const string & | getInfoLabel (Place p) const |
void | setInfoLabel (Place p, const string &info) |
Transition management | |
virtual bool | enables (const Transition &t, const set< Place > &marking) |
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) |
size_t | numberOfTransitions () const |
size_t | numberOfArcs () const |
void | addPre (Transition transition, Place place) |
void | addPost (Transition transition, Place place) |
bool | pre (const Vdd *marking, const Transition &t) const |
ConstIterator | preTransBegin (const Place &place) const |
ConstIterator | preTransEnd (const Place &place) const |
ConstIterator | postTransBegin (const Place &place) const |
ConstIterator | postTransEnd (const Place &place) const |
ConstIterator | preBegin (const Transition &transition) const |
ConstIterator | preEnd (const Transition &transition) const |
ConstIterator | postBegin (const Transition &transition) const |
ConstIterator | postEnd (const Transition &transition) const |
TransitionIterator | beginOfTransitions () const |
TransitionIterator | endOfTransitions () const |
void | setLabelOfTransition (const Transition &t, const string &label) |
const string & | labelOfTransition (const Transition &t) const |
bool | inPre (const Transition &t, const Place &p) const |
TransitionEventIterator | beginOfTransitionWithEvent (Event event) const |
TransitionEventIterator | endOfTransitionWithEvent (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 Net &p1, const Net &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) |
const set< Place > & | initialMarking () const |
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 |
Static Public Member Functions | |
static string | typeName () |
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::ConstNodeMap< const Zsl * > | _preZslOfTransition |
Graph::ConstNodeMap< const Zsl * > | _incidenceZslOfTransition |
const Vdd * | _reachableNodes |
set< Event > | _eventList |
bool | _readOnly |
Private Attributes | |
size_t | _nbPlaces |
size_t | _nbTransitions |
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.
Iteration over the set of places in a Net. It is encoded by a PerTypeIterator (type Net:P)
typedef set<Transition>::const_iterator Diades::Petri::Net::TransitionEventIterator |
Iteration over the set of transitions in a Net. It is encoded by a PerTypeIterator (type Net:T)
|
protected |
Diades::Petri::Net::Net | ( | ) |
Default constructor
Diades::Petri::Net::Net | ( | const Net & | p1, |
const Net & | p2, | ||
const set< Event > & | synchronization, | ||
bool | strict = true |
||
) |
Parameterized constructor
p1 | Net to synchronize |
p2 | Net to synchronize |
synchronization | synchronized Event |
strict | type of synchronization |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
|
virtual |
Transition duplication
t | a Transition |
Reimplemented in Diades::Petri::TimeNet.
|
virtual |
|
inline |
|
inline |
|
inline |
|
inline |
event | an Event |
Definition at line 958 of file Net.hh.
References Diades::Automata::deleteTransition(), and require.
|
inline |
const Zsl* Diades::Petri::Net::getIncidenceZsl | ( | Transition | t | ) | const |
|
inline |
const Zsl* Diades::Petri::Net::getPreZsl | ( | Transition | t | ) | const |
|
inline |
|
inline |
|
inline |
bool Diades::Petri::Net::inPre | ( | const Transition & | t, |
const Place & | p | ||
) | const |
t | a Transition |
p | a Place |
|
inline |
bool Diades::Petri::Net::isMarked | ( | Place | p | ) | const |
|
inline |
t | a Transition |
Definition at line 1011 of file Net.hh.
References require, and Diades::Automata::Experimental::synchronize().
|
inline |
|
inline |
void Diades::Petri::Net::lock | ( | ) | const |
|
inline |
|
virtual |
fileName | the name of an output file Write in the file 'fileName' the dot description of the Net |
Reimplemented in Diades::Petri::Chronicle, and Diades::Petri::TimeNet.
|
virtual |
os | output stream Write the TINA '.net' description of the Net (see TINA ) on the output stream |
Reimplemented in Diades::Petri::Chronicle, and Diades::Petri::TimeNet.
|
inline |
Place Diades::Petri::Net::newPlace | ( | const string & | label | ) |
label | Label associated to the created Place |
|
virtual |
pre | precondition of the transition |
post | postcondition of the transition |
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool Diades::Petri::Net::pre | ( | const Vdd * | marking, |
const Transition & | t | ||
) | const |
marking | a possible marking of the Net |
t | a Transition |
|
inline |
|
inline |
|
inline |
marking | a possible marking of the Net |
t | a Transition |
place | a Place |
|
inline |
void Diades::Petri::Net::printFactory | ( | const string & | fileName | ) | const |
Print factory
fileName | the output file name |
void Diades::Petri::Net::printVdd | ( | const Vdd * | result, |
string | fileName | ||
) |
Print the content of a given vdd into a file
vdd | a Vdd |
fileName | file name |
|
inline |
const Vdd* Diades::Petri::Net::reachableNodes | ( | ) | const |
Compute the set of reachable states from the initial marking
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
inline |
void Diades::Petri::Net::setMarking | ( | const set< Place > & | marking | ) |
Set a marking
marking | the set of marked places The marking of the Net is 'marking' |
|
inline |
void Diades::Petri::Net::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 Net when performing the synchronise() operation.
t | a Transition |
void Diades::Petri::Net::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::Net::synchronize | ( | const Net & | p1, |
const Net & | p2, | ||
const set< Event > & | synchronization, | ||
bool | strict | ||
) |
Synchronization operator
p1 | Net to synchronize |
p2 | Net to synchronize |
synchronization | synchronized Event |
strict | type of synchronization |
|
inlinestatic |
void Diades::Petri::Net::unlock | ( | ) | const |
|
inline |
|
inline |
|
friend |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
mutableprotected |