Preserve route identity through reservation and export
This commit is contained in:
parent
cea23ef1b4
commit
286caa273b
1 changed files with 226 additions and 99 deletions
|
|
@ -42,7 +42,7 @@ def build_routing_stack(problem: RoutingProblem, options: RoutingOptions) -> Rou
|
|||
if options.search.node_limit > 0 and options.congestion.max_iterations > 0 and (
|
||||
options.objective.danger_weight or (refinement.enabled and refinement.objective is not None and refinement.objective.danger_weight)
|
||||
):
|
||||
danger_map.precompute(problem.static_obstacles)
|
||||
danger_map.precompute(problem._blocking_polygons)
|
||||
|
||||
evaluator = CostEvaluator.from_objective(
|
||||
world,
|
||||
|
|
@ -76,7 +76,18 @@ def route_once(
|
|||
|
||||
started_at = time.monotonic()
|
||||
finder = build_routing_stack(problem, options).finder
|
||||
results = finder.route_all(iteration_callback=iteration_callback, phase_timer=phase_timer, corridors=corridors, started_at=started_at)
|
||||
effective = {net.net_id: net for net in finder.context.problem.nets}
|
||||
|
||||
def attach_effective(results: dict[str, RoutingResult]) -> dict[str, RoutingResult]:
|
||||
return {key: replace(result, effective_net=effective[key]) for key, result in results.items()}
|
||||
|
||||
def notify(iteration: int, results: dict[str, RoutingResult]) -> None:
|
||||
assert iteration_callback is not None
|
||||
iteration_callback(iteration, attach_effective(results))
|
||||
|
||||
callback = notify if iteration_callback is not None else None
|
||||
results = finder.route_all(iteration_callback=callback, phase_timer=phase_timer, corridors=corridors, started_at=started_at)
|
||||
results = attach_effective(results)
|
||||
if options.topology.mode == "bundle":
|
||||
for result in results.values():
|
||||
if not result.is_valid:
|
||||
|
|
|
|||
Loading…
Reference in a new issue