You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, so I was trying to convert this code from Python to Ruby using the following employee scheduling guide here. Towards the end, the Python calls StopSearch, but this isn't available in this lib.
Duno if this is the right approach but I had some success adding this definition into constraint.cpp
#include <ortools/sat/swig_helper.h>
using operations_research::sat::SolutionCallback;
Rice::define_class_under<SolutionCallback>(m, "SolutionCallback")
.define_method("stop_search", &SolutionCallback::StopSearch);
then Updating cp_solver_solution_callback.rb to:
class CpSolverSolutionCallback < SolutionCallback
I could at least call the stop_search function in the NursesPartialSolutionPrinter from the guide. But I got stuck with the atomic bool here:
Hey, so I was trying to convert this code from Python to Ruby using the following employee scheduling guide here. Towards the end, the Python calls
StopSearch
, but this isn't available in this lib.Duno if this is the right approach but I had some success adding this definition into
constraint.cpp
then Updating
cp_solver_solution_callback.rb
to:I could at least call the
stop_search
function in theNursesPartialSolutionPrinter
from the guide. But I got stuck with the atomic bool here:https://github.com/google/or-tools/blob/5425dedcfbb22cb74c636c1374a9b5ad684b1eb5/ortools/sat/swig_helper.cc#L90
The CPP stuff is a bit beyond me, to be honest 😢.
Any chance the
stop_search
method could get added?The text was updated successfully, but these errors were encountered: