Sample proximity only for objectives that use it
This commit is contained in:
parent
a4c76f3a68
commit
15c2714f1f
1 changed files with 34 additions and 3 deletions
|
|
@ -45,7 +45,11 @@ def build_routing_stack(problem: RoutingProblem, options: RoutingOptions) -> Rou
|
|||
world.add_static_obstacle(obstacle)
|
||||
|
||||
danger_map = DangerMap(bounds=problem.bounds)
|
||||
danger_map.precompute(list(problem.static_obstacles))
|
||||
refinement = options.refinement
|
||||
if options.objective.danger_weight or (
|
||||
refinement.enabled and refinement.objective is not None and refinement.objective.danger_weight
|
||||
):
|
||||
danger_map.precompute(list(problem.static_obstacles))
|
||||
|
||||
evaluator = CostEvaluator.from_objective(
|
||||
world,
|
||||
|
|
|
|||
Loading…
Reference in a new issue