Share worker setup, residual preparation, and scenario capture
This commit is contained in:
parent
591560949c
commit
0c059cc7d6
1 changed files with 88 additions and 151 deletions
|
|
@ -27,7 +27,6 @@ def _build_pair_local_context(
|
|||
lock_partial_paths: bool,
|
||||
) -> AStarContext:
|
||||
problem = context.problem
|
||||
objective = context.options.objective
|
||||
live_world = context.cost_evaluator.collision_engine
|
||||
static_obstacles = tuple(live_world.iter_static_geometries())
|
||||
world = RoutingWorld(clearance=live_world.clearance, safety_zone_radius=live_world.safety_zone_radius)
|
||||
|
|
@ -45,14 +44,11 @@ def _build_pair_local_context(
|
|||
|
||||
danger_map = DangerMap(bounds=problem.bounds)
|
||||
danger_map.precompute(list(static_obstacles))
|
||||
evaluator = CostEvaluator(
|
||||
evaluator = CostEvaluator.from_objective(
|
||||
world,
|
||||
danger_map,
|
||||
unit_length_cost=objective.unit_length_cost,
|
||||
context.options.objective,
|
||||
greedy_h_weight=context.cost_evaluator.greedy_h_weight,
|
||||
bend_penalty=objective.bend_penalty,
|
||||
sbend_penalty=objective.sbend_penalty,
|
||||
danger_weight=objective.danger_weight,
|
||||
)
|
||||
return AStarContext(
|
||||
evaluator,
|
||||
|
|
|
|||
Loading…
Reference in a new issue