Skip to content

Commit e625699

Browse files
committed
Fix bad handling of SCIP limits. Close #98
1 parent 7775718 commit e625699

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

libecole/src/dynamics/branching.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ std::optional<xt::xtensor<std::size_t, 1>> action_set(scip::Model const& model,
3636

3737
auto BranchingDynamics::reset_dynamics(scip::Model& model) -> std::tuple<bool, ActionSet> {
3838
model.solve_iter();
39-
return {model.solve_iter_is_done(), action_set(model, pseudo_candidates)};
39+
auto const done = model.solve_iter_is_done();
40+
if (done) {
41+
return {done, {}};
42+
}
43+
return {done, action_set(model, pseudo_candidates)};
4044
}
4145

4246
auto BranchingDynamics::step_dynamics(scip::Model& model, std::size_t const& action) -> std::tuple<bool, ActionSet> {

libecole/src/scip/scimpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void Scimpl::solve_iter() {
8686
scip::call(
8787
SCIPincludeObjBranchrule,
8888
scip_ptr,
89-
new ReverseBranchrule(scip_ptr, weak_executor), // NOLINT
89+
new ReverseBranchrule(scip_ptr, std::move(weak_executor)), // NOLINT
9090
true);
9191
scip::call(SCIPsolve, scip_ptr); // NOLINT
9292
});

0 commit comments

Comments
 (0)