Class Dust

Dust models

Hierarchy

  • Dust

Constructors

  • Parameters

    • Model: DustModelConstructable

      A constructor for the model to use in the simulation

    • pars: UserType

      Initial parameters to use with the model

    • nParticles: number

      Number of particles to use in the simulation

      • can't be changed after construction.
    • step: number

      Initial step

    • Optional random: Random

      The random state

    Returns Dust

Methods

  • Returns information about how the state is packed. This is useful for computing indexes and extracting state.

    Returns DustModelInfo

  • nParticles(): number
  • Returns the number of particles

    Returns number

  • nState(): number
  • Returns the number of state elements per particle

    Returns number

  • reorder(index: number[]): void
  • Reorder particle state among particles

    Parameters

    • index: number[]

      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 ith 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.

    Returns void

  • run(stepEnd: number): void
  • Run the model up to some step

    Parameters

    • stepEnd: number

      The step to run the model to

    Returns void

  • setPars(pars: UserType, setInitialState: boolean): void
  • Set new parameters into the model

    Parameters

    • pars: UserType
    • setInitialState: boolean

      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.

    Returns void

  • setState(state: number[][]): void
  • Change the model state

    Parameters

    • state: number[][]

      A 2d-matrix of state; this interface may change.

    Returns void

  • setStep(step: number): void
  • Change the step in the model, without updating state

    Parameters

    • step: number

      New step

    Returns void

  • simulate(stepEnd: number[], index: null | number[]): DustStateTime
  • Run the model and collect state at a series of times

    Parameters

    • stepEnd: number[]

      An array of steps to collect state at, must be increasing. The model will stop running at the final element.

    • index: null | number[]

      An index to use to filter state, or null to return the full state, see state

    Returns DustStateTime

  • Extract state from the model

    Parameters

    • index: null | number[]

      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 ith extracted state coming from the models's state index[i]. If null, then the full model state is copied out.

    Returns DustState

  • step(): number
  • The current step

    Returns number

Generated using TypeDoc