mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-27 00:12:55 +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);
|
||||
}
|
||||
} else {
|
||||
// TODO Fix by avoiding parking blackholes in the first place.
|
||||
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,
|
||||
};
|
||||
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);
|
||||
}
|
||||
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];
|
||||
match trip.legs.pop_front().unwrap() {
|
||||
TripLeg::Drive(_, DrivingGoal::Border(int, _)) => assert_eq!(i, int),
|
||||
_ => {
|
||||
// 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;
|
||||
}
|
||||
_ => unreachable!(),
|
||||
};
|
||||
assert!(trip.legs.is_empty());
|
||||
assert!(!trip.finished_at.is_some());
|
||||
|
Loading…
Reference in New Issue
Block a user