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

« Previous Version 4 Next »

Following inputs are used to prevent deadlocks:

  • position and train_on_track
  • pre_next_segment
  • moving
  • locked[NUM_TRACKS][2], currently not working, but implemented

We are preventing deadlocks in the following ways:

  • on full KH, IC, OC or other special cases the trains take an alternative route (route = 1) to prevent deadlocks (f.e. if KH_ST is full and the KIO_LN are occupied by incoming (into KH) trains a train leaving KH should always leave through KH)
  • lock the entrance to KH_LN and KH_LN_REV and the exit of the turnout track if more than two trains travel in the opposite direction of KH
  • a train that is currently in a station,has no destination and is blocking an other train, is given a "random" destination (this is calculated deterministic) to drive to a new station. This can be disabled on each train by setting the no_forced_direction input
  • if the KH_ST is full in one direction the KIO_LN in opposite direction or the exit of the turnout track are locked. What is locked depends on how full KH_LN is and if someone wants to enter from KH_LN (same for REV)
  • a train is never stuck in turnout track, because after five trains passed (waiting_bound_KH in KH_deadlock_prevention.sctx) without the train to leave, the opposite direction is locked so that the train may leave. 
  • it is possible to set a random destination for each train if a train currently doesn't have one, by setting random_mode to true
  • No labels