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.



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. [...]


dxMax → double
The maximum to apply to dx.
dxMin → double
The minimum to apply to dx.
simulation Simulation
The simulation being clamped. Calls to x, dx, and isDone are forwarded to the simulation.
xMax → double
The maximum to apply to x.
xMin → double
The minimum to apply to x.
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


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


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