Model flow
8 operators. Inputs marked required must be connected or given; the others have defaults.
control.each#
Run the body once for each element of a collection: the layers of a stack (a folder of rasters, the bands of a file), the items of a series, the rows of a table (each a table of one row), the features of vectors (each alone) or the values of a list (species, years, file names). Inside, @item is the element, @index its place (1..) and @name its name (a layer's, a feature's name or the first column's value, the value of a list); the other inputs are @name as a group's. Each collected reference gathers what every element gave: maps a stack of the elements' names, tables one table (a column for the element), other values a series.
| Input | Type | What it is |
|---|---|---|
overrequired | any | the collection: a stack, a series, a table, vectors or a list |
Takes any other inputs by name (any).
control.group#
Run the body once: its inputs (any names) are @name inside, its outputs the references of body.outputs. Submodels become groups.
Takes any other inputs by name (any).
control.repeat#
Run the body once per step (1..times): @step is the step, each carried value starts as the input of its name and takes the value of its reference at the end of every step, each collected reference gives a series with its value at every step. The outputs are the carried values after the last step and the collected series.
| Input | Type | What it is |
|---|---|---|
timesrequired | integer | how many steps |
control.submodel#
Another model used as one node: its inputs are the node's inputs of the same names (its value inputs keep their values when not given; its files become inputs of this model), its outputs the node's. Expanded into a control.group before the model runs.
| Setting | Type | What it is |
|---|---|---|
pathrequired | text | the model file, relative to this model's folder |
Takes any other inputs by name (any).
control.switch#
Run one branch, chosen by the value of case: its body holds a group per branch, the one whose id is the case (maxent, rf, glm; case_1 for the number 1, true or false for a yes or no) runs, or the group otherwise when none is; the others do not. Every branch gives the same outputs, the switch's. Its other inputs are @name inside, as a group's. With a parameter or a scenario giving the case, the choice of a method is a scenario to compare.
| Input | Type | What it is |
|---|---|---|
caserequired | any | the branch to run: its id (a text, a number, true or false) |
| Output | Type | What it is |
|---|---|---|
branch | text | the id of the branch that ran |
Takes any other inputs by name (any).
plugin.wasm#
A map computed cell by cell by a WebAssembly function (a plugin written in any language), in a sandbox: its arguments are the node's inputs (maps or numbers, in the order of args or by name) as f64, its result the cell's value.
| Output | Type | What it is |
|---|---|---|
map | map | the map computed |
| Setting | Type | What it is |
|---|---|---|
pathrequired | text | the module (.wasm or .wat), relative to the model's folder |
function | text | the function called for every cell (default: cell) |
args | any | the inputs in the order of the function's parameters |
Takes any other inputs by name (any).
rng.numpy#
numpy's legacy random number generator after numpy.random.seed(seed) (Mersenne-Twister), as MOLUSCE draws: carry it along a loop so that every iteration draws after the previous one.
| Input | Type | What it is |
|---|---|---|
seedrequired | integer | the seed (taken modulo 2^32) |
| Output | Type | What it is |
|---|---|---|
rng | rng | the generator |
rng.r#
R's random number generator after set.seed(seed) (Mersenne-Twister), as lulcc and landschaft use it: carry it along a loop so that every step draws after the previous one.
| Input | Type | What it is |
|---|---|---|
seedrequired | integer | the seed |
| Output | Type | What it is |
|---|---|---|
rng | rng | the generator |