Class ODEInitialize

Object
ODEInitialize
Direct Known Subclasses:
PDEInitialize

class ODEInitialize extends Object
Helper responsible for configuring initial conditions of ODE/SDE models.

Encapsulates the initialization types supported by ODE, the parsing of command line configuration and the construction of initial state vectors.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Types of initial configurations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final ODE
    Hosting ODE model used to access species and state arrays.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an initializer bound to the supplied ODE model.
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    appendY0(double[] popinit, int start)
    Append the provided population initialization vector at the given offset within ODE.y0, resizing as needed.
    (package private) void
    init(boolean doRandom)
    Initialize the model state vectors, optionally randomizing species flagged with ODEInitialize.InitType.RANDOM.
    (package private) boolean
    Parse the CLI string describing initial conditions.
    private boolean
    processDensity(Module<?> pop, String iargs, int start)
    Parse a density specification and append it to ODE.y0.
    private boolean
    processFrequency(Module<?> pop, String iargs, int start)
    Parse a frequency specification and append it to ODE.y0.
    private boolean
    processInit(Module<?> pop, ODEInitialize.InitType itype, String iargs, int start)
    Process initialization for a single population and append it to ODE.y0.
    private boolean
    processMutant(Module<?> pop, String iargs, int start)
    Parse a mutant initialization specification and append it to ODE.y0.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ode

      private final ODE ode
      Hosting ODE model used to access species and state arrays.
  • Constructor Details

    • ODEInitialize

      ODEInitialize(ODE ode)
      Create an initializer bound to the supplied ODE model.
      Parameters:
      ode - owning model
  • Method Details

    • init

      void init(boolean doRandom)
      Initialize the model state vectors, optionally randomizing species flagged with ODEInitialize.InitType.RANDOM.
      Parameters:
      doRandom - true if random initialization should be applied
    • parse

      boolean parse(String arg)
      Parse the CLI string describing initial conditions.
      Parameters:
      arg - command-line fragment
      Returns:
      true if parsing succeeded
    • processInit

      private boolean processInit(Module<?> pop, ODEInitialize.InitType itype, String iargs, int start)
      Process initialization for a single population and append it to ODE.y0.
      Parameters:
      pop - module being initialized
      itype - initialization type
      iargs - initialization arguments
      start - index where the species slice begins
      Returns:
      true if parsing succeeded
    • processMutant

      private boolean processMutant(Module<?> pop, String iargs, int start)
      Parse a mutant initialization specification and append it to ODE.y0.
      Parameters:
      pop - module being initialized
      iargs - string containing mutant parameters
      start - index where the species slice begins
      Returns:
      true if parsing succeeded
    • processDensity

      private boolean processDensity(Module<?> pop, String iargs, int start)
      Parse a density specification and append it to ODE.y0.
      Parameters:
      pop - module being initialized
      iargs - density values as a string
      start - index where the species slice begins
      Returns:
      true if parsing succeeded
    • processFrequency

      private boolean processFrequency(Module<?> pop, String iargs, int start)
      Parse a frequency specification and append it to ODE.y0.
      Parameters:
      pop - module being initialized
      iargs - frequency values as a string
      start - index where the species slice begins
      Returns:
      true if parsing succeeded
    • appendY0

      private void appendY0(double[] popinit, int start)
      Append the provided population initialization vector at the given offset within ODE.y0, resizing as needed.
      Parameters:
      popinit - initialization data
      start - target offset within ODE.y0