more gscip cleaning
This commit is contained in:
@@ -137,7 +137,7 @@ std::vector<std::string> SetSolveParameters(
|
||||
sat_parameters.set_random_seed(parameters.random_seed());
|
||||
}
|
||||
if (parameters.has_threads()) {
|
||||
sat_parameters.set_num_search_workers(parameters.threads());
|
||||
sat_parameters.set_num_workers(parameters.threads());
|
||||
}
|
||||
if (parameters.has_relative_gap_tolerance()) {
|
||||
sat_parameters.set_relative_gap_limit(parameters.relative_gap_tolerance());
|
||||
|
||||
@@ -225,7 +225,7 @@ SolutionHintTestParams MakeCpsatSolutionHintParams() {
|
||||
solve_params.cuts = Emphasis::kOff;
|
||||
solve_params.presolve = Emphasis::kOff;
|
||||
solve_params.cp_sat.set_stop_after_first_solution(true);
|
||||
solve_params.cp_sat.set_num_search_workers(1);
|
||||
solve_params.cp_sat.set_num_workers(1);
|
||||
// Matches "best:", "next:" and "hint" appearing in the same line
|
||||
std::string hint_message_regex = "best:.*next:.*hint";
|
||||
return SolutionHintTestParams(SolverType::kCpSat, solve_params, std::nullopt,
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "ortools/math_opt/solvers/glpk/rays.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -1093,8 +1093,7 @@ absl::StatusOr<SolveResultProto> GScipSolver::Solve(
|
||||
|
||||
ASSIGN_OR_RETURN(
|
||||
GScipResult gscip_result,
|
||||
gscip_->Solve(gscip_parameters,
|
||||
/*legacy_params=*/"", std::move(gscip_msg_cb),
|
||||
gscip_->Solve(gscip_parameters, std::move(gscip_msg_cb),
|
||||
use_interrupter ? &gscip_interrupter : nullptr));
|
||||
|
||||
// Flush the potential last unfinished line.
|
||||
|
||||
@@ -544,30 +544,35 @@ absl::StatusOr<TerminationProto> HighsSolver::MakeTermination(
|
||||
optional_finite_primal_objective,
|
||||
optional_dual_objective);
|
||||
case HighsModelStatus::kIterationLimit: {
|
||||
if (is_integer) {
|
||||
if (had_node_limit && had_solution_limit) {
|
||||
return LimitTerminationProto(
|
||||
is_maximize, LIMIT_UNDETERMINED, optional_finite_primal_objective,
|
||||
optional_dual_objective,
|
||||
"Both node limit and solution limit were requested, cannot "
|
||||
"determine reason for termination");
|
||||
} else if (had_node_limit) {
|
||||
return LimitTerminationProto(is_maximize, LIMIT_NODE,
|
||||
optional_finite_primal_objective,
|
||||
optional_dual_objective);
|
||||
} else if (had_solution_limit) {
|
||||
return LimitTerminationProto(is_maximize, LIMIT_SOLUTION,
|
||||
optional_finite_primal_objective,
|
||||
optional_dual_objective);
|
||||
}
|
||||
} else {
|
||||
// For LP, only the MathOpt iteration limit can cause highs to return
|
||||
// HighsModelStatus::kIterationLimit.
|
||||
return LimitTerminationProto(is_maximize, LIMIT_ITERATION,
|
||||
return LimitTerminationProto(is_maximize, LIMIT_ITERATION,
|
||||
optional_finite_primal_objective,
|
||||
optional_dual_objective);
|
||||
}
|
||||
case HighsModelStatus::kSolutionLimit: {
|
||||
if (had_node_limit && !had_solution_limit) {
|
||||
return LimitTerminationProto(is_maximize, LIMIT_NODE,
|
||||
optional_finite_primal_objective,
|
||||
optional_dual_objective);
|
||||
} else if (had_solution_limit && !had_node_limit) {
|
||||
return LimitTerminationProto(is_maximize, LIMIT_SOLUTION,
|
||||
optional_finite_primal_objective,
|
||||
optional_dual_objective);
|
||||
} else {
|
||||
return LimitTerminationProto(
|
||||
is_maximize, LIMIT_UNDETERMINED, optional_finite_primal_objective,
|
||||
optional_dual_objective,
|
||||
"HighsModelStatus was kSolutionLimit but cannot infer a MathOpt "
|
||||
"Limit, could be NODE_LIMIT or SOLUTION_LIMIT");
|
||||
}
|
||||
}
|
||||
case HighsModelStatus::kInterrupt:
|
||||
return LimitTerminationProto(is_maximize, LIMIT_INTERRUPTED,
|
||||
optional_finite_primal_objective,
|
||||
optional_dual_objective);
|
||||
case HighsModelStatus::kMemoryLimit:
|
||||
return LimitTerminationProto(
|
||||
is_maximize, LIMIT_OTHER, optional_finite_primal_objective,
|
||||
optional_dual_objective, "Highs hit kMemoryLimit");
|
||||
}
|
||||
return util::InternalErrorBuilder() << "HighsModelStatus unimplemented: "
|
||||
<< static_cast<int>(highs_model_status);
|
||||
|
||||
Reference in New Issue
Block a user