Skip to content

Commit 0337641

Browse files
committed
Revert "Added stop_search method - closes #46"
This reverts commit 6df118b.
1 parent 8ec7843 commit 0337641

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
## 0.10.2 (unreleased)
2-
3-
- Added `stop_search` method to `CpSolverSolutionCallback`
4-
51
## 0.10.1 (2023-03-20)
62

73
- Added `domain` method to `SatIntVar`

ext/or-tools/constraint.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#include <google/protobuf/text_format.h>
22
#include <ortools/sat/cp_model.h>
3-
#include <ortools/util/time_limit.h>
43

54
#include "ext.h"
65

76
using operations_research::Domain;
8-
using operations_research::TimeLimit;
97
using operations_research::sat::BoolVar;
108
using operations_research::sat::Constraint;
119
using operations_research::sat::CpModelBuilder;
@@ -405,19 +403,15 @@ void init_constraint(Rice::Module& m) {
405403
[](Object self, CpModelBuilder& model, SatParameters& parameters, Object callback) {
406404
Model m;
407405

408-
std::atomic<bool> stopped(false);
409-
m.GetOrCreate<TimeLimit>()->RegisterExternalBooleanAsLimit(&stopped);
410-
411406
if (!callback.is_nil()) {
412407
// TODO figure out how to use callback with multiple cores
413408
parameters.set_num_search_workers(1);
414409

415410
m.Add(NewFeasibleSolutionObserver(
416-
[callback, &stopped](const CpSolverResponse& r) {
411+
[callback](const CpSolverResponse& r) {
417412
// TODO find a better way to do this
418413
callback.call("response=", r);
419414
callback.call("on_solution_callback");
420-
stopped = callback.attr_get("@stopped");
421415
})
422416
);
423417
}

lib/or_tools/cp_solver_solution_callback.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,5 @@ def value(expr)
1616
def objective_value
1717
@response.objective_value
1818
end
19-
20-
def stop_search
21-
@stopped = true
22-
end
2319
end
2420
end

0 commit comments

Comments
 (0)