Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

(pre_)next_segmentUsed by hardware abstraction to determine what tracks need to be to reservated reserved and what tracks need to be powered. Its is also used by deadlock prevention to set route or set final_station
movingBoolean that signals whether a train intends to move. May be true for trains that are not moving physically if they are blocked in any way (either by hardware abstraction or one of lock_XX).


The Scheduler uses the following internal variables to determine the location and state of each train.

station (output)The final_station the train is currently heading to. Only updated if the train reached a station. A train may not change station while not being in at least a substation of its route.
taken_routeThe route the train is currently using. Only updated if the train reached a station. A train may not change station while not being in a station.
still_moving

Boolean used to signal that regardless whether next_segment == NO_DESTINATION, a train still has a destination he is heading to.

not_in_stationOnly set in first tick, if initial_position is no platform. Used to handle the special cases that can happen. Only used untill a station is reached.
only_passing_bySignals that a train does not want to enter a specific platform in a station. Mostly used if a train has to pass a station to reach his final station.
station_position (output)The last station a train has visited. Is set to a possible previous station if initial_position is no platform.
substation (output)Indicates next platform/ station a train should head to. If substation is not equal to station the station is used instead of a specific platform.


The station_position, station and taken_route (and not_in_station untill until first station is reached) to determine the next substation. The variables current_position and substation (and lock_XX, only_passing_by) are used  to determine the next_segment.

...