Skip to content

Commit

Permalink
No workers
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 6, 2024
1 parent eeb733e commit ac245a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ext/or-tools/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,12 @@ void init_constraint(Rice::Module& m) {
[](Object self, CpModelBuilder& model, SatParameters& parameters, Object callback) {
Model m;

auto model_proto = model.Build();

std::atomic<bool> stopped(false);

parameters.set_num_search_workers(1);
parameters.set_num_search_workers(0);
parameters.set_num_workers(0);
m.Add(NewSatParameters(parameters));
m.GetOrCreate<TimeLimit>()->RegisterExternalBooleanAsLimit(&stopped);

Expand All @@ -446,7 +449,7 @@ void init_constraint(Rice::Module& m) {
);
}

return SolveCpModel(model.Build(), &m);
return SolveCpModel(model_proto, &m);
})
.define_method(
"_solution_integer_value",
Expand Down

0 comments on commit ac245a4

Please sign in to comment.