Fix an edge case in the only-one-border LTN heuristic

This commit is contained in:
Dustin Carlino 2022-01-12 12:33:55 +00:00
parent c024a484e3
commit c6787f0a80
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -42,7 +42,7 @@ impl Viewer {
ctx,
"heuristic",
// TODO Session state
Heuristic::Greedy,
Heuristic::OnlyOneBorder,
Heuristic::choices(),
),
ctx.style()