VirtualTime

A virtual time kept unreduced, as a sum of positions over a weight: V = ticks / (G · w), where w = weightNumerator / weightDenominator.

A front is a weighted mean, Σ w·v / Σ w, and w·v is just an edge's position over G, so the mean is Σ p / (G · Σ w): a plain sum of positions over a sum of weights. Keeping that pair, rather than dividing it out into a Rational, is what stops a front's denominator ever reaching a stored value. The sum is 128-bit because it is a sum of many positions (#3313: the sum of positions is the site that overflowed first), and so are the positions themselves (#3353): a front is taken over effective positions before anything narrows them.

The one thing read off it is ticksForWide, a joiner's position on its own grid, so the comparison a pick makes and the position a seat writes are the same expression.

A public read since step B, slice 6 (design §7.1). With no origin, a virtual time is absolute, and a Long Rational runs out after about 2⁵⁹ / d units, one largest lease at a fine weight. So each Rational read has a sibling that answers a VirtualTime, exact at every value the position limit allows: compare two with compareTo, show one with toDouble. Only this module builds one.

Functions

Link copied to clipboard
open operator override fun compareTo(other: VirtualTime): Int

The order of the two virtual times, exactly, however far either has run.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Equal when the two stand for the same virtual time, however each was formed.

Link copied to clipboard
open override fun hashCode(): Int

From the whole units, which two equal times share.

Link copied to clipboard

This time in units of virtual time, as the nearest Double: for display, never for a decision.

Link copied to clipboard
open override fun toString(): String