pt
Faça login

← Voltar à referência da API

Waiting A waiting agent

What onWaiting gives when a train's agent waits for its route to the next stop: which train, where to, how long already and why.

Para quê: To step in when a train waits too long: an announcement, or another track with arriveAt.

stations.South.onWaiting { Waiting w ->
   if (w.seconds >= 60) log "${w.train.name} waits: ${w.reason}"
}

Propriedades

train → Train

The train.

The train whose agent waits.

stations.South.onWaiting { Waiting w -> log w.train.name }

place → Place

The station or yard it waits to go to; null for a stop of one block.

The place it wants to go to, or null when the stop is one block.

stations.South.onWaiting { Waiting w -> log w.place?.name }

block → Block

The block it waits to go to, for a stop of one block.

The block it wants to go to, for a stop of one block; otherwise null.

trains.IC.onWaiting { Waiting w -> log w.block?.name }

seconds → int

How long it has waited.

How long it has waited, in seconds: 0 at the first report, then about 30 more each time.

trains.IC.onWaiting { Waiting w -> if (w.seconds >= 60) say "a long wait" }

reason → String

Why, in TRAX Control's words.

Why it waits, in TRAX Control's words, for instance which track or train is in the way.

trains.IC.onWaiting { Waiting w -> log w.reason }