Reference
DrivingObservation
Targeted train reads and declared vehicle characteristics.
Usage context
| Module | Package | SDK source |
|---|---|---|
| Kotlin/JVM | fr.nimby.sdk | kotlin-client/src/main/kotlin/fr/nimby/sdk/DrivingObservation.kt |
Public API for SDK 0.9.0-alpha.2. Each entry provides the Kotlin signature and its contract: what the value means, conditions of use and effects to understand. Choose imports from the module shown above.
import fr.nimby.sdk.TrainDynamics
import fr.nimby.sdk.DrivingObservationTrainDynamics
data class TrainDynamics(
val maxSpeedMps: Double, val maxAccelerationMps2: Double,
val serviceBrakingMps2: Double, val emergencyBrakingMps2: Double,
val tractiveEffortN: Double, val powerW: Double, val emptyMassKg: Double, val lengthM: Double,
)Driving parameters of a material profile in SI units. A targeted read returns this profile only when usable; values are not measured performance.
TrainDynamics.maxSpeedMps
val maxSpeedMps: DoubleMaterial maximum speed in metres per second.
TrainDynamics.maxAccelerationMps2
val maxAccelerationMps2: DoubleDeclared maximum acceleration in metres per second squared.
TrainDynamics.serviceBrakingMps2
val serviceBrakingMps2: DoubleService-braking parameter in metres per second squared.
TrainDynamics.emergencyBrakingMps2
val emergencyBrakingMps2: DoubleEmergency-braking parameter in metres per second squared.
TrainDynamics.tractiveEffortN
val tractiveEffortN: DoubleDeclared tractive effort in newtons.
TrainDynamics.powerW
val powerW: DoubleDeclared power in watts.
TrainDynamics.emptyMassKg
val emptyMassKg: DoubleEmpty mass in kilograms, not loaded mass.
TrainDynamics.lengthM
val lengthM: DoubleDeclared profile length in metres.
DrivingObservation
data class DrivingObservation(
val trainId: Long, val sessionGeneration: Long, val capturedAtMillis: Long,
val elapsedBeginMillis: Long, val elapsedEndMillis: Long,
val purchasedDynamics: TrainDynamics?, val currentDynamics: TrainDynamics?,
val position: Position?, val speedMps: Double?, val speedDefaulted: Boolean,
val motionAvailable: Boolean,
)Result of a targeted driving read. Purchased and current profiles are independent; the simulation-time interval bounds the read without guaranteeing an atomic tick.
DrivingObservation.trainId
val trainId: LongOpaque value to compare and pass unchanged; do not decode it or reuse it in another game.
DrivingObservation.sessionGeneration
val sessionGeneration: LongGeneration local to this connection; reset derived state after changes and after every reconnection.
DrivingObservation.capturedAtMillis
val capturedAtMillis: LongComputer UTC timestamp in milliseconds since 1970. It does not measure simulation time.
DrivingObservation.elapsedBeginMillis
val elapsedBeginMillis: LongElapsed simulation time at read start, in milliseconds.
DrivingObservation.elapsedEndMillis
val elapsedEndMillis: LongElapsed simulation time at read end, in milliseconds.
DrivingObservation.purchasedDynamics
val purchasedDynamics: TrainDynamics?Purchased/configured profile parameters when available; do not substitute for currentDynamics.
DrivingObservation.currentDynamics
val currentDynamics: TrainDynamics?Current-profile parameters when available; independent of the purchased profile.
DrivingObservation.position
val position: Position?Observed targeted position; null when unknown.
DrivingObservation.speedMps
val speedMps: Double?Measured speed in metres per second; null when unknown or fallback.
DrivingObservation.speedDefaulted
val speedDefaulted: BooleanIndicates a fallback game speed. Measured speed remains unknown in this case; it does not prove a stop.