Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

marking_graph_visitor Class Reference

Implementation of a spot::tgba_reachable_iterator_breadth_first printing all reachable markings of a pn_tgba as well as the firings. More...

Inheritance diagram for marking_graph_visitor:

Inheritance graph
[legend]
Collaboration diagram for marking_graph_visitor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 marking_graph_visitor (const pn_tgba *n)
 Construct a visitor for the Petri net associated to n.
void process_state (const spot::state *s, int n, spot::tgba_succ_iterator *si)
 Called by spot::tgba_reachable_iterator_breadth_first::run() to process a state. The corresponding marking is printed.
void process_link (int in, int out, const spot::tgba_succ_iterator *si)
 Called by spot::tgba_reachable_iterator_breadth_first::run() to process a fired transition. The corresponding edge is printed.

Private Attributes

const pn_tgbanet
 Point to the visited pn_tgba.

Detailed Description

Implementation of a spot::tgba_reachable_iterator_breadth_first printing all reachable markings of a pn_tgba as well as the firings.

Definition at line 33 of file graphvisitor.hh.


Constructor & Destructor Documentation

marking_graph_visitor::marking_graph_visitor const pn_tgba n  ) 
 

Construct a visitor for the Petri net associated to n.

The pointer n is supposed to be valid for the whole life of the constructed instance.


Member Function Documentation

void marking_graph_visitor::process_link int  in,
int  out,
const spot::tgba_succ_iterator si
 

Called by spot::tgba_reachable_iterator_breadth_first::run() to process a fired transition. The corresponding edge is printed.

Parameters:
in The source state number.
out The destination state number.
si The pn_succ_iterator positionned on the current transition.
void marking_graph_visitor::process_link(int in, int out, const spot::tgba_succ_iterator* si) {
  const pn_succ_iterator* i = dynamic_cast<const pn_succ_iterator*>(si);
  assert(i);
  std::cout << "\tfiring " << i->format_transition() << " from ";
  std::cout << in << " leads to " << out << std::endl;
} //

void marking_graph_visitor::process_state const spot::state s,
int  n,
spot::tgba_succ_iterator si
 

Called by spot::tgba_reachable_iterator_breadth_first::run() to process a state. The corresponding marking is printed.

Parameters:
s The current state.
n An unique number assigned to s.
si The pn_succ_iterator computed for s.
void marking_graph_visitor::process_state(const spot::state* s, int n, spot::tgba_succ_iterator* si) {
  std::cout << "marking " << n << " : " << net->format_state(s) << std::endl;
} //


Member Data Documentation

const pn_tgba* marking_graph_visitor::net [private]
 

Point to the visited pn_tgba.

Definition at line 73 of file graphvisitor.hh.


The documentation for this class was generated from the following file:
Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Jan 31 15:17:14 2005 for checkpn by doxygen 1.4.0