A simulated railway system in Python