diff --git a/ChangeLog b/ChangeLog index 1a15db6..00639b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,17 @@ 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.6: + adjust to cobraOps 2.0.6 + - simpler bench creation + - new parameter "fiducialsAvoidDistance" + (no JIRA issue, since this is a temporary measure and will be + replaced in the future) + - v3.5: https://pfs-jira.naoj.org/jira/browse/FIBERALLOC-59 (add support for cobraOps parameter "brokenCobrasMargin") diff --git a/ets_fiber_assigner/netflow.py b/ets_fiber_assigner/netflow.py index bb9db53..ded340c 100644 --- a/ets_fiber_assigner/netflow.py +++ b/ets_fiber_assigner/netflow.py @@ -266,6 +266,7 @@ def buildProblem(bench, targets, tpos, classdict, tvisit, vis_cost=None, cobraSafetyMargin=0., cobraFeatureFlags=None, brokenCobrasMargin=0., + targetCostOffset=None, fiducialsAvoidDistance=0): """Build the ILP problem for a given observation task @@ -406,10 +407,15 @@ 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. fiducialsAvoidDistance: float, optional The distance in mm to use to avoid collisions with the fiducial fibers. Default is 0, which means that targets will not be invalidated based on their distance to the fiducials. + Returns ======= LPProblem : the ILP problem object @@ -539,6 +545,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)