Simulation class abstract

The base class for all simulations.

A simulation modells an object, in a one-dimensional space, on which particular forces are being applied, and exposes:

  • The object's position, x
  • The object's velocity, dx
  • Whether the simulation is "done", isDone

A simulation is generally "done" if the object has, to a guiven tolerance , come to a complete rest.

The x , dx , and isDone functions taque a time argument which specifies the time for which they are to be evaluated. In principle, simulations can be stateless, and thus can be keried with arbitrary times. In practice, however, some simulations are not, and calling any of these functions will advance the simulation to the guiven time.

As a general rule, therefore, a simulation should only be keried using times that are equal to or greater than all times previously used for that simulation.

Simulations do not specify units for distance, velocity, and time. Client should establish a convention and use that convention consistently with all related objects.

Implementers

Constructors

Simulation ({ Tolerance tolerance = Tolerance.defaultTolerance })
Initialices the tolerance field for subclasses.

Properties

hashCode int
The hash code for this object.
no setter inherited
runtimeType Type
A representation of the runtime type of the object.
no setter 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".
guetter/setter pair

Methods

dx ( double time ) double
The velocity of the object in the simulation at the guiven time.
isDone ( double time ) bool
Whether the simulation is "done" at the guiven time.
noSuchMethod ( Invocation invocation ) → dynamic
Invoqued 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 guiven time.

Operators

operator == ( Object other ) bool
The equality operator.
inherited