Dynamic Model Configuration (.sel)
Dynamic model configuration files (.sel) are the primary way to create landscape dynamics models in SELES. They define the spatio-temporal state space: the set of spatial and global variables and constants, combined with a set of landscape events. The state at the start of a simulation is called the initial condition.
4.1 Note on Constants and Variables
-
Global constants are static, named floating-point values — they cannot be modified during a simulation. They improve readability and allow values to be changed in one place. Constants can be single values or loaded from files as 1-D or 2-D arrays.
-
Global variables are like constants but may be modified by landscape events, providing dynamic non-spatial state. They can serve as model parameters, output statistics, or communication channels between events. Like global constants, they can be loaded from files (the file defines the initial condition, which may then change during a simulation).
-
Spatial constants do not have a separate initial-conditions raster view — they are assumed not to change over time. SELES does not technically prevent a landscape event from modifying a spatial constant, but doing so should be avoided (changes persist until the raster is reloaded).
4.2 Dynamic Model Specification
The first line of every .sel file declares the model type:
SELES MODEL
This is followed by an optional time units block, then any combination of the following named blocks in any order (with the constraint that a block may only reference components defined in earlier blocks):
| Block | Purpose |
|---|---|
MODEL TIME UNITS | Define the base time unit, meta-unit, and default simulation length |
LANDSCAPE EVENTS: | Specify which .lse files to include |
EXTERNAL VARIABLES: | Import script variables from scenario scripts |
LEGENDS: | Define or load legend files |
SUBMODEL: | Load a subordinate .sel file |
GLOBAL CONSTANTS: | Define named constant values |
GLOBAL VARIABLES: | Define global variable names and initial values |
MACROS: | Load macro function arrays from .ce files |
SPATIAL CONSTANTS: | Define static raster layers |
SPATIAL VARIABLES: | Define dynamic raster layers and their initial conditions |
OUTPUT MODEL FREQUENCY: | Schedule periodic raster output during a simulation |
OUTPUT FREQUENCY: | Set the display refresh rate |
Keywords are case-insensitive. Variable names are case-specific.
4.3 Model Time Units
TIME UNITS: <BaseUnit> <MetaUnit> #Factor #DefaultHorizon
Defines the name of the base time unit, the meta-unit, the conversion factor, and the default simulation length. This only affects the user interface display. Example:
Time Units: Year Century 100 250
4.4 Landscape Events
LANDSCAPE EVENTS:
<FileName.lse> { %UseType }
Lists the landscape event files (.lse) to include in the model. Events are initiated in the order listed. The optional %UseType flag sets whether the event is loaded as enabled (ON, default) or disabled (OFF) — this can be overridden in a scenario script.
Example:
Landscape Events:
Wildfire.lse
Logging.lse
4.5 External Script Variables
Script variables defined in a scenario script (.scn) can be imported into a .sel file. They are replaced by their values when the .sel file is loaded — a literal substitution, so they can be used anywhere text or numeric values appear (including as part of a label).
EXTERNAL VARIABLES:
$<ScriptVariable>$ = "Text"
$<ScriptVariable>$
The first form specifies a default value used if the scenario did not define the variable. The second form (no default) causes an error if the variable is undefined when the .sel is loaded.
Common uses:
- Making an input file name a parameter (e.g.
$AACFile$→ different.txtfor different scenarios). - Making a folder path a parameter (e.g.
$legends$→ different legend set for different data).
Example:
External Variables:
$studyArea$ = MoriceTSA
$legends$ = ..\..\$studyArea$\gisData\grids
$AACFile$ = AAC_TSR4
4.6 Legends
A legend defines a set of related named constants and a lookup vector for label output. Once loaded, legend values are equivalent to global constants. All legend values must be unique.
LEGENDS:
<LegendName> = {#:<Label>, …, #:<Label>}
<LegendName> = <FileName>
| Form | Meaning |
|---|---|
| Inline list | Number–label pairs defining the legend directly |
| File name | Load from (a) a legend file with # : Label pairs, or (b) a GeoTiff with embedded category table |
See Legend Files for the legend file format.
4.7 Global Constants
GLOBAL CONSTANTS:
<ConstantName> = Expr
<ConstantName> = Expr, …, Expr
<ConstantName> = <FileName>
<ConstantName> = <FileName> SEQUENCED
| Form | Meaning |
|---|---|
= Expr | Single constant value |
= Expr, …, Expr | Vector of constant values |
= <FileName> | Load from tab-separated file. First column = row index; two columns = 1-D array; more columns = 2-D array. |
= <FileName> SEQUENCED | Load unindexed values; indices start at 0 |
4.8 Global Variables
GLOBAL VARIABLES:
<VariableName> = Expr
<VariableName> = Expr, …, Expr
<VariableName>[Expr] = <Value>
<VariableName>[Expr, Expr] = <Value>
<VariableName> = <FileName>
<VariableName> = <FileName> SEQUENCED
| Form | Meaning |
|---|---|
= Expr | Single variable with initial value |
= Expr, …, Expr | Vector with explicit initial values |
[Expr] = <Value> | Vector with common initial value |
[Expr, Expr] = <Value> | 2-D array with common initial value |
= <FileName> | Load initial values from file |
= <FileName> SEQUENCED | Load unindexed initial values |
Single-value global variables defined here appear in the simulation control dialog unless followed by the OFF keyword.
Global variables shared between landscape events must be defined here. Global variables in landscape events that are not defined here cannot be shared, will not appear in the UI, and have an undefined initial value (declare them as LOCAL variables instead).
Accumulate keyword: Place Accumulate to the right of a definition to specify that the variable is only initialised at the start of the first run in a multi-replicate simulation, and accumulates across runs rather than resetting.
4.9 Macros
MACROS:
<MacroName> = <FileName.ce>
Loads a set of function expressions from a .ce file. A macro is used in a landscape event like a 1-D array index lookup — but instead of returning a stored value, it executes the function expression at that index in the current spatio-temporal context. Macros allow models to be parameterised with functions, or allow a function to be used in multiple places in a model. See Macro Files (.ce).
4.10 Spatial Constants
SPATIAL CONSTANTS:
<VariableName> = <ViewName>
<VariableName>
<VariableName> = [ViewName, …, ViewName]
Maps spatial constant names to raster views. The raster view must already exist (e.g. loaded by the scenario script).
- If
= <ViewName>is omitted, the variable name is assumed to match the view name. - The third form defines a static raster vector (array of rasters).
4.11 Spatial Variables
SPATIAL VARIABLES:
<VariableName> = <ViewName> [#MaxValue]
<VariableName> = <ViewName> [#MinValue, #MaxValue]
<VariableName> = <ViewName> [#Min, #Max] <- #initialValue
<VariableName> = <ViewName> [#Min, #Max] <- <InitViewName>
Maps spatial variable names to raster views and specifies value bounds and initial conditions.
| Form | Initial condition |
|---|---|
| Bounds only | All cells initialised to 0 |
<- #initialValue | All cells set to the given number |
<- <InitViewName> | Taken from the named raster view |
If the output view does not exist, it is created automatically. As with spatial constants, = <ViewName> can be omitted if the view name matches the variable name.
A raster vector is specified by replacing the view name with a list: [ViewName, …, ViewName]. If initial condition views are provided, the count of input and output views must match. Bounds cannot be specified alongside a raster vector definition (use separate single-value definitions for bounds).
The Accumulate keyword has the same meaning as for global variables.
4.12 Submodel
SUBMODEL: <SubmodelFileName.sel>
Loads a subordinate .sel file, including its state space in the main model. Any number of submodels may be loaded. A submodel file has the same format as a .sel file, but must not include the SELES MODEL declaration or a time units block.
4.13 Dynamic Raster Output
Schedules periodic output of a raster layer to file during a simulation (producing a raster time-series).
OUTPUT MODEL FREQUENCY:
<RasterName> FREQ: Expr FILE: <FileNameBase> TYPE: <OutputType>
<RasterName> FREQ: Expr DIRECTORY: <DirectoryName> TYPE: <OutputType>
Output files are named by appending the simulation run number and output sequence number to the base name. For example, the 3rd output during run 2 for base name Species creates a file named Species_2_3.
Valid OutputType values: GEOTIFF, GRASS, GRASS COMPRESSED, GRASS ASCII, ARC ASCII, ERDAS8, ERDAS16.
The frequency expression is limited to numeric values, constants, or simple global variable names.
4.14 Refresh Rate Commands
OUTPUT FREQUENCY: <#days>
Sets the default display refresh rate for dynamic raster views. Can be overridden via the simulation control dialog.
4.15 Configuration Expressions
Configuration expressions are a restricted form of expression used to define values in the .sel file based on arithmetic combinations of numbers and previously defined constants or variables:
#Number
<Constant>
<Variable>
(Expr)
Expr + Expr
Expr - Expr
Expr * Expr
Expr / Expr
Expr ^ Expr (exponentiation)
Expr % Expr (modulo)