Defer peer-reserved perimeter detours until needed
This commit is contained in:
parent
466c68024f
commit
a15693ac4f
1 changed files with 38 additions and 13 deletions
|
|
@ -320,20 +320,20 @@ class _AutomaticRun:
|
|||
detours = (seed for _, seed in islice(perimeter_detour_candidates(single, options.search), 32))
|
||||
candidates.append(links[-1] if supplied is not None else [*links[-1], *footprints(net, detours)])
|
||||
|
||||
pairs: Iterable[tuple[tuple[PathSeed, BaseGeometry], tuple[PathSeed, BaseGeometry]]] = product(*candidates)
|
||||
first, second = problem.nets
|
||||
for index, net in enumerate(problem.nets):
|
||||
if net.net_id in problem.initial_paths or not links[1 - index]:
|
||||
continue
|
||||
peer_link = links[1 - index][0]
|
||||
peer = problem.nets[1 - index]
|
||||
fixed = FixedRoute(peer.net_id, tuple(shapely.get_parts(peer_link[1])))
|
||||
reserved = replace(problem, nets=(net,), initial_paths={}, fixed_routes=(*problem.fixed_routes, fixed))
|
||||
detours = footprints(net, (seed for _, seed in islice(perimeter_detour_candidates(reserved, options.search), 16)))
|
||||
reserved_pairs = product(detours, (peer_link,)) if index == 0 else product((peer_link,), detours)
|
||||
pairs = chain(pairs, reserved_pairs)
|
||||
|
||||
for (first_seed, first_shape), (second_seed, second_shape) in pairs:
|
||||
def reserved_pairs() -> Iterator[tuple[tuple[PathSeed, BaseGeometry], tuple[PathSeed, BaseGeometry]]]:
|
||||
for index, net in enumerate(problem.nets):
|
||||
if net.net_id in problem.initial_paths or not links[1 - index]:
|
||||
continue
|
||||
peer_link = links[1 - index][0]
|
||||
peer = problem.nets[1 - index]
|
||||
fixed = FixedRoute(peer.net_id, tuple(shapely.get_parts(peer_link[1])))
|
||||
reserved = replace(problem, nets=(net,), initial_paths={}, fixed_routes=(*problem.fixed_routes, fixed))
|
||||
detours = footprints(net, (seed for _, seed in islice(perimeter_detour_candidates(reserved, options.search), 16)))
|
||||
yield from product(detours, (peer_link,)) if index == 0 else product((peer_link,), detours)
|
||||
|
||||
for (first_seed, first_shape), (second_seed, second_shape) in chain(product(*candidates), reserved_pairs()):
|
||||
if _violates_net_clearance(first_shape, second_shape, problem.clearance):
|
||||
continue
|
||||
plan = replace(problem, initial_paths={first.net_id: first_seed, second.net_id: second_seed})
|
||||
|
|
|
|||
Loading…
Reference in a new issue