[AutoTool | PrimitiveOffer] remove priority_bias in favor of cost_at

This commit is contained in:
Jan Petykiewicz 2026-07-13 12:25:08 -07:00
commit 8712398990
4 changed files with 85 additions and 45 deletions

View file

@ -178,7 +178,7 @@ class PrimitiveWireTool(Tool):
def _transition_offers(self, in_ptype: str | None) -> tuple[StraightOffer, ...]:
offers: list[StraightOffer] = []
for index, spec in enumerate(self.transitions):
for spec in self.transitions:
if spec.out_port.ptype != self.ptype:
continue
if in_ptype not in (None, 'unk', spec.in_port.ptype):
@ -208,7 +208,6 @@ class PrimitiveWireTool(Tool):
offers.append(StraightOffer(
in_ptype = spec.in_port.ptype,
out_ptype = spec.out_port.ptype,
priority_bias = index * 1e7,
length_domain = (length, length),
endpoint_planner = endpoint_planner,
commit_planner = commit_planner,
@ -220,7 +219,7 @@ class PrimitiveWireTool(Tool):
return ()
offers: list[StraightOffer] = []
for index, spec in enumerate(self.transitions):
for spec in self.transitions:
if spec.in_port.ptype != self.ptype:
continue
if out_ptype is not None and spec.out_port.ptype != out_ptype:
@ -255,7 +254,6 @@ class PrimitiveWireTool(Tool):
offers.append(StraightOffer(
in_ptype = self.ptype,
out_ptype = spec.out_port.ptype,
priority_bias = index * 1e7,
length_domain = (transition_length, numpy.inf),
endpoint_planner = endpoint_planner,
commit_planner = commit_planner,