convert(pnmodel, rgmodel = none, parent = none) : if rgmodel = none : rgmodel = createRG() currentState = getCurrentState(pnmodel) candidates[] = getCandidates(pnmodel, currentState) node = createNode(rgmodel, currentState, parent) for each newState in candidates : v = visited(rgmodel, newState) if not v : v = convert(pnmodel, rgmodel, currentState) else connect(rgmodel, node, v) return v |
Class/property | Description |
ATOM3 | The main class of each model. It
contains all the semantic / graphical objects of an instance of the
model. We must instantiate this class to get a valid separate window for
the resulting Reachability Graph. |
ATOM3.ASGroot |
It contains the model itself.The PNlink class uses one as a container for the input model (PetriNets) and another for the output model (ReachGraph) |
asgroot.listNodes.get('TypeObject') |
It can be used to get a list of
items of type TypeObject from the model. PNlink uses this call to get a list
of places from the Petri Net (to get the current state), or to navigate
the transitions. |
o.in_connections_ |
It is used to traverse / add input connections for a given node. PNlink uses it to get the list of enabled transitions in the PetriNet |
o.out_connections_ |
It is used to managet the output
connections for a given node. PNlink uses
it to pass tokens from the input to the output of a given place |
o.property.getValue() /
o.property.setValue() |
It is used to get / set a
property of a given object. The object can be each of the items of the
corresponding meta-models. PNlink
uses it to get / set the values of the semantic objects, for instance,
when reading the number of tokens of a place or when creating new nodes
for the reachability graph. |
o.graphObject_ |
This contains the graphical form
of a given semantic object. It must
be used to alter the visual form of an object. PNlink uses it to add nodes to the
reachability graph. |
atom3.drawConnections((parent,child)) |
This method can be used to create a connection of the appropiate type from one node to other of the graph. PNlink uses it to connect new generated nodes in the reachability graph. |
from PNlink import PNlink l=PNlink() l.convert ( self ) |