added constant drift incrementing for tcc, tif values
This commit is contained in:
@ -49,27 +49,6 @@ def build_constraints(solver_run: SolverRun, problem: LpProblem,
|
||||
bundles[bundle.id] for bundle in solver_run.bundles
|
||||
]) == randint(int(constraint.minimum),
|
||||
int(constraint.maximum))
|
||||
# total_bundle_items = 0
|
||||
# selected_bundles = get_random_bundles(solver_run.total_form_items, solver_run.bundles, int(constraint.minimum), int(constraint.maximum))
|
||||
|
||||
# for bundle in selected_bundles:
|
||||
# con = dict(zip([item.id for item in solver_run.items],
|
||||
# [(getattr(item, bundle.type, False) == bundle.id)
|
||||
# for item in solver_run.items]))
|
||||
# problem += lpSum([con[item.id]
|
||||
# * items[item.id]
|
||||
# for item in solver_run.items]) == bundle.count, f'Bundle constraint for {bundle.type} ({bundle.id})'
|
||||
# total_bundle_items += bundle.count
|
||||
|
||||
# # make sure all other items added to the form
|
||||
# # are not a part of any bundle
|
||||
# # currently only supports single bundle constraints, will need refactoring for multiple bundle constraints
|
||||
# con = dict(zip([item.id for item in solver_run.items],
|
||||
# [(getattr(item, attribute.id, None) == None)
|
||||
# for item in solver_run.items]))
|
||||
# problem += lpSum([con[item.id]
|
||||
# * items[item.id]
|
||||
# for item in solver_run.items]) == solver_run.total_form_items - total_bundle_items, f'Remaining items are not of a bundle type'
|
||||
|
||||
logging.info('Constraints Created...')
|
||||
return problem
|
||||
|
Reference in New Issue
Block a user