AlgorithmState

data class AlgorithmState(val schemaVersion: Int = CURRENT_SCHEMA_VERSION, val cleanedM: Double = 0.0, val abnormalM: Double = 0.0, val mockM: Double = 0.0, val spikeM: Double = 0.0, val originalM: Double = 0.0, val accepted: Int = 0, val rejected: Int = 0, val consecutiveNormal: Int = 0, val maxSpeedMps: Double = 0.0, val avgSpeedMps: Double = 0.0, val lastFix: Fix? = null, val opaque: Map<String, Double> = emptyMap())

Everything needed to resume a journey across process death.

opaque is an escape hatch for implementation-private continuation state (a Kalman covariance, a rolling speed window's summary) so that adding such state to one algorithm does not force a schema change on every other one.

Constructors

Link copied to clipboard
constructor(schemaVersion: Int = CURRENT_SCHEMA_VERSION, cleanedM: Double = 0.0, abnormalM: Double = 0.0, mockM: Double = 0.0, spikeM: Double = 0.0, originalM: Double = 0.0, accepted: Int = 0, rejected: Int = 0, consecutiveNormal: Int = 0, maxSpeedMps: Double = 0.0, avgSpeedMps: Double = 0.0, lastFix: Fix? = null, opaque: Map<String, Double> = emptyMap())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val lastFix: Fix?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Schema version of this snapshot.

Link copied to clipboard

Functions

Link copied to clipboard
fun invariantHolds(toleranceM: Double = 0.5): Boolean

The invariant every algorithm must preserve: cleaned distance is the original minus the parts we deliberately refused to trust. Spike distance is excluded from original by design — a teleport was never travelled, so it is not "distance we then removed".