10.4 Variables Definitions View
The Variable Definitions View is used to manage variable definitions at different nodes within the tree. Variable definitions are created at specific nodes, so the Variable Definitions View is a node-level view. The contents of the view reflect the context of the currently selected node. If you have not selected a node for a View which is node specific, a warning will appear in the View.
To open the Variable Definitions View:
-
Choose Views > Variable Definitions from the toolbar.
Below is an image of the Variable Definitions View from the Get Started tutorial example model CE-MarkovModel with the root node (labelled "Choose") selected.
The main grid contains a grouped list of variable definitions. Groups can be collapsed and expanded. Two of the groups are:
-
Defined: This contains variable definitions at the selected node.
-
Undefined: This contains variables that are not defined at the selected node.
As previously mentioned, the Variable Definitions View is a node-level view. If we select a different node, specifically the node "Tx 1", we see the following:
At the Tx 1 node, only two variables are Defined @ Tx 1 - cLocal and pLocalToDead - while others are listed in the Undefined @ Tx 1 group.
In addition, you can now see the Inherited group that contains variable definitions that are "inherited" from nodes to the left of the selected node. The Tx 1 node's immediate parent node is the Choose node, which has most of the other variable definitions.
Variable Definitions View toolbar
Similar to the toolbar for the Variables View, the toolbar for the Variable Definitions View has a few common tools.
The functions associated with the icons are presented below and each function is described in subsequent sections.
-
Add Variable Definition
-
Edit Variable Definition
-
Delete Variable Definition
-
Cut Variable Definition
-
Copy Variable Definition
-
Paste Variable Definition
-
Turn Highlight On/Off
-
Filter variables (Clear)
Add Variable
This function is used to add a new variable to the model. This function is the same as the function from the Variables View.
Adding variable definitions is done within the views grid.
Edit Variable Definition
This function is used to edit the selected variable definition. Only one variable definition can be selected.
The Define Variable Dialog will open with the selected variable definition displayed.
Edit the variable definition in the Build Expression element and click OK to save the changes.
Note that you can select and edit an Inherited variable definition as well. This will edit the variable definition at the node where the definition currently exists.
Delete Variable Definition
This function is used to delete one or more selected variable definitions from the tree. Deleting variable definition(s) will not delete the variable(s) from the tree.
Only definitions at the currently selected node can be deleted.
To delete variable definitions in the Variable Definitions View:
-
Select one or more variable definitions for the currently selected node.
-
Click the "X" delete toolbar button.
Edit Variable Definitions in grid
Variable definitions can also be added or edited directly in the Variable Definition View's grid.
For example, if you enter a new definition into one of the Undefined variables, a new definition is created for that variable at the selected node.
Below is an image of the grid contents before adding a definition.
Next, a new definition for the variable cLocal1 is typed into the grid in the definition field next to cLocal1.
After the new variable definition is added, it can be seen in the Defined @ Tx 1 group.
Similarly, you can type a new definition into the Defined group to replace the existing definition.
Cut/Copy/Paste Variable Definitions
You can cut/copy variable definitions from one node and paste them to another.
To cut a variable definition in the Variable Definitions View:
-
Select the variable definition.
-
Select Cut from the tool bar.
To copy a variable definition in the Variable Definitions View:
-
Select the variable definition.
-
Select Copy from the tool bar.
To paste a variable definition:
-
Select the destination node in the Tree Diagram Editor.
-
This will change the Variable Definitions to be relative to the new node.
-
Select Paste from the tool bar.
Filter
The Filter Text field allows you to filter the list of variables to show only variable names that match the Filter Text. (It is identical to the Filter Text in the Variables View). For example:
-
Enter a single letter, and all the variables which start with this letter will be shown. If you use a naming convention then you can filter by "c" and you would see all the variables such as cost_LocalCancer, cLocal etc.
-
Enter an asterisk before the expression to look for text in the middle of the variable name rather than the front. For example, if you entered "*local" into the Filter Text, the variables cost_LocalCancer, cLocal and p_LocalToMets would be shown.