8 #ifndef __DIADES__PETRI__ZSL__HH__ 9 #define __DIADES__PETRI__ZSL__HH__ 27 class ZslInvalid :
public runtime_error,
public domain_error {
32 ZslInvalid(
const string& whatArg) : runtime_error(whatArg), domain_error(whatArg){
33 cerr <<
"EXCEPTION Zsl -> " << whatArg << endl;
60 Zsl():_value(0),_id(0),_place(),_next(0){}
71 Zsl(
Place p,
int value,
const Zsl * zsl,
unsigned id ):_value(value), _id(id), _place(p), _next(zsl) {
91 unsigned id()
const {
return _id; }
97 int value()
const {
return _value; }
117 return (
id() > 0) && (place().valid()) && (value()!=0) && ( (
next() == 0) || (
next()->valid()));
142 vector< vector< unordered_map<unsigned, Zsl *> > >
_negTable;
143 vector< vector< unordered_map<unsigned, Zsl *> > >
_posTable;
153 _negTable(net.numberOfPlaces()+1),
154 _posTable(net.numberOfPlaces()+1),
171 const Zsl * getZsl(
Place place,
int value,
const Zsl * zsl);
178 const Zsl *
getZsl(
unsigned id) {
if(
id >= _table.size()) {
return 0; }
return _table[id]; }
188 str << owner()->labelOfPlace(zsl->
place()) <<
"," << zsl->
value() <<
" -> ";
195 str << printZsl(zsl->
next());
216 const Zsl * addZsl(
const Zsl * zsl,
Place p,
int value);
223 void printDot(
const string & fileName)
const;
Diades::Graph::Node Place
Zsl(Place p, int value, const Zsl *zsl, unsigned id)
Transition & next(const Net &netSystem, Net &completePrefix)
ZslInvalid(const string &whatArg)
const Zsl * getZsl(unsigned id)
string printZsl(const Zsl *zsl) const
const Net * owner() const
ZslFactory(const Net &net)
#define require(Exception, expr, message)
Namespace of the Diades project.
void printDot(ostream &os, const T &value)
std::ostream & operator<<(std::ostream &os, const Identifier &identifier)
vector< vector< unordered_map< unsigned, Zsl * > > > _negTable
vector< vector< unordered_map< unsigned, Zsl * > > > _posTable