Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Recent changes to the ets_fiberalloc package,
in reverse chronological order:

yet unreleased:
https://pfs-jira.naoj.org/jira/browse/FIBERALLOC-61
(Allow perturbation of target observation cost)


- v3.5:
https://pfs-jira.naoj.org/jira/browse/FIBERALLOC-59
(add support for cobraOps parameter "brokenCobrasMargin")
Expand Down
9 changes: 8 additions & 1 deletion ets_fiber_assigner/netflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ def buildProblem(bench, targets, tpos, classdict, tvisit, vis_cost=None,
preassigned=None,
cobraSafetyMargin=0.,
cobraFeatureFlags=None,
brokenCobrasMargin=0.):
brokenCobrasMargin=0.,
targetCostOffset=None):
"""Build the ILP problem for a given observation task

Parameters
Expand Down Expand Up @@ -404,6 +405,10 @@ def buildProblem(bench, targets, tpos, classdict, tvisit, vis_cost=None,
This is given as a fraction of "brokenCobrasRmax", i.e. the maximum
patrol area radius of any broken Cobra.
Useful values should be in the range [0;1].
targetCostOffset: np.ndarray(float), same size as "targets"
per-target perturbation of the overall cost function, if this target
is observed. Used to break degeneracies and guarantee reproducible
assignments.

Returns
=======
Expand Down Expand Up @@ -533,6 +538,8 @@ def buildProblem(bench, targets, tpos, classdict, tvisit, vis_cost=None,
f = prob.addVar(makeName("STC_T", TC, tgt.ID), tmp, 1)
T_i[tidx].append(f)
STC_o[TC].append(f)
if targetCostOffset is not None and targetCostOffset[tidx] != 0:
prob.cost += f*targetCostOffset[tidx]
if len(STC_o[TC]) == 1: # freshly created
# Science Target class node to sink
f = prob.addVar(makeName("STC_sink", TC), 0, None)
Expand Down