Bound search memory and verify process geometry before layout export

This commit is contained in:
Jan Petykiewicz 2026-11-28 20:42:25 -08:00
commit e6ae242cb2

View file

@ -155,7 +155,9 @@ class _AutomaticRun:
if self.length_weights is not None:
return weighted_path_length(result.path, self.length_weights)
if self.evaluator is None:
self.evaluator = build_native_cost_evaluator(self.problem, self.options.objective)
self.evaluator = build_native_cost_evaluator(
self.problem, self.options.objective, proximity_range=self.options.search.proximity_range,
)
return self.evaluator.path_cost(result.path[0].start_port, result.path)
def _trial(self, run: RoutingRunResult, stage: RoutingStage) -> Trial:
@ -305,9 +307,7 @@ class _AutomaticRun:
problem, options = self.problem, self.options
if len(problem.nets) != 2:
return
world = RoutingWorld(clearance=problem.clearance, safety_zone_radius=problem.safety_zone_radius, board=self.board)
for obstacle in problem.static_obstacles:
world.add_static_obstacle(obstacle)
world = RoutingWorld.from_problem(problem, board=self.board)
def footprints(net: NetSpec, seeds: Iterable[PathSeed]) -> list[tuple[PathSeed, BaseGeometry]]:
choices = []
@ -637,7 +637,7 @@ class _AutomaticRun:
return None
if not refined.selectable:
return best
evaluator = build_native_cost_evaluator(self.problem, objective)
evaluator = build_native_cost_evaluator(self.problem, objective, proximity_range=self.options.search.proximity_range)
def cost(trial: Trial) -> float:
paths = (trial.run.results_by_net[net_id].path for net_id in trial.valid_costs)