ISSUE #501 Apply route overrides TO-FROM and FROM-TO, rather than being order specific. Add a diagnostic output to indicate the override was used.

This commit is contained in:
Herbert Wolverson 2024-06-25 11:51:30 -05:00
parent f4e4c7d226
commit 857f13c0c3

View File

@ -53,9 +53,10 @@ fn walk_node(
let to = sites[idx].name.clone();
if let Some(route_override) = overrides
.iter()
.find(|o| o.from_site == from && o.to_site == to)
.find(|o| (o.from_site == from && o.to_site == to) || (o.from_site == to && o.to_site == from))
{
sites[i].route_weights.push((idx, route_override.cost));
tracing::info!("Applied route override {} - {}", route_override.from_site, route_override.to_site);
} else {
sites[i].route_weights.push((idx, weight));
}