[pather / planner] pass planner options via plan_options, not strategy/bend_policy

This commit is contained in:
Jan Petykiewicz 2026-08-27 10:52:43 -07:00
commit ce7463e57c
8 changed files with 280 additions and 115 deletions

View file

@ -349,7 +349,7 @@ class MyTool(Tool):
```
Routing entry points now name every supported route argument explicitly.
Custom per-route planning values must be placed under `tool_options`:
Custom per-route Tool values must be placed under `tool_options`:
```python
pather.jog('A', 4, length=10, tool_options={'process_corner': 'slow'})
@ -453,14 +453,22 @@ import it from user code.
`trace_into()` uses the same primitive-offer route selection and defaults to
the minimal main-route bend count required by the endpoint relationship: zero
for a straight, one for a quarter-turn, and two for S- and U-like connections.
Ptype adapters do not consume this bend budget. Set `bend_policy='flexible'`
to search bounded route topologies with up to four bend roles, including
dogleg and loop-like fallbacks. Bend-family requests then search one-bend
routes before three-bend routes; other families search zero-to-two-bend routes
before four-bend routes. The first band with a legal route wins. Within that
band, candidates are ordered by total primitive-offer cost, adapter count,
step count, and deterministic discovery order. The route `strategy` affects
only that final discovery-order tie-break.
Ptype adapters do not consume this bend budget. Set
`plan_options={'bend_policy': 'flexible'}` to search bounded route topologies
with up to four bend roles, including dogleg and loop-like fallbacks.
Bend-family requests then search one-bend routes before three-bend routes;
other families search zero-to-two-bend routes before four-bend routes. The
first band with a legal route wins. Within that band, candidates are ordered
by total primitive-offer cost, adapter count, step count, and deterministic
discovery order. The default planner's `strategy` option affects only that
final discovery-order tie-break and is also supplied through `plan_options`.
`plan_options` is reserved for planner-specific per-route policy, while
`tool_options` is forwarded only to `Tool.primitive_offers()`. For example:
```python
pather.jog('A', 4, length=10, plan_options={'strategy': 'turn_first'})
```
Explicit-length `jog()` routes may also be satisfied by composing a straight
primitive before or after an omitted-length native S primitive. `uturn()` routes