From: Mikko Rasa Date: Fri, 6 Feb 2015 14:23:05 +0000 (+0200) Subject: Immediately process sequence points that are already covered X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=193220dca4f520379b23160787ec60315903d49c;p=r2c2.git Immediately process sequence points that are already covered The planner starts from the front buffer of the train, so it may generate sequence points in the existing critical blocks. --- diff --git a/source/libr2c2/trainrouter.cpp b/source/libr2c2/trainrouter.cpp index cef98ee..38027db 100644 --- a/source/libr2c2/trainrouter.cpp +++ b/source/libr2c2/trainrouter.cpp @@ -77,6 +77,7 @@ void TrainRouter::route_changed() can't rely on the resync code in block_reserved since we may need to clear the stop marker to continue allocation. */ TrackIter track = train.get_block_allocator().first().track_iter(); + list::iterator seq_begin = sequence_points.begin(); for(; track; track=track.next()) { if(!advance_to_track(reserving_route, track)) @@ -86,7 +87,15 @@ void TrainRouter::route_changed() } if(&track->get_block()==fncb.block()) break; + + if(seq_begin!=sequence_points.end() && seq_begin->block==&track->get_block()) + { + current_sequence = seq_begin->sequence_out; + ++seq_begin; + } } + + sequence_points.erase(sequence_points.begin(), seq_begin); } if(!already_at_end)