STEM help / Editor skills

4.14.3 Linking default values for model elements

If you have a number of elements which have several common attributes – e.g., two Resources with identical physical parameters, one with higher Capital and lower Maintenance costs – it may be advantageous to link the elements so that one of them provides default values, which the other element overrides selectively:

  1. Enter the various data for Resource 1.
  2. Select Defaults from the icon menu for Resource 2. The Supply/Resources dialog is displayed, with one button representing each Resource in the model.
  3. Press <F2> or click in the formula bar to start editing a formula for Resource 2.
  4. Click on the button for Resource 1, or press <F2> again and use the cursor keys, to pick up the internal reference "Resource 1" – see 4.12.3 Internal references and reference mode.
  5. Press <Enter> or click the button to complete the formula. If you had previously entered any values ‘inside’ Resource 2, the Editor will ask whether these should be replaced by the new default values from Resource 1. If not, they will persist as set values, overriding the new defaults.

Figure 1: Linking elements in the Resource Defaults table

Note: You can achieve this effect directly by dragging between the buttons in this dialog, or between the corresponding icons. Alternatively, you can paste a link in the dialog or between the icons – see 4.15 Copying and pasting data.

  1. Select Tables/Resource/Costs from the Data menu, in order to compare the various data for Resource 2. The two elements are now linked so that the values entered for Resource 1 have become the default values for Resource 2, and a Reference link is drawn between the two icons corresponding to Resources 1 and 2 respectively. If you now modify the values in Resource 1, you will notice that the corresponding, unset fields in Resource 2 update automatically to the same values. You will notice that the unset fields in Resource 2 are shown in either green or blue, reflecting the fact that they depend on Resource 1 – see 4.14.8 Colours for linked defaults.
  2. Now override Resource 2’s costs as desired. Once you have set a field in Resource 2, it will remain unchanged if the corresponding value in Resource 1 changes.

Figure 2: Overriding defaults in a tabular dialog

Note: Now when you unset a field in Resource 2, it will revert back to the corresponding value in Resource 1.

 

© Implied Logic Limited