You are here

Working with external data : Scenario file : Case 4

Case 4: Providing a set of values for a variable in a fixed-membership multiple-instance submodel: values stored in a separate file

This case applies when you have a variable in a fixed-membership submodel which has a largish number of instances. A typical example might be a submodel whose job is to hold the values for some attributes (e.g. elevation, soil type) of each of a large number of spatial patches.

On the model diagram

  1. Open up the equation dialogue for the variable, by double-clicking on it.
  2. Click the radio button labelled "File Parameter".
  3. Close the equation dialogue.

Note that the variable now appears with a tail, showing the change in its status. Note also that it is black, even though you have not supplied a value for it.

Check or prepare the data file

The data file should be in standard csv (comma-separated value) format. It should have one header line, consisting of one or more labels, separated by commas, followed by n lines. Each line should have the same number of values as there are labels in the header line, and again the values should be separated by commas. The number (n) of data lines should be at least as great as the number of instances for the submodel. One column should contain the values required for the variable in the model.

When you come to run the model

Simile will produce a File Parameter dialogue window, and this will contain an entry for this variable.

  1. Click on the Read table button for this variable.
  2. Select the "data in columns" tab of the table data dialogue.
  3. Browse through your file system to find the .csv file containing the data values.
    You will now see a window listing the columns in the table, by the label associated with each column.
  4. Double-click on the label corresponding to the column of values you wish to assign to the variable.
  5. Click on the OK button.
  6. Click Save if you wish to save this setting (along with any others), and specify a file to save it in.
  7. Click OK when you wish to proceed with the simulation.

In: Contents >> Working with external data >> Using scenario files