Skip to content

Commit 9cf95f7

Browse files
committed
all vars to solver
1 parent 325a53e commit 9cf95f7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pycona/query_generation/pqgen_solve.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def generate(self, X=None):
105105

106106
m = cp.Model(Cl)
107107
s = cp.SolverLookup.get("ortools", m)
108+
s.user_vars = set(X)
108109

109110
if len(B) > self.blimit:
110111
# Sort constraints by probability and take first 5000 with highest probability
@@ -158,12 +159,13 @@ def generate(self, X=None):
158159
else: # no solution was found with the most probable constraints, so we need to solve with the original constraints
159160
m = cp.Model(Cl)
160161
s = cp.SolverLookup.get("ortools", m)
162+
s.user_vars = set(X)
161163
restore_scope_values(X, values)
162164

163165
### Third solve with objective ###
164166
if self.time_limit - t2 <= 0:
165167
return X
166-
168+
167169
if self.env.verbose > 2:
168170
print("Solving with objective...")
169171

0 commit comments

Comments
 (0)