Fixed logic for computing train and dwell arcs