From 7cf182cf46233c162e1ace4640c24f55d1bfda01 Mon Sep 17 00:00:00 2001 From: Masato Onodera Date: Tue, 25 Aug 2026 17:38:57 +0900 Subject: [PATCH] Charge the assignment arc cost to the objective only once tcost accumulates vis_cost, cobraMoveCost and blackDotPenalty in turn, but f*tcost was added to the objective both before and after the black-dot term, so the visibility and cobra-move contributions were counted twice: an arc cost 2*(vis_cost + cobraMoveCost) + blackDotPenalty instead of (vis_cost + cobraMoveCost) + blackDotPenalty. The duplicate dates back to dd6695f, which introduced the black-spot penalty along with a second accumulation rather than moving the existing one. Note that this changes results wherever vis_cost or cobraMoveCost is nonzero: both now carry their configured weight relative to nonObservationCost, partialObservationCost and blackDotPenalty instead of twice that weight. FIBERALLOC-64 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01CsehUfGABWV8uBhVQWUBet --- ets_fiber_assigner/netflow.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ets_fiber_assigner/netflow.py b/ets_fiber_assigner/netflow.py index 445cbd8..d4d75d1 100644 --- a/ets_fiber_assigner/netflow.py +++ b/ets_fiber_assigner/netflow.py @@ -580,7 +580,6 @@ def buildProblem(bench, targets, tpos, classdict, tvisit, vis_cost=None, if cobraMoveCost is not None: dist = np.abs(bench.cobras.centers[cidx]-tpos[ivis][tidx]) tcost += cobraMoveCost(dist) - prob.cost += f*tcost if blackDotPenalty is not None: dist = np.min(np.abs(closestDotsList[cidx]-tpos[ivis][tidx])) tcost += blackDotPenalty(dist)