Real-time train conflict detectionand resolution: Global sequencing and local rerouting