Skip to content

Movement Gradient Based Movements

Ricardo Oliveros Ramos edited this page Jun 11, 2026 · 1 revision

Discrete Gradient Movement Model

The discrete gradient movement model is activated when the movement.distribution.method.spX is set to gradient

Rationale

This movement formulation provides a spatially explicit, probabilistic approach that combines directed displacement towards areas of higher local suitability with a random walk that allows diffusion and exploration.

Each school moves at each time step to a neighbouring grid cell, with transition probabilities depending on the habitat-suitability field. This allows for emergent collective patterns such as aggregation in high-suitability regions and dispersal when conditions deteriorate.

The model is designed as an alternative to the legacy random movement algorithm in OSMOSE, providing finer control of local movement, exploration rate and sensitivity to spatial gradients.

Therefore, the same map parameters are used:

A single map distribution can be defined either using CSV or NetCDF files

CSV maps parameters

Parameter Description
movement.randomwalk.range.sp# Number of adjacent cells a species can use during random walk (foraging)
movement.file.map# Name of the CSV file that contains the distribution map
movement.species.map# Name of the species associated with the map.
movement.initialAge.map# Minimum age (in years) when to use the map.
movement.lastAge.map# Maximum age (in years) when to use the map.
movement.initialYear.map# Minimum simulation time (in years) when to use the map.
movement.lastYear.map# Maximum simulation time (in years) when to use the map.
movement.years.map# Array of years during when to use the map. (instead of setting initial and final year)
movement.steps.map# Array of time-steps during when to use the map

NetCDF maps parameters

Parameter Description
movement.netcdf.enabled True if NetCDF maps are provided
movement.species.map# Species to which the movement map is associated
movement.file.map# NetCDF file containing the spatial distribution maps
movement.nsteps.year.map# Number of time steps per year associated with the file.
movement.initialAge.map# Minimum age (in years) when to use the map.
movement.lastAge.map# Maximum age (in years) when to use the map.
movement.variable.map# Name of the NetCDF variable containing the spatial distribution file.

Model Description

Let:

  • p(i, t) = normalised habitat suitability (or occurrence probability) at grid cell i and time t
  • α = random walk coefficient, controlling the degree of stochasticity
  • R = base search radius (in grid cells)
  • iR = {0, 1, 2, 3, 5, 10} = sequence of incremental radius expansions
  • N = total number of time steps
  • n = number of individuals

At each time step t, for each individual j, the next position is determined by evaluating the probability distribution within a local neighbourhood centred on its current position.

Equations

1. Local neighbourhood

For an individual located at cell $c_j(t)$, define the neighbourhood:

$$ \mathcal{N}_R(c_j(t)) = { i\ :\ d(i, c_j(t)) \le R } $$

If all $p(i,t) = 0$ within this radius, the search radius is increased sequentially:

$$ R_{\text{eff}} \in { R,, R+1,, R+2,, R+5,, R+10 } $$

until at least one cell with (p(i,t) > 0) is found.

2. Normalisation of local probabilities

Let $(\mathbf{p}_{\mathcal{N}})$ be the vector of suitability values in the neighbourhood. Normalise so that:

$$ \tilde{p}_i = \frac{p_i}{\sum_{k \in \mathcal{N}} p_k} $$

If the denominator is zero (sum == 0), then a global fallback can be used (e.g. sample globally from p(:,t)). This is a final solution if no cells with positive probability are found after the maximum increase in radius.

3. Random-walk mixture

Define a uniform component only across neighbourhood cells that have positive suitability:

$$ u_i = \begin{cases} \frac{1}{|\mathcal{N}|}, & \text{if } p_i > 0, & \text{or } 0 & \text{otherwise.} \end{cases} $$

Combine the two to obtain the final movement probability (convex combination):

$$ m_i = (1 - \alpha)\tilde{p}_i + \alpha u_i $$

with $0 \le \alpha \le 1$. Special cases: $\alpha=0$ → pure gradient-following; $\alpha=1$ → pure local random walk.

4. Sampling next position

The new cell is drawn stochastically:

$$ c_j(t+1) \sim \text{Categorical}( { m_i : i \in \mathcal{N}_{R_{\text{eff}}} } ) $$

Image

Notes

  • $\alpha$ prevents trapping in local maxima and promotes exploration.

  • $R$ controls locality: small $R$ yields fine-scale, slow movement; large $R$ allows broader perception of the environment.

  • The radius expansion sequence ensures that an individual will find an available target even in sparsely suitable landscapes.

  • Use a global fallback if the expanded neighbourhood still has zero probability (e.g. draw from full p(:,t)).

Model Parameters

The gradient based process takes two parameters:

Parameter Osmose name Description Typical Range Notes
α movement.random.walk.coef.spX Random walk coefficient 0–1 Controls diffusion; α = 0 = fully deterministic
R movement.base.search.radius.spX Base neighbourhood radius (grid cells) 1–10 Defines perception range

The variables used in the process are:

Parameter Description Typical Range Notes
iR Radius expansion sequence {0,1,2,3,5,10} Used when all local probabilities are zero
p(i,t) Habitat suitability / occurrence probability [0,1] Pre-computed layer for each timestep
T Number of time steps model-specific Driven by simulation resolution
n Number of individuals model-specific Particle number

Examples

Two examples of gradient based movement simulations are shown below.

With $R=1$:

Image

With $R=10$:

Image

Clone this wiki locally