Flow optimization on high speed trains