Collaboration diagram for petri_net:
Public Member Functions | |
petri_net () | |
Construct an empty petri net. | |
int | p_size () const |
Return the number of places in the net. | |
int | t_size () const |
Return the number of transitions in the net. | |
bool | place_exists (const std::string &name) const |
Return true if a place of name name is present in the net. | |
bool | transition_exists (const std::string &name) const |
Return true if a transition of name name is present in the net. | |
int | get_place_num (const std::string &name) const |
Return the unique identifier of the place name. | |
int | get_transition_num (const std::string &name) const |
Return the unique identifier of the transition name. | |
const std::string & | get_place_name (int p) const |
Return the name of the place identified by p. | |
const std::string & | get_transition_name (int t) const |
Return the name of the transition identified by t. | |
void | add_place (const std::string &name, int initial_marking=0) |
Create a new place of name name and of initial marking initial_marking. | |
void | add_transition (const std::string &name) |
Create a new transition of name name. | |
void | set_input_place (const std::string &place_name, const std::string &trans_name, int valuation=1) |
Define the place place_name as an input of the transition transition_name with the valuation valuation. | |
void | set_output_place (const std::string &place_name, const std::string &trans_name, int valuation=1) |
Define the place place_name as an output of the transition transition_name with the valuation valuation. | |
marking * | get_initial_marking () const |
Get the initial marking of the Petri net. | |
const marking & | get_pre_condition (int t) const |
Get the precondition of t. | |
const marking & | get_post_condition (int t) const |
Get the postcondition of t. | |
std::list< int > * | firable (const marking &m) const |
Return the list of identifiers of the transitions which are firable from the marking m. | |
marking * | successor (const marking &m, int t) const |
Return the marking reached when firing the transition identified by t from the marking m. | |
std::string | format_marking (const marking &m) const |
Format the marking m as a string for printing. | |
Static Public Member Functions | |
petri_net * | parse (const char *file_name) |
Create a petri net from the file file_name. | |
Private Attributes | |
std::map< std::string, int > | name_num_p |
map between the names of the places and their integer numbers. | |
std::map< std::string, int > | name_num_t |
map between the names of the transitions and their integer numbers. | |
std::vector< std::string > | p_names |
names of the places. | |
std::vector< std::string > | t_names |
names of the transitions. | |
std::vector< marking > | pre |
pre, post and incidence matrix. | |
std::vector< marking > | post |
pre, post and incidence matrix. | |
std::vector< marking > | incidence |
pre, post and incidence matrix. | |
marking | m0 |
initial marking. | |
Friends | |
std::ostream & | operator<< (std::ostream &, const petri_net &) |
Print the Petri net in 'prod' format. |
Definition at line 35 of file petrinet.hh.
|
Construct an empty petri net.
|
|
Create a new place of name name and of initial marking initial_marking. The place name must be distinct of the existing ones and the initial marking be positive. |
|
Create a new transition of name name. The place name must be distinct of the existing ones. |
|
Return the list of identifiers of the transitions which are firable from the marking m.
The list has been allocated with |
|
Format the marking m as a string for printing.
|
|
Get the initial marking of the Petri net.
The marking has been allocated with |
|
Return the name of the place identified by p. p must be a valid identifier. |
|
Return the unique identifier of the place name. The place must exist. |
|
Get the postcondition of t. t must be a valid identifier. |
|
Get the precondition of t. t must be a valid identifier. |
|
Return the name of the transition identified by t. t must be a valid identifier. |
|
Return the unique identifier of the transition name. The place must exist. |
|
Return the number of places in the net.
|
|
Create a petri net from the file file_name. Return a null pointer in case of error. |
|
Return true if a place of name name is present in the net.
|
|
Define the place place_name as an input of the transition transition_name with the valuation valuation. The place and the transition must exist and the valuation be positive. |
|
Define the place place_name as an output of the transition transition_name with the valuation valuation. The place and the transition must exist and the valuation be positive. |
|
Return the marking reached when firing the transition identified by t from the marking m.
t must be firable from m. The marking has been allocated with |
|
Return the number of transitions in the net.
|
|
Return true if a transition of name name is present in the net.
|
|
Print the Petri net in 'prod' format.
|
|
pre, post and incidence matrix. Definition at line 156 of file petrinet.hh. |
|
initial marking. Definition at line 158 of file petrinet.hh. |
|
map between the names of the places and their integer numbers. Definition at line 148 of file petrinet.hh. |
|
map between the names of the transitions and their integer numbers. Definition at line 150 of file petrinet.hh. |
|
names of the places. Definition at line 152 of file petrinet.hh. |
|
pre, post and incidence matrix. Definition at line 156 of file petrinet.hh. |
|
pre, post and incidence matrix. Definition at line 156 of file petrinet.hh. |
|
names of the transitions. Definition at line 154 of file petrinet.hh. |