-
Type:
Task
-
Status: Done (View Workflow)
-
Priority:
Normal
-
Resolution: Done
-
Component/s: ets_fiberalloc
-
Labels:None
Problem
In ets_fiber_assigner/netflow.py, buildProblem() accumulates the per-arc
cost into the objective twice (lines 513 and 517):
tcost = vis_cost[ivis] if cobraMoveCost is not None: dist = np.abs(bench.cobras.centers[cidx]-tpos[ivis][tidx]) tcost += cobraMoveCost(dist) prob.cost += f*tcost # line 513 if blackDotPenalty is not None: dist = np.min(np.abs(closestDotsList[cidx]-tpos[ivis][tidx])) tcost += blackDotPenalty(dist) prob.cost += f*tcost # line 517
Because tcost accumulates, the visibility and cobra-move terms are charged
twice for every Tv_Cv arc. With blackDotPenalty configured, an arc
contributes:
actual: 2*(vis_cost + cobraMoveCost) + blackDotPenalty intended: (vis_cost + cobraMoveCost) + blackDotPenalty
Looking at the commit history, this seems a copy-paste leftover rather than deliberate weighting.
Impact
Affects every backend (Gurobi, HiGHS, PuLP). The visibility and cobra-move terms
carry double their configured weight relative to nonObservationCost,
partialObservationCost and blackDotPenalty, so the optimizer trades them
off differently than the configuration intends.
Proposed fix
Remove the first accumulation (line 513).
Note for review
This changes results wherever vis_cost or cobraMoveCost is nonzero:
correcting it effectively halves those terms relative to the other costs, and
fiber assignments will shift. If the cost functions were tuned empirically
against the current behavior, some caution has to be observed, or rescaling in the netflow would be preferable.