clean up stuck/vanish case for drivers, now that parking blackholes have been fixed

This commit is contained in:
Dustin Carlino 2019-09-15 13:46:40 -07:00
parent af22daaf69
commit 72c391fe15
2 changed files with 2 additions and 18 deletions

View File

@ -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);
}

View File

@ -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());