NREL / routee-compass

The RouteE-Compass energy-aware routing engine
https://nrel.github.io/routee-compass/
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

A* Heuristic Weight Factor #195

Closed robfitzgerald closed 2 months ago

robfitzgerald commented 2 months ago

When users run A* searches, it should be possible to apply a global weight factor to all heuristic costs:

pub enum SearchAlgorithm {
  AStarAlgorithm {
    weight_factor: Option<f64>
  }
}

and so SearchAlgorithms should be able to apply heurstic weight factors:

impl SearchAlgorithm {
  pub fn apply_weight_factor(&self, cost_estimate: Cost) -> Result<Cost, SearchError> {
    ...
  }
}

in order to wire this in, SearchAlgorithm would need to be in scope of SearchInstance::estimate_traversal_cost method.