How to Draw State Space Tree
Several tools from the state space tools can be used to draw parts of a state space. State spaces can only be drawn after entering the state space tool and calculating the state space.
Display state space node
To display a particular state space node, apply the Display State Space Node tool
to a page. An option for the tool determines which node will be drawn. If the node does not already exist on the page then the node will be displayed. If the node is already on the page, then nothing will be added to the page.
The first number is the number of the node. In this example the node number is one. The two numbers at the bottom of the node are the number of predecessors and number of successors that have been calculated. In this case 5 predecessors and 5 successors have been calculated.
Display successors/predecessors
The successors of a state space node can be drawn by applying the Display Successors tool to a state space node.
If any of the successor nodes already exist on the page, then they will not be displayed again.
Node and arc descriptors
Clicking on the small triangle in the node will display a node descriptor which shows the marking that is associated with the node.
The node above corresponds to the initial marking of the Dining Philosophers example.
A node descriptor can be hidden again either by clicking on the small triangle of its parent node, by clicking on the descriptor itself, or by applying the Toggle Descriptor tool to it.
Similarly, clicking on a state space arc will display an arc descriptor which describes the binding element associated with the arc.
An arc descriptor can be hidden again using techniques similar to hiding a node descriptor.
If the cursor hovers over a node descriptor or an arc descriptor, the element which the descriptor belongs to will be highlighted.
Displaying nodes and arcs from lists
The Display Partial State Space tool
is used to draw arbitrary groups of nodes or arcs. The tool must be applied to an auxiliary text that contains a CPN ML expression that will evaluate to either a list of node numbers or a list of arc numbers. The CPN ML expression can be very simple or more complex.
Here are a couple of examples of CPN ML expressions that will return lists of nodes for the example net for the Dining Philosophers example.
Applying the tool to the expression [1,2,3]
will result in nodes 1, 2, and 3 being drawn (if they are not already on the page). If the tool is applied to the other CPN ML expression in the figure, the expression will first be evaluated, and it will return a list of nodes corresponding to markings in which the marking of the place Eat
contains the multiset 1`ph(1)
. All of the nodes in the list will then be drawn.
If the tool is applied to a CPN ML expression that contains syntax errors or that does not return a list of nodes or arcs, then an error message will be shown next to a status bubble. Here is the error message after the tool was applied to the expression [1,2,3
which is missing the right bracket.
Active and inactive state space elements
State space nodes and arcs can only be drawn after you enter the state space tool and calculated the state space. State space elements that are drawn after entering the state space tool are said to be active. This means that it is possible to draw successors and predecessors for active nodes. When drawing state space fragments, any active state space elements on the same page will be reused.
If you save, close, and reopen a model with state space elements, then these elements are inactive because there is no longer any connection between the graphical representation of the state space elements and a state space in the state space tool.
The default color for active state space elements is black, and the default color for inactive state space elements is gray. In the figure below, the state space elements on the left are inactive.
It is not possible to draw successors or predecessors for inactive nodes, and inactive state space elements will not be reused if the state space tool is entered. The marking menu for an inactive state space node does not contain entries for drawing predecessors or successors.
If any change is made to the CPN model or the declarations after entering the state space tool, then there are inconsistencies between the calculated state space and the CPN model. As a result, the state space tool will be left, and any active state space elements will become inactive. Attempting to draw state space elements, may result in an error status bubble:
Layout of state space elements
All state space elements can be moved by dragging them. The Style tools can be used to change graphical attributes such as line color and line width.
If an active state space element with the default color becomes inactive, the color of the element will automatically be changed to the default color for inactive state space elements when the element becomes inactive. If the color of an active state space element has been changed to something other than the default color, then the color of the element will not be changed when the element becomes inactive.
Related pages
Verification, drawing state spaces with Graphviz
Source: http://cpntools.org/2018/01/15/draw-state-spaces-with-cpn-tools/
0 Response to "How to Draw State Space Tree"
Post a Comment