Improving real-time train dispatching: Models, algorithms and applications