Advances the state of a Simulation thru time. This follows the strategy design pattern: a Simulation can be fitted with any of several possible AdvanceStrategys. This gives flexibility in choosing what algorithm to use for advancing the Simulation.

interface AdvanceStrategy {
    advance(timeStep, opt_memoList?): void;
    getTime(): number;
    getTimeStep(): number;
    reset(): void;
    save(): void;
    setTimeStep(timeStep): void;
    toStringShort(): string;
}

Hierarchy (view full)

Implemented by

Methods

  • Advances the Simulation state by the specified amount of time.

    Parameters

    • timeStep: number

      the amount of time to advance in seconds

    • Optional opt_memoList: MemoList

      optional MemoList to call whenever the simulation state is advanced

    Returns void

    Throws

    when unable to advance the simulation

  • Returns the default time step, the small increment of time by which to advance the simulation's state.

    Returns number

    the default time step, in seconds.

  • Sets the simulation back to its initial conditions, and sets the simulation time to the starting time.

    Returns void

  • Sets the default time step, the small increment of time by which to advance the simulation's state.

    The reason for storing the time step in AdvanceStrategy is so that test/TestViewerApp.TestViewerApp produces the same results as running a test. This is a convenient way for a test to make known the time step to use.

    Parameters

    • timeStep: number

      the default time step, in seconds.

    Returns void

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc