fix for non bundles runs as well as some typing
This commit is contained in:
@ -25,7 +25,7 @@ class LoftService(Base):
|
||||
logging.error(error)
|
||||
self.result = self.stream_to_s3_bucket(ItemGenerationError("Provided params causing error in calculation results"))
|
||||
|
||||
def create_solver_run_from_attributes(self):
|
||||
def create_solver_run_from_attributes(self) -> SolverRun:
|
||||
logging.info('Retrieving attributes from message...')
|
||||
# get s3 object
|
||||
self.key = aws_helper.get_key_from_message(self.source)
|
||||
@ -52,7 +52,7 @@ class LoftService(Base):
|
||||
|
||||
return solver_run
|
||||
|
||||
def generate_solution(self):
|
||||
def generate_solution(self) -> Solution:
|
||||
logging.info('Generating Solution...')
|
||||
|
||||
# unsolved solution
|
||||
@ -70,8 +70,8 @@ class LoftService(Base):
|
||||
# setup vars
|
||||
items = LpVariable.dicts(
|
||||
"Item", [item.id for item in self.solver_run.items], lowBound=1, upBound=1, cat='Binary')
|
||||
bundles = LpVariable.dicts(
|
||||
"Bundle", [bundle.id for bundle in self.solver_run.bundles], lowBound=1, upBound=1, cat='Binary')
|
||||
# bundles = LpVariable.dicts(
|
||||
# "Bundle", [bundle.id for bundle in self.solver_run.bundles], lowBound=1, upBound=1, cat='Binary')
|
||||
|
||||
problem_objection_functions = []
|
||||
|
||||
@ -87,7 +87,7 @@ class LoftService(Base):
|
||||
for item in self.solver_run.items]) == self.solver_run.total_form_items, 'Total form items'
|
||||
|
||||
# dynamic constraints
|
||||
problem = solver_helper.build_constraints(self.solver_run, problem, items, bundles)
|
||||
problem = solver_helper.build_constraints(self.solver_run, problem, items)
|
||||
|
||||
# multi-objective constraints
|
||||
logging.info('Creating TIF and TCC constraints')
|
||||
|
Reference in New Issue
Block a user