Class Particle

Hierarchy

  • Particle

Constructors

Properties

Methods

Constructors

  • Construct a particle

    Parameters

    • model: DustModel

      An initialised model - note that unlike the C++ version of dust, all particles share the same initialised model as they do not run in parallel.

    • step: number

      The step to start the particle at

    • Optional state: readonly number[]

      Optional vector of state; if given then this is the initial state for the particle. Otherwise the state comes from the models initial method (see DustModel)

    Returns Particle

Properties

size: number

The size of the particle state - this cannot be modified after creation

step: number

The step (in time) that the particle is currently at

Methods

  • copyState(v: VectorView, index: null | number[]): void
  • Copy particle state into a VectorView object, probably part of a DustState or DustStateTime object.

    Parameters

    • v: VectorView

      The destination vector view to copy into

    • index: null | number[]

      An index to use to restrict or order the copying of state. If non-null, then only the indicated states will be copied

    Returns void

  • Model information, about ordering of variables, parameters, etc.

    Returns DustModelInfo

  • run(stepEnd: number, random: Random): void
  • Run a particle up to the end of stepEnd

    Parameters

    • stepEnd: number

      Step to run the particle to the end of

    • random: Random

      The random number state to use for any stochastic draws

    Returns void

  • setState(state: readonly number[], next?: boolean): void
  • Set particle state

    Parameters

    • state: readonly number[]

      New state, must be of length size

    • next: boolean = false

      Update the next state, rather than the current state. If true, then the particle state as returned by state will not be affected and you will need to call swap in order to make the state take effect. This is used when shuffling particles, via reorder.

    Returns void

  • state(): readonly number[]
  • Return current particle state

    Returns readonly number[]

  • swap(): void
  • Swap the model state with its internal next state. This is designed for use by Dust and not users in general!

    Returns void

Generated using TypeDoc