mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-28 08:53:26 +03:00
clean up stuck/vanish case for drivers, now that parking blackholes have been fixed
This commit is contained in:
parent
af22daaf69
commit
72c391fe15
@ -182,14 +182,7 @@ impl Router {
|
|||||||
self.path.add(step, map);
|
self.path.add(step, map);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO Fix by avoiding parking blackholes in the first place.
|
panic!("{} can't find parking on {}, and also it's a dead-end, so they'll be stuck there forever. Vanishing. Parking blackholes were wrong?", vehicle.id, current_lane);
|
||||||
println!("{} can't find parking on {}, and also it's a dead-end, so they'll be stuck there forever. Vanishing.", vehicle.id, current_lane);
|
|
||||||
// TODO Hmm, actually, this might not be a border -- it just inevitably
|
|
||||||
// leads only to a border.
|
|
||||||
self.goal = Goal::EndAtBorder {
|
|
||||||
end_dist: map.get_l(current_lane).length(),
|
|
||||||
i: map.get_l(current_lane).dst_i,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
return Some(ActionAtEnd::GotoLaneEnd);
|
return Some(ActionAtEnd::GotoLaneEnd);
|
||||||
}
|
}
|
||||||
|
@ -388,16 +388,7 @@ impl TripManager {
|
|||||||
let trip = &mut self.trips[self.active_trip_mode.remove(&AgentID::Car(car)).unwrap().0];
|
let trip = &mut self.trips[self.active_trip_mode.remove(&AgentID::Car(car)).unwrap().0];
|
||||||
match trip.legs.pop_front().unwrap() {
|
match trip.legs.pop_front().unwrap() {
|
||||||
TripLeg::Drive(_, DrivingGoal::Border(int, _)) => assert_eq!(i, int),
|
TripLeg::Drive(_, DrivingGoal::Border(int, _)) => assert_eq!(i, int),
|
||||||
_ => {
|
_ => unreachable!(),
|
||||||
// TODO Should be unreachable
|
|
||||||
println!(
|
|
||||||
"Aborting {} at {} because {} couldn't find parking and got stuck",
|
|
||||||
trip.id, now, car
|
|
||||||
);
|
|
||||||
self.unfinished_trips -= 1;
|
|
||||||
trip.aborted = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
assert!(trip.legs.is_empty());
|
assert!(trip.legs.is_empty());
|
||||||
assert!(!trip.finished_at.is_some());
|
assert!(!trip.finished_at.is_some());
|
||||||
|
Loading…
Reference in New Issue
Block a user