Function to find time difference
Dynamic stations, time and rail generation in simulation