A constructor for the model to use in the simulation
Initial parameters to use with the model
Number of particles to use in the simulation
Initial step
Optional
random: RandomThe random state
Returns information about how the state is packed. This is useful for computing indexes and extracting state.
Returns the number of particles
Returns the number of state elements per particle
Reorder particle state among particles
An integer array of length nParticles
, with
values between 0 and nParticles
, indicating the index of the
particle that each particle should end up taking. So if the
i
th element is j
, then after reordering particle i
will
have the state that particle j
currently has. Indices can be
repeated, and typically will be; i.e., this is a resampling
rather than a strict shuffle.
Run the model up to some step
The step to run the model to
Set new parameters into the model
If true
, then changing the parameters
also updates the initial conditions to use those from the
model's initial()
method. This uses the current step of the
model, so you may want to use setStep first.
Change the model state
A 2d-matrix of state; this interface may change.
Change the step in the model, without updating state
New step
Run the model and collect state at a series of times
An array of steps to collect state at, must be increasing. The model will stop running at the final element.
An index to use to filter state, or null
to
return the full state, see state
Extract state from the model
An index to use to filter the model state. If
given as a numeric array, then we extract index.length
states
from the model, with the i
th extracted state coming from the
models's state index[i]
. If null
, then the full model state
is copied out.
The current step
Generated using TypeDoc
Dust models