logfest 2059

This commit is contained in:
Joshua Burman 2022-02-09 17:38:26 -05:00
parent 78331577dc
commit 2576c982e0
2 changed files with 6 additions and 0 deletions

@ -7,6 +7,8 @@ from models.bundle import Bundle
from lib.errors.item_generation_error import ItemGenerationError
def build_constraints(solver_run, problem, items, bundles):
logging.info('Creating Constraints...')
try:
total_form_items = solver_run.total_form_items
constraints = solver_run.constraints
@ -53,6 +55,7 @@ def build_constraints(solver_run, problem, items, bundles):
* 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
except ValueError as error:
logging.error(error)

@ -53,6 +53,8 @@ class LoftService(Base):
return solver_run
def generate_solution(self):
logging.info('Generating Solution...')
# unsolved solution
solution = Solution(
response_id=random.randint(100, 5000),
@ -116,6 +118,7 @@ class LoftService(Base):
# successfull form, increment
f += 1
logging.info('Solution Generated.')
return solution
def stream_to_s3_bucket(self, error = None):