Working with external data : Overview

Overview of the scenario file mechanism

A simulation model may require various types of input data. These can include:

  • values for parameters
  • values for site conditions: e.g. soil type
  • values for time-varying inputs (exogenous variables, such as temperature)
  • initial values for compartments (state variables)
  • values for management decisions: e.g. harvesting rate

For each of these, there may be a need to enter a set of values. For example, a compartment of a site-condition variable may be in a multiple-instance submodel and so (if you do not want all instances to have the same value), you will need to provide a different value for each instance.

We have seen a number of ways in which numerical data can be included in the model, in the section on equations. These include:

  • Including numerical constants in the text of equations
  • Sampling from a random distribution
  • Including a sketch graph or table function

...and we have also seen how fixed or variable parameters can be set when running the model, by:

However, none of these mechanisms satisfies a common modelling requirement: that a set of data values be provided for the model when the model is run. We need to be able to store the set of values in one or more files, and specify which set is to be used for a particular run. This is where the File Parameter mechanism comes in.

Design of the Simile File Parameter mechanism

The File Parameter mechanism was designed to meet the following design goals:

  • A model can be complete even though it is lacking data values needed to simulate its behaviour. By complete, I mean that Simile can proceed to build the model: i.e. generate the Tcl or C++ program. Simulating the behaviour of the model requires that the built model is associated with one or more files ("scenario files") at run time. The job of these files is to tell Simile how to obtain values for variables in the model that have not had a value provided.
  • One model can be associated with several scenario files for a single run, each file providing values for a different subset of variables.
  • Different runs of the model can be associated with a different set of scenario files (thus allowing the modeller to quickly change data inputs for a model).
  • The scenario file may either contain actual data values (e.g. for a single-valued parameter), or may contain a reference to a file in a standard format containing tabulated data. This means that a single (potentially very large) datafile can be referenced by several scenario files, thus avoiding the need to duplicate the same large volumes of data in a number of scenario files.

In: Contents >> Working with external data