Skip to main content

Module value

Module value 

Source
Expand description

Runtime values.

Values have value semantics: collections are shared through Arc and copied on write, so forking a world is cheap and worlds never affect each other. Equality and hashing are structural (they decide which worlds merge); the language’s == lives in crate::ops and compares numbers across types.

Structs§

Closure
Delayed
The distribution of a variable whose draw is delayed, updated exactly by the observations so far.
EnumValue
Hashed
A collection, and its hash once computed. Worlds are hashed whenever they merge, and most of their collections haven’t changed since the last time: each is hashed once. Changing a collection (through DerefMut) forgets its hash, and collections with different hashes are unequal without comparing them.
Multiset
A bag’s contents: each distinct value, sorted, and how many times it’s in the bag (never zero). A sorted vector rather than a map: bags are small, copied whenever they change, and compared each time worlds merge, which is fastest in contiguous memory.
Record

Enums§

Value

Functions§

fmt_float
A float the way Probl prints it: 3.0, 0.25, 1.5e-12.
fmt_prob
A probability as a percentage with up to two decimals: 30%, 16.67%.