You are here

Working with external data : Scenario file : Case 3

Case 3: Providing a set of values for an array variable: values stored in the scenario file

This case applies when you have an array variable with a smallish number of elements. A typical example might be an array containing a parameter value for each of several crop types. The number of crop types is probably small (say, fewer than 20).

On the model diagram

  1. Open up the equation dialogue for the array variable that is to contain the time-series data, by double-clicking on it.
  2. Click the radio button labelled "File Parameter".
  3. Enter the expression makearray(1.0,n), changing n to the number of values in the time series, in the "Equation" edit field.
  4. 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.

When you come to run the model

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

  1. Click in the associated edit field, and type in a n pairs of values, where n is the number of submodel instances. The first value of each pair should be the number 1, 2, 3, etc. The second should be the value you wish to assign to that instance. Thus, if the submodel has four instances, and you want to assign the values 4, 5, 6 and 9 to the 4 instances, then you should type in:

    1 4 2 5 3 6 4 9

    just like that (i.e. with no brackets, commas or whatever).

  2. Click Save if you wish to save this setting (along with any others), and specify a file to save it in.
  3. Click OK when you wish to proceed with the simulation.

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