but when removing enemy constraints
This commit is contained in:
@ -8,7 +8,6 @@ from pulp import LpProblem, LpVariable, LpStatus, lpSum
|
||||
import logging
|
||||
|
||||
from helpers.problem_helper import *
|
||||
|
||||
from helpers import service_helper
|
||||
|
||||
from models.solution import Solution
|
||||
@ -67,8 +66,8 @@ class Problem(BaseModel):
|
||||
logging.info('enemies found, adding constraints...')
|
||||
|
||||
# remove old enemy/sacred constraints
|
||||
self.problem.constraints.pop('Exclude_enemy_items')
|
||||
self.problem.constraints.pop('Include_sacred_items')
|
||||
if 'Exclude_enemy_items' in self.problem.constraints.keys(): self.problem.constraints.pop('Exclude_enemy_items')
|
||||
if 'Include_sacred_items' in self.problem.constraints.keys(): self.problem.constraints.pop('Include_sacred_items')
|
||||
|
||||
# add constraint to not allow enemy items
|
||||
self.problem += lpSum([
|
||||
|
Reference in New Issue
Block a user