[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

@ -350,11 +350,16 @@ class Solver:
)
def offer_key(offer: PrimitiveOffer) -> tuple[Any, ...]:
cost_key: tuple[str, float | int]
if callable(offer.cost):
cost_key = ('callable', id(offer.cost))
else:
cost_key = ('factor', round(float(offer.cost), 9))
return (
type(offer).__qualname__,
offer.in_ptype,
offer.out_ptype,
round(float(offer.priority_bias), 9),
cost_key,
tuple(round(float(value), 9) for value in offer.parameter_domain),
getattr(offer, 'ccw', None),
id(offer.endpoint_planner),