fixup! clean up magic numbers, enable arbitrary gridding, add cache invalidatino
This commit is contained in:
parent
519dd48131
commit
457451d3b2
6 changed files with 15 additions and 14 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 101 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 80 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 90 KiB |
|
|
@ -19,7 +19,7 @@ def main() -> None:
|
|||
danger_map.precompute([])
|
||||
|
||||
evaluator = CostEvaluator(engine, danger_map, bend_penalty=50.0, sbend_penalty=150.0)
|
||||
context = AStarContext(evaluator, snap_size=1.0, bend_radii=[10.0])
|
||||
context = AStarContext(evaluator, snap_size=1.0, bend_radii=[10.0], sbend_radii=[])
|
||||
metrics = AStarMetrics()
|
||||
pf = PathFinder(context, metrics)
|
||||
|
||||
|
|
@ -37,10 +37,10 @@ def main() -> None:
|
|||
# (Just for demonstration - we override the collision model during search)
|
||||
# Define a custom centered 20x20 box
|
||||
custom_poly = Polygon([(-10, -10), (10, -10), (10, 10), (-10, 10)])
|
||||
|
||||
|
||||
print("Routing with custom collision model...")
|
||||
# Override bend_collision_type with a literal Polygon
|
||||
context_custom = AStarContext(evaluator, snap_size=1.0, bend_radii=[10.0], bend_collision_type=custom_poly)
|
||||
context_custom = AStarContext(evaluator, snap_size=1.0, bend_radii=[10.0], bend_collision_type=custom_poly, sbend_radii=[])
|
||||
metrics_custom = AStarMetrics()
|
||||
results_custom = PathFinder(context_custom, metrics_custom, use_tiered_strategy=False).route_all(
|
||||
{"custom_model": netlist["custom_bend"]}, {"custom_model": 2.0}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue