NRF SDK 0.9

Reference

AutomaticDriving

Build generic instructions with speeds chosen by your mod.

Usage context

ModulePackageSDK source
Kotlin/Nativenimbykotlin/src/nimby/AutomaticDriving.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 nimby.AutomaticDriving

AutomaticDriving

nimby · object
object AutomaticDriving

Builds driving rules in m/s without reading the game. Return a rule from driving. The mod chooses every speed and permission; colours do not determine them.

AutomaticDriving.clear

nimby · fun
fun clear(): DrivingRule

Releases restrictions whose policy ends on Clear. Does not itself declare a track physically clear.

AutomaticDriving.stop

nimby · fun
fun stop(): DrivingRule

Requires a stop at the current signal, with no permission to pass it.

AutomaticDriving.announceStop

nimby · fun
fun announceStop(signalsAhead: Int, passageSpeedMps: Double,
                     passableHere: Boolean, followTargetSpeed: Boolean = false,
                     cancelAtNextClear: Boolean = false): DrivingRule

Remembers a stop one or two signals ahead when passing this signal. Target permission replaces that stop with passageSpeedMps until the train head passes it. passableHere concerns the current signal. followTargetSpeed accepts the target’s numeric speed; cancelAtNextClear requires that option and a target two signals ahead. Speed must be finite and nonnegative.

AutomaticDriving.limitAtSignal

nimby · fun
fun limitAtSignal(speedMps: Double, passableHere: Boolean): DrivingRule

A local speed ceiling at this signal, in m/s, with no retained restriction after passage. Speed must be finite and nonnegative; passableHere=true requires a strictly positive speed.

AutomaticDriving.limitUntilClearThenRear

nimby · fun
fun limitUntilClearThenRear(speedMps: Double, signalsAhead: Int, passableHere: Boolean): DrivingRule

Applies a strictly positive speed in m/s at this signal or one/two signals ahead. The restriction remains until the rear clears a Clear signal actually passed. passableHere permits passage of the current signal without removing other restrictions.

AutomaticDriving.restrictedUntilNextSignal

nimby · fun
fun restrictedUntilNextSignal(entrySpeedMps: Double, maximumSpeedMps: Double, stopFirst: Boolean): DrivingRule

Permits restricted movement until the train head reaches the next signal, braking for physically clear space. maximumSpeedMps must be positive; entrySpeedMps lies between zero and that maximum. stopFirst requires entrySpeedMps=0 and a prior stop. This permission can replace the followed track’s occupancy/reservation gate; physical obstacles, crossing conflicts and route checks still block movement.