Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Management of railway components

Trains

  • Each train has a trainnumber.
    • Apart from identification the trainnumber is used for prioritization, when multiple trains compete for the same track.
    • Lower numbers mean higher priorities, e.g. train 0 has the highest priority.
    • Priorities can't be changed dynamicly.
  • Each train has one home-track at each station.
  • For binding purposes the variable should have the name trainNum.

The numbering is derived from the initial positions of the trains.

trainNumStarting track
0KH_ST_1
1KH_ST_2
2KH_ST_3 (r)
3KH_ST_4 (r)
4IC_ST_3
5IC_ST_2
6OC_ST_2
7OC_ST_1
8KH_ST_5
9IC_ST_1
10OC_ST_3

Tracks

  • Stopping on tracks without contacts is permitted.
  • Tracks without contacts must be reserved and used with an adjacent "safe" track.
  • When requesting multiple locks, deadlocks must be prevented
  • Three different speed settings are available, adjusted to the individual trains:
    • NORMAL - Normal driving speed
    • CAUTION - Speed when slowing down while waiting for permissions (and optionally for branch points)
    • SLOW - Driving into a station

Contacts

  • Contact events should only be read when it is clearly determined which train will trigger this event.
  • Subsequently contact events should only be read while holding the corresponding lock.

Stations

  • Each station has one drive-through track for each possible direction:
stationdrive-through track
IC_stationIC_ST_1
OC_stationOC_ST_3
KH_stationKH_ST_5
KH_station(r)KH_ST_1

Rulesets

Logging

  • The variable debug indicates verbose logging.
  • All log messages must be prefixed: [trainnum][ST-ST]

Use println function to produce textual output. Do not use printf or other io functions, because output may not be flushed correctly.

  • No labels