#include <petrinet.h>
Class to represent Petri nets. The net is consists of places of class Place, transitions of class Transition and arcs of class Arc. The sets are saved in three lists P, T and F.
Definition at line 300 of file petrinet.h.
Public Member Functions | |
| Place * | newPlace (string my_role, communication_type my_type=INTERNAL, string my_port="") |
| adds a place with a given role and type | |
| Transition * | newTransition (string my_role) |
| adds a transition with a given role | |
| Arc * | newArc (Node *my_source, Node *my_target, arc_type my_type=STANDARD, unsigned int my_weight=1) |
| adds an arc given source and target node, and arc type | |
| void | mergePlaces (Place *&p1, Place *&p2) |
| merges two places | |
| void | mergePlaces (string role1, Place *&p2) |
| merges two places | |
| void | mergePlaces (Place *&p1, string role2) |
| merges two places | |
| void | mergePlaces (string role1, string role2) |
| merges two places given two roles | |
| void | mergePlaces (unsigned int id1, string role1, unsigned int id2, string role2) |
| merges two places given two identifiers and roles | |
| void | mergeTransitions (Transition *t1, Transition *t2) |
| merges two sequential transitions | |
| void | mergeParallelTransitions (Transition *t1, Transition *t2) |
| merges two parallel transitions | |
| Place * | findPlace (string role) const |
| finds place given a role | |
| Place * | findPlace (unsigned int id, string role) const |
| finds place given an id with a role | |
| Transition * | findTransition (string role) const |
| finds transition given a role | |
| set< Place * > | getFinalPlaces () const |
| returns a set of all final places | |
| void | renamePlace (string old_name, string new_name) |
| rename a node (i.e., rename one role in its history) | |
| void | removeTransition (Transition *t) |
| removes a transition from the net | |
| unsigned int | reduce (unsigned int reduction_level=5) |
| applies structral reduction rules | |
| void | mirror () |
| swaps input and output places | |
| void | addPrefix (string prefix) |
| adds a prefix to the name of all nodes of the net | |
| void | add_interface_suffix (string suffix) |
| adds a suffix to the name of all interface places of the net | |
| void | compose (const PetriNet &net) |
| composes a second Petri net | |
| void | produce (const PetriNet &net) |
| produces a second constraint oWFN | |
| void | makeChannelsInternal () |
| moves channel places to the list of internal places | |
| void | reenumerate () |
| re-enumerates the nodes | |
| void | loop_final_state () |
| adds a transition that has read arcs to all final places | |
| string | information () const |
| statistical output | |
| void | set_format (output_format my_format, bool standard=true) |
| set the output format | |
| void | calculate_max_occurrences () |
| calculate the maximal occurrences of communication | |
| void | setPlacePort (Place *place, string port) |
| sets the port of a place | |
| unsigned int | push_forEach_suffix (string suffix) |
| add a suffix for a forEach activity | |
| unsigned int | pop_forEach_suffix () |
| remove the last added suffix | |
| set< Node * > | preset (Node *n) const |
| calculates the preset of a node | |
| set< Node * > | postset (Node *n) const |
| calculates the preset of a node | |
| PetriNet () | |
| constructor | |
| PetriNet (const PetriNet &) | |
| copy constructor | |
| PetriNet & | operator= (const PetriNet &) |
| assignment operator | |
| ~PetriNet () | |
| destructor | |
Public Attributes | |
| list< set< Place * > > | final_set_list |
| conjunctive set of disjunctive place sets for simple final condition | |
Private Member Functions | |
| void | removePlace (Place *p) |
| removes a place from the net | |
| void | removeArc (Arc *f) |
| removes an arc from the net | |
| void | detachNode (Node *n) |
| removes all ingoing and outgoing arcs of a node | |
| unsigned int | arc_weight (Node *my_source, Node *my_target) const |
| returns the arc weight between two nodes | |
| bool | sameweights (Node *n) const |
| returns true if all arcs connecting to n have a weight of 1 | |
| void | output_apnn (ostream *output) const |
| APNN (Abstract Petri Net Notation) output. | |
| void | output_dot (ostream *output, bool draw_interface=true) const |
| DOT (Graphviz) output. | |
| void | output_ina (ostream *output) const |
| INA output. | |
| void | output_spin (ostream *output) const |
| SPIN output. | |
| void | output_info (ostream *output) const |
| info file output | |
| void | output_lola (ostream *output) const |
| LoLA-output. | |
| void | output_owfn (ostream *output) const |
| oWFN-output | |
| void | output_pep (ostream *output) const |
| low-level PEP output | |
| void | output_pnml (ostream *output) const |
| PNML (Petri Net Markup Language) output. | |
| unsigned int | reduce_unused_status_places () |
| remove unused status places | |
| unsigned int | reduce_suspicious_transitions () |
| remove transitions with empty pre or postset | |
| void | reduce_dead_nodes () |
| remove dead nodes of the Petri net | |
| void | reduce_identical_places () |
| elimination of identical places | |
| void | reduce_identical_transitions () |
| elimination of identical transitions | |
| void | reduce_series_places () |
| fusion of series places | |
| void | reduce_series_transitions () |
| fusion of series transitions | |
| unsigned int | reduce_self_loop_places () |
| elimination of self-loop places | |
| unsigned int | reduce_self_loop_transitions () |
| elimination of self-loop transitions | |
| void | reduce_equal_places () |
| elimination of identical places | |
| void | reduce_remove_initially_marked_places_in_choreographies () |
| remove unneeded initially marked places in choreographies | |
| unsigned int | getId () |
| returns an id for new nodes | |
Private Attributes | |
| deque< string > | forEach_suffix |
| a role suffix for the forEach activity | |
| set< Place * > | P |
| set of internal places of the Petri net | |
| set< Place * > | P_in |
| set of input places of the Petri net | |
| set< Place * > | P_out |
| set of output places of the Petri net | |
| set< Transition * > | T |
| set of transitions of the Petri net | |
| set< Arc * > | F |
| set of arcs of the Petri net | |
| map< string, set< Place * > > | ports |
| the ports of the oWFN as mapping from a name to the interface places | |
| unsigned int | nextId |
| id that will be assigned to the next node | |
| output_format | format |
| output file format | |
| bool | use_standard_style |
| a switch to change the style of the output format | |
| map< string, Node * > | roleMap |
| mapping of roles to nodes of the Petri net | |
| map< pair< Node *, Node * >, int > | weight |
| mapping of arcs to their appropriate weight | |
Friends | |
| ostream & | operator<< (ostream &os, const PetriNet &obj) |
| outputs the Petri net | |
1.5.2