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.
Similarly, this means that the x value will change at a rate that does not match the reported dx value while one or the other is being clamped.
The isDone logic is unaffected by the clamping; it reflects the logic of the underlying simulation.
- Inheritance
-
- Object
- Simulation
- ClampedSimulation
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
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- simulation → Simulation
-
The simulation being clamped. Calls to x, dx, and isDone are
forwarded to the simulation.
final
- 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".
getter/setter pairinherited
- xMax → double
-
The maximum to apply to x.
final
- xMin → double
-
The minimum to apply to x.
final
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
x(
double time) → double -
The position of the object in the simulation at the given time.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited