summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
cac4176)
The front of the occupied tracks list contains the length of the chosen
path on the current track and needs to be updated when the path changes.
+void TrainRoutePlanner::TrainRoutingState::set_path(unsigned p)
+{
+ path = p;
+ OccupiedTrack *next_occ = occupied_tracks->next;
+ if(!--occupied_tracks->refcount)
+ delete occupied_tracks;
+ occupied_tracks = new OccupiedTrack(*track, path, next_occ);
+ update_estimate();
+}
+
void TrainRoutePlanner::TrainRoutingState::update_estimate()
{
TrackIter iter = track.reverse(path);
void TrainRoutePlanner::TrainRoutingState::update_estimate()
{
TrackIter iter = track.reverse(path);
{
TrainRoutingState &train = next.trains[train_index];
{
TrainRoutingState &train = next.trains[train_index];
- train.path = path;
- train.update_estimate();
next.update_estimate();
if(next.is_viable())
new_steps.push_back(next);
next.update_estimate();
if(next.is_viable())
new_steps.push_back(next);
void advance(float);
void advance(const Msp::Time::TimeDelta &);
void advance_track(unsigned);
void advance(float);
void advance(const Msp::Time::TimeDelta &);
void advance_track(unsigned);
+ void set_path(unsigned);
void update_estimate();
bool is_viable() const;
};
void update_estimate();
bool is_viable() const;
};