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

marking Class Reference

Implementation of an ordinary Petri net state (an int vector). More...

Collaboration diagram for marking:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 marking (const marking &m)
 marking (int size=0)
 Construct a null marking of size size.
void insert (int p, int n)
 Set n tokens in place p.
void append (int n)
 Set n tokens in a new place. This place takes size() as index .
int get (int p) const
 Return the number of tokens in place p.
int size () const
 Return the number of places on which the marking is defined.
bool operator<= (const marking &m) const
 Return true if each place of the current marking contains as many or less tokens than m and false otherwise.
bool operator>= (const marking &m) const
 Return true if each place of the current marking contains as many or more tokens than m and false otherwise.
void plus (const marking &m, marking &res) const
 res recieves *this + m.
void minus (const marking &m, marking &res) const
 res recieves *this - m.
void print (std::ostream &os) const
 Basic printing method (as a vector of integers).
const std::vector< int > & get_vector () const
 Return the std::vector<int> coding the marking.

Protected Attributes

std::vector< int > ma

Detailed Description

Implementation of an ordinary Petri net state (an int vector).

Definition at line 30 of file marking.hh.


Constructor & Destructor Documentation

marking::marking const marking m  ) 
 

marking::marking int  size = 0  ) 
 

Construct a null marking of size size.


Member Function Documentation

void marking::append int  n  ) 
 

Set n tokens in a new place. This place takes size() as index .

int marking::get int  p  )  const
 

Return the number of tokens in place p.

Precondition:
p must be a valid place identifier.

const std::vector<int>& marking::get_vector  )  const
 

Return the std::vector<int> coding the marking.

void marking::insert int  p,
int  n
 

Set n tokens in place p.

void marking::minus const marking m,
marking res
const
 

res recieves *this - m.

Precondition:
*this must be equal or greater than m.

bool marking::operator<= const marking m  )  const
 

Return true if each place of the current marking contains as many or less tokens than m and false otherwise.

bool marking::operator>= const marking m  )  const
 

Return true if each place of the current marking contains as many or more tokens than m and false otherwise.

void marking::plus const marking m,
marking res
const
 

res recieves *this + m.

void marking::print std::ostream &  os  )  const
 

Basic printing method (as a vector of integers).

int marking::size  )  const
 

Return the number of places on which the marking is defined.


Member Data Documentation

std::vector<int> marking::ma [protected]
 

Definition at line 74 of file marking.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:13 2005 for checkpn by doxygen 1.4.0