just a few typo fixes

This commit is contained in:
Josh Burman
2021-12-17 21:55:16 +00:00
parent b7ba14bd43
commit 8ad4729a0d

View File

@ -25,7 +25,7 @@ def build_constraints(solver_run, problem, items):
* items[item.id] * items[item.id]
for item in solver_run.items]) <= round(total_form_items * (max / 100)), f'{attribute.id} - {attribute.value} - max' for item in solver_run.items]) <= round(total_form_items * (max / 100)), f'{attribute.id} - {attribute.value} - max'
elif attribute.type == 'bundle': elif attribute.type == 'bundle':
# # TODO: account for many different bundle types, since the id condition in L33 could yield duplicates # TODO: account for many different bundle types, since the id condition in L33 could yield duplicates
total_bundles = randint(constraint.minimum, constraint.maximum) total_bundles = randint(constraint.minimum, constraint.maximum)
selected_bundles = sample(solver_run.bundles, total_bundles) selected_bundles = sample(solver_run.bundles, total_bundles)
total_bundle_items = 0 total_bundle_items = 0
@ -41,7 +41,7 @@ def build_constraints(solver_run, problem, items):
# make sure all other items added to the form # make sure all other items added to the form
# are not a part of any bundle # are not a part of any bundle
# currently only supports single bundle constrains, will need refactoring for multiple bundle constraints # currently only supports single bundle constraints, will need refactoring for multiple bundle constraints
con = dict(zip([item.id for item in solver_run.items], con = dict(zip([item.id for item in solver_run.items],
[(getattr(item, attribute.id, None) == None) [(getattr(item, attribute.id, None) == None)
for item in solver_run.items])) for item in solver_run.items]))