1 #ifndef __DIADES__PETRI__REACHABILITYGRAPH__HH 2 #define __DIADES__PETRI__REACHABILITYGRAPH__HH 6 #include <unordered_map> 27 static string typeName() {
return "Diades::Petri::ReachabilityGraph"; }
54 _marking.init(_graph);
55 _transLabel.init(_graph);
68 require(Exception,state.valid() && &state.owner()==&_graph,
"getMarking: invalid state");
69 return _marking[state];
78 require(Exception,state.valid() && &state.owner()==&_graph,
"addMarking: invalid state");
79 require(Exception,!mark.empty(),
"addMarking: empty label");
80 _marking[state].insert(mark);
87 const string &
getLabel(RTransition transition)
89 require(Exception,transition.valid() && &transition.owner()==&_graph,
"getLabel: invalid transition");
90 return _transLabel[transition];
103 return _graph.numberOfNodes();
113 return _graph.numberOfEdges();
123 return _graph.empty();
132 RState
target(
const RTransition & trans)
const 134 return _graph.target(trans);
143 RState
source(
const RTransition & trans)
const 145 return _graph.source(trans);
158 return _graph.nodeBegin();
167 return _graph.nodeEnd();
176 return _graph.nodeBegin();
185 return _graph.nodeEnd();
195 return _graph.edgeBegin();
205 return _graph.edgeEnd();
215 return _graph.edgeBegin();
225 return _graph.edgeEnd();
258 return _graph.outEdgeBegin(state);
268 return _graph.outEdgeEnd(state);
279 return _graph.inEdgeBegin(state);
289 return _graph.inEdgeEnd(state);
307 RState getState(
unsigned id);
317 RTransition getTrans(RState source,RState target,
const string & label);
327 require(Exception, state.valid() && &state.owner() == &graph(),
"getId: invalid state");
339 require(Exception, state.valid() && &state.owner() == &graph(),
"setInitial: invalid state");
357 bool importTinaGraph(
const string & fileAut,
const string & fileVrb);
365 virtual bool exportGraphToDot(
const string & fileDot);
374 bool importTinaAut(
const string & fileAut);
380 virtual bool importTinaVrb(
const string & fileVrb);
Diades::Graph::Node RState
void addMarking(RState state, const string &mark)
Diades::Graph::InEdgeIterator InRTransitionIterator
InRTransitionIterator outTransBegin(const RState &state)
ReachabilityGraph()
state dictionary
Diades::Utils::Exception< ReachabilityGraph > Exception
GraphIterator< Edge > EdgeIterator
RState source(const RTransition &trans) const
RTransitionIterator transEnd()
Diades::Graph::Edge RTransition
const string & getLabel(RTransition transition)
InRTransitionIterator outTransEnd(const RState &state)
RStateIterator stateEnd()
RState _initial
the underlying graph
RStateIterator stateBegin()
unsigned getId(RState state) const
Ids _id
the label associated to each RTransition of the
Diades::Graph::NodeMap< set< string > > Marking
RStateIterator stateEnd() const
Diades::Graph::NodeIterator RStateIterator
GraphIterator< Node > NodeIterator
const set< string > & getMarking(RState state)
#define require(Exception, expr, message)
Namespace of the Diades project.
Diades::Graph::EdgeMap< string > TransitionLabel
virtual ~ReachabilityGraph()
RTransitionIterator transEnd() const
StateDictionnary _dictionary
the ids associated to the states
TransitionLabel _transLabel
the marking associated to each RState of the graph
list< Edge >::iterator OutEdgeIterator
RTransitionIterator transBegin() const
boost::adjacency_list Graph
RTransitionIterator transBegin()
const Graph::Graph & graph() const
RStateIterator stateBegin() const
Diades::Graph::EdgeIterator RTransitionIterator
OutRTransitionIterator outTransBegin(const RState &state) const
Diades::Graph::Graph RGraph
list< Edge >::iterator InEdgeIterator
virtual void addTimeConstraint(RState state, const string &transitionName, const Diades::Utils::Interval &interval)
RState target(const RTransition &trans) const
unordered_map< unsigned, RState > StateDictionnary
unsigned numberOfTransitions() const
void setInitial(RState state)
unsigned numberOfStates() const
Diades::Graph::NodeMap< unsigned > Ids
OutRTransitionIterator outTransEnd(const RState &state) const
Marking _marking
the initial state
RState initialState() const
Diades::Graph::OutEdgeIterator OutRTransitionIterator