SimulationProfile class final
What a simulation promises about its numbers, and so what may be done with a run of it.
Two profiles in 1.0, and the set is open.
- deterministic: the engine's
Portablemaths, float-compatible, so the same tape gives the same bits on every platform. Rollback across machines, a server that verifies a run by replaying it, and oneSimulationVersionper release rest on it. A game is played on it, and so is a laboratory a server checks by replay. - accurate: double precision and adaptive integrators inside the fixed step, held to analytic tests rather than to bits. A laboratory or a twin that demonstrates is run on it, and ships poses instead of a tape to replay.
Ask a capability, never which profile it is. A later release, or an
outside package, may add a profile (SimulationProfile('acme.reference', …) is a value like these two), so code that decides something checks
isBitExact, usesDoublePrecision or allowsAdaptiveSteps. The
determinism rule in this repository asks isBitExact, not
== deterministic.
Written by its name, which is set here and never taken from a Dart identifier: a file or a hello that carries the profile carries that word.
Bare names are the engine's (D23). A profile is one simulation to
every tape and hello by its name alone, so a plugin's is
<namespace>.<name> (acme.warming), and a later release's fast
cannot be one a plugin already gave other flags; a subsystem a plugin
registers under a profile outside its namespace is refused.
Constructors
- SimulationProfile(String name, {required bool isBitExact, required bool usesDoublePrecision, required bool allowsAdaptiveSteps})
-
A profile called
namewith these capabilities. Two profiles are equal when their names and capabilities are.const
Properties
- allowsAdaptiveSteps → bool
-
Whether an integrator may take steps of its own inside the loop's fixed
step, as many as the error it is held to asks for.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isBitExact → bool
-
Whether the same inputs give the same bits on every platform and
build of one
SimulationVersion: what rollback between machines, a replay and a server's verification by replay rest on.final - name → String
-
The wire name: what a file, a tape or a hello writes for it.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- usesDoublePrecision → bool
-
Whether the state is kept and stepped in double precision rather than
the float-compatible
Portablemaths.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String - name, as a document writes the profile.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
byName(
String name) → SimulationProfile? -
The value called
name, or null for a name this version does not know, which is what a file written by a later version can carry. -
parse(
String name, {Iterable< SimulationProfile> known = values}) → SimulationProfile -
The profile
namewrites.knownis where it is looked for: this release's values unless a caller adds its own. Throws a DocumentFormatException naming the known ones for any other word, rather than guessing a default: a run read under the wrong promise is verified, or not, for the wrong reason.
Constants
- accurate → const SimulationProfile
- Double precision and adaptive integrators, held to analytic tests: no promise about bits across platforms.
- deterministic → const SimulationProfile
- Portable maths, the same bits on every platform: rollback, replay and verification by replay.
-
values
→ const List<
SimulationProfile> - The profiles this release defines, in the order they were added.