mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-27 15:03:20 +03:00
Fix an edge case in the only-one-border LTN heuristic
This commit is contained in:
parent
c024a484e3
commit
c6787f0a80
@ -135,14 +135,14 @@ fn only_one_border(app: &mut App, neighborhood: &Neighborhood) {
|
||||
.modal_filters
|
||||
.roads
|
||||
.insert(road.id, 0.1 * road.length());
|
||||
break;
|
||||
} else if road.dst_i == *i {
|
||||
app.session
|
||||
.modal_filters
|
||||
.roads
|
||||
.insert(road.id, 0.9 * road.length());
|
||||
break;
|
||||
}
|
||||
// Sometimes a cell has multiple roads connecing to the same border, so don't
|
||||
// stop looking even once we add one filter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ impl Viewer {
|
||||
ctx,
|
||||
"heuristic",
|
||||
// TODO Session state
|
||||
Heuristic::Greedy,
|
||||
Heuristic::OnlyOneBorder,
|
||||
Heuristic::choices(),
|
||||
),
|
||||
ctx.style()
|
||||
|
Loading…
Reference in New Issue
Block a user