extract to the helper so we can easily toggle the knobs

This commit is contained in:
Adrian Manteza
2022-03-03 22:01:32 +00:00
parent ef63ef4e02
commit bacc478b3e
3 changed files with 17 additions and 12 deletions

View File

@ -82,3 +82,9 @@ def get_random_bundles(total_form_items: int,
return selected_bundles
else:
return get_random_bundles(total_form_items, total_bundles - 1, bundles)
def elasticize_constraint(lp_constraint, parameters = {}):
penalty = parameters.get('penalty', 1) # could be a 100% penalty
proportionFreeBound = parameters.get('proportionFreeBound', 0.25)
return lp_constraint.makeElasticSubProblem(penalty=penalty, proportionFreeBound=proportionFreeBound)