mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 15:33:44 +03:00
When looking for turn conflicts, treat reserved turns (created before
starting an uber-turn) the same as accepted turns, updating the blocked-by graph and allowing a movement to start if a cycle is detected. No effect in montlake or lakeslice, and very slight progress at the Krakow roundabout for #382 -- increasing a tiny 26 trips by 7:20 am.
This commit is contained in:
parent
5dba8f5896
commit
544dda9c5c
@ -809,7 +809,11 @@ impl IntersectionSimState {
|
||||
let turn = map.get_t(req.turn);
|
||||
let mut cycle_detected = false;
|
||||
let mut ok = true;
|
||||
for other in &self.state[&req.turn.parent].accepted {
|
||||
for other in self.state[&req.turn.parent]
|
||||
.accepted
|
||||
.iter()
|
||||
.chain(self.state[&req.turn.parent].reserved.iter())
|
||||
{
|
||||
// Never short-circuit; always record all of the dependencies; it might help someone
|
||||
// else unstick things.
|
||||
if map.get_t(other.turn).conflicts_with(turn) {
|
||||
@ -843,15 +847,7 @@ impl IntersectionSimState {
|
||||
}
|
||||
}
|
||||
}
|
||||
if !ok {
|
||||
return false;
|
||||
}
|
||||
for other in &self.state[&req.turn.parent].reserved {
|
||||
if !self.disable_turn_conflicts && map.get_t(other.turn).conflicts_with(turn) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
ok
|
||||
}
|
||||
|
||||
fn detect_conflict_cycle(
|
||||
|
Loading…
Reference in New Issue
Block a user