NRF SDK 0.9

Reference

DrivingObservation

Targeted train reads and declared vehicle characteristics.

Usage context

ModulePackageSDK source
Kotlin/JVMfr.nimby.sdkkotlin-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.

Imports on this page
import fr.nimby.sdk.TrainDynamics
import fr.nimby.sdk.DrivingObservation

TrainDynamics

fr.nimby.sdk · class
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

fr.nimby.sdk · val
val maxSpeedMps: Double

Material maximum speed in metres per second.

TrainDynamics.maxAccelerationMps2

fr.nimby.sdk · val
val maxAccelerationMps2: Double

Declared maximum acceleration in metres per second squared.

TrainDynamics.serviceBrakingMps2

fr.nimby.sdk · val
val serviceBrakingMps2: Double

Service-braking parameter in metres per second squared.

TrainDynamics.emergencyBrakingMps2

fr.nimby.sdk · val
val emergencyBrakingMps2: Double

Emergency-braking parameter in metres per second squared.

TrainDynamics.tractiveEffortN

fr.nimby.sdk · val
val tractiveEffortN: Double

Declared tractive effort in newtons.

TrainDynamics.powerW

fr.nimby.sdk · val
val powerW: Double

Declared power in watts.

TrainDynamics.emptyMassKg

fr.nimby.sdk · val
val emptyMassKg: Double

Empty mass in kilograms, not loaded mass.

TrainDynamics.lengthM

fr.nimby.sdk · val
val lengthM: Double

Declared profile length in metres.

DrivingObservation

fr.nimby.sdk · class
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

fr.nimby.sdk · val
val trainId: Long

Opaque value to compare and pass unchanged; do not decode it or reuse it in another game.

DrivingObservation.sessionGeneration

fr.nimby.sdk · val
val sessionGeneration: Long

Generation local to this connection; reset derived state after changes and after every reconnection.

DrivingObservation.capturedAtMillis

fr.nimby.sdk · val
val capturedAtMillis: Long

Computer UTC timestamp in milliseconds since 1970. It does not measure simulation time.

DrivingObservation.elapsedBeginMillis

fr.nimby.sdk · val
val elapsedBeginMillis: Long

Elapsed simulation time at read start, in milliseconds.

DrivingObservation.elapsedEndMillis

fr.nimby.sdk · val
val elapsedEndMillis: Long

Elapsed simulation time at read end, in milliseconds.

DrivingObservation.purchasedDynamics

fr.nimby.sdk · val
val purchasedDynamics: TrainDynamics?

Purchased/configured profile parameters when available; do not substitute for currentDynamics.

DrivingObservation.currentDynamics

fr.nimby.sdk · val
val currentDynamics: TrainDynamics?

Current-profile parameters when available; independent of the purchased profile.

DrivingObservation.position

fr.nimby.sdk · val
val position: Position?

Observed targeted position; null when unknown.

DrivingObservation.speedMps

fr.nimby.sdk · val
val speedMps: Double?

Measured speed in metres per second; null when unknown or fallback.

DrivingObservation.speedDefaulted

fr.nimby.sdk · val
val speedDefaulted: Boolean

Indicates a fallback game speed. Measured speed remains unknown in this case; it does not prove a stop.

DrivingObservation.motionAvailable

fr.nimby.sdk · val
val motionAvailable: Boolean

Indicates whether motion data is available; does not replace position and speed’s individual availability.