Tighter A* estimate on the orthogonal track, and --heuristic-weight
The grid search estimated the remaining distance as a straight line even when only orthogonal steps exist; Manhattan is the tighter estimate those moves admit and still never overestimates. --heuristic-weight W (default 1) makes it weighted A*: routes at most W times the shortest (tested).
This commit is contained in:
@@ -150,6 +150,7 @@ def route_dsn_board_exact(
|
||||
dsn: DsnBoard,
|
||||
*,
|
||||
resolution: int = 1,
|
||||
heuristic_weight: float = 1.0,
|
||||
edge_clearance_mm: float | None = None,
|
||||
layers: list[int] | None = None,
|
||||
max_passes: int = 10,
|
||||
@@ -170,6 +171,7 @@ def route_dsn_board_exact(
|
||||
exact = route_board_exact(
|
||||
board,
|
||||
resolution=resolution,
|
||||
heuristic_weight=heuristic_weight,
|
||||
via_half=_via_half_board(dsn, scale),
|
||||
edge_clearance=edge_clearance_board,
|
||||
trace_width=width_board,
|
||||
@@ -187,6 +189,7 @@ def build_exact_routing_result(
|
||||
dsn: DsnBoard,
|
||||
*,
|
||||
resolution: int = 1,
|
||||
heuristic_weight: float = 1.0,
|
||||
layers: list[int] | None = None,
|
||||
shove: bool = False,
|
||||
diagonal: bool = False,
|
||||
@@ -204,6 +207,7 @@ def build_exact_routing_result(
|
||||
max_passes=max_passes,
|
||||
edge_clearance_mm=edge_clearance_mm,
|
||||
resolution=resolution,
|
||||
heuristic_weight=heuristic_weight,
|
||||
)
|
||||
return _to_routing_result(exact.result, dsn, scale, layer_names)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user