Skip to content

Commit 83a6a7f

Browse files
committed
Merge branch 'main' into fix-generalization-queries-algorithms
2 parents 8d051c7 + 1078448 commit 83a6a7f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pycona/query_generation/pqgen.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,17 @@ def generate(self, X=None):
102102
if len(Cl) == 0:
103103
Cl = [cp.sum(Y) >= 1]
104104

105+
m = cp.Model(Cl)
106+
s = cp.SolverLookup.get("ortools", m)
107+
105108
if not self.partial and len(B) > self.blimit:
106109

107-
m = cp.Model(Cl)
108-
flag = m.solve(num_workers=8) # no time limit to ensure convergence
110+
flag = s.solve(num_workers=8) # no time limit to ensure convergence
109111

110112
if flag and not all([c.value() for c in B]):
111113
return lY
112114
else:
113115
self.partial = True
114-
115-
m = cp.Model(Cl)
116-
s = cp.SolverLookup.get("ortools", m)
117116

118117
# We want at least one constraint to be violated to assure that each answer of the user
119118
# will lead to new information

0 commit comments

Comments
 (0)