mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 23:43:25 +03:00
WIP woops, found a bug with bike_reached_end
This commit is contained in:
parent
fb298e4706
commit
b618842ad2
@ -118,3 +118,7 @@ necessary to plumb more log context anyway.
|
|||||||
At some point, geometry was a separate layer from the graph base-layer of
|
At some point, geometry was a separate layer from the graph base-layer of
|
||||||
map_model. That doesn't work -- we can't even reason about what turns logically
|
map_model. That doesn't work -- we can't even reason about what turns logically
|
||||||
exist without operating on cleaned-up geometry.
|
exist without operating on cleaned-up geometry.
|
||||||
|
|
||||||
|
## IDs
|
||||||
|
|
||||||
|
Should LaneID have LaneType bundled in for convenience? CarID and VehicleType?
|
||||||
|
@ -584,6 +584,7 @@ impl DrivingSimState {
|
|||||||
|
|
||||||
let mut finished_parking: Vec<ParkedCar> = Vec::new();
|
let mut finished_parking: Vec<ParkedCar> = Vec::new();
|
||||||
let mut vanished_at_border: Vec<CarID> = Vec::new();
|
let mut vanished_at_border: Vec<CarID> = Vec::new();
|
||||||
|
// The lane is the where the bike ended, so NOT a sidewalk
|
||||||
let mut done_biking: Vec<(CarID, LaneID, Distance)> = Vec::new();
|
let mut done_biking: Vec<(CarID, LaneID, Distance)> = Vec::new();
|
||||||
|
|
||||||
// Apply moves. Since lookahead behavior works, there are no conflicts to resolve, meaning
|
// Apply moves. Since lookahead behavior works, there are no conflicts to resolve, meaning
|
||||||
|
@ -192,10 +192,10 @@ impl Sim {
|
|||||||
for c in at_border {
|
for c in at_border {
|
||||||
self.trips_state.car_reached_border(c, self.time);
|
self.trips_state.car_reached_border(c, self.time);
|
||||||
}
|
}
|
||||||
for (bike, lane, dist) in done_biking {
|
for (bike, last_lane, dist) in done_biking {
|
||||||
// TODO push an event, backtrace, etc
|
// TODO push an event, backtrace, etc
|
||||||
self.spawner
|
self.spawner
|
||||||
.bike_reached_end(self.time, bike, lane, dist, &mut self.trips_state);
|
.bike_reached_end(self.time, bike, last_lane, dist, &mut self.trips_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.walking_state.populate_view(&mut view);
|
self.walking_state.populate_view(&mut view);
|
||||||
|
@ -600,11 +600,12 @@ impl Spawner {
|
|||||||
&mut self,
|
&mut self,
|
||||||
at: Tick,
|
at: Tick,
|
||||||
bike: CarID,
|
bike: CarID,
|
||||||
lane: LaneID,
|
last_lane: LaneID,
|
||||||
dist: Distance,
|
dist: Distance,
|
||||||
trips: &mut TripManager,
|
trips: &mut TripManager,
|
||||||
) {
|
) {
|
||||||
let (trip, ped, walk_to) = trips.bike_reached_end(bike);
|
let (trip, ped, walk_to) = trips.bike_reached_end(bike);
|
||||||
|
// TODO last_lane is not the sidewalk, we need to look that up
|
||||||
self.enqueue_command(Command::Walk(
|
self.enqueue_command(Command::Walk(
|
||||||
at.next(),
|
at.next(),
|
||||||
trip,
|
trip,
|
||||||
|
@ -66,6 +66,7 @@ impl SidewalkSpot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn bike_rack(sidewalk: LaneID, dist_along: Distance) -> SidewalkSpot {
|
pub fn bike_rack(sidewalk: LaneID, dist_along: Distance) -> SidewalkSpot {
|
||||||
|
// TODO verify the thing passed in is a sidewalk!
|
||||||
SidewalkSpot {
|
SidewalkSpot {
|
||||||
connection: SidewalkPOI::BikeRack,
|
connection: SidewalkPOI::BikeRack,
|
||||||
sidewalk,
|
sidewalk,
|
||||||
|
Loading…
Reference in New Issue
Block a user