logfest 2059
This commit is contained in:
parent
78331577dc
commit
2576c982e0
@ -7,6 +7,8 @@ from models.bundle import Bundle
|
|||||||
from lib.errors.item_generation_error import ItemGenerationError
|
from lib.errors.item_generation_error import ItemGenerationError
|
||||||
|
|
||||||
def build_constraints(solver_run, problem, items, bundles):
|
def build_constraints(solver_run, problem, items, bundles):
|
||||||
|
logging.info('Creating Constraints...')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
total_form_items = solver_run.total_form_items
|
total_form_items = solver_run.total_form_items
|
||||||
constraints = solver_run.constraints
|
constraints = solver_run.constraints
|
||||||
@ -53,6 +55,7 @@ def build_constraints(solver_run, problem, items, bundles):
|
|||||||
* items[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'
|
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
|
return problem
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
logging.error(error)
|
logging.error(error)
|
||||||
|
@ -53,6 +53,8 @@ class LoftService(Base):
|
|||||||
return solver_run
|
return solver_run
|
||||||
|
|
||||||
def generate_solution(self):
|
def generate_solution(self):
|
||||||
|
logging.info('Generating Solution...')
|
||||||
|
|
||||||
# unsolved solution
|
# unsolved solution
|
||||||
solution = Solution(
|
solution = Solution(
|
||||||
response_id=random.randint(100, 5000),
|
response_id=random.randint(100, 5000),
|
||||||
@ -116,6 +118,7 @@ class LoftService(Base):
|
|||||||
# successfull form, increment
|
# successfull form, increment
|
||||||
f += 1
|
f += 1
|
||||||
|
|
||||||
|
logging.info('Solution Generated.')
|
||||||
return solution
|
return solution
|
||||||
|
|
||||||
def stream_to_s3_bucket(self, error = None):
|
def stream_to_s3_bucket(self, error = None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user