ClampedSimulation class

A simulation that applies limits to another simulation.

The limits are only applied to the other simulation's outputs. For example, if a maximum position was applied to a gravity simulation with the particle's initial velocity being up, and the acceleration being down, and the maximum position being between the initial position and the curve's apogee, then the particle would return to its initial position in the same amount of time as it would have if the maximum had not been applied; the difference would just be that the position would be reported as pinned to the maximum value for the times that it would otherwise have been reported as higher.

Inheritance

Constructors

ClampedSimulation(Simulation simulation, { double xMin: double.negativeInfinity, double xMax: double.infinity, double dxMin: double.negativeInfinity, double dxMax: double.infinity })
Creates a ClampedSimulation that clamps the given simulation. [...]

Properties

dxMax double
The maximum to apply to dx.
final
dxMin double
The minimum to apply to dx.
final
simulation Simulation
The simulation being clamped. Calls to x, dx, and isDone are forwarded to the simulation.
final
xMax double
The maximum to apply to x.
final
xMin double
The minimum to apply to x.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
tolerance Tolerance
How close to the actual end of the simulation a value at a particular time must be before isDone considers the simulation to be "done". [...]
read / write, inherited

Methods

dx(double time) double
The velocity of the object in the simulation at the given time.
override
isDone(double time) bool
Whether the simulation is "done" at the given time.
override
x(double time) double
The position of the object in the simulation at the given time.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited