Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <model_builder_helper.h>
Public Member Functions | |
ModelSolverHelper (const std::string &solver_name) | |
bool | SolverIsSupported () const |
void | Solve (const ModelBuilderHelper &model) |
std::optional< MPSolutionResponse > | SolveRequest (const MPModelRequest &request) |
Only used by the CVXPY interface. Does not store the response internally. | |
bool | InterruptSolve () |
void | SetLogCallback (std::function< void(const std::string &)> log_callback) |
void | SetLogCallbackFromDirectorClass (MbLogCallback *log_callback) |
void | ClearLogCallback () |
bool | has_response () const |
bool | has_solution () const |
const MPSolutionResponse & | response () const |
SolveStatus | status () const |
double | objective_value () const |
If not defined, or no solution, they will silently return 0. | |
double | best_objective_bound () const |
double | variable_value (int var_index) const |
double | reduced_cost (int var_index) const |
double | dual_value (int ct_index) const |
double | activity (int ct_index) |
std::string | status_string () const |
double | wall_time () const |
double | user_time () const |
void | SetTimeLimitInSeconds (double limit) |
Solve parameters. | |
void | SetSolverSpecificParameters (const std::string &solver_specific_parameters) |
void | EnableOutput (bool enabled) |
Class used to solve a request. This class is not meant to be exposed to the public. Its responsibility is to bridge the MPModelProto in the non-C++ languages with the C++ Solve method.
It contains 2 helper objects: a logger, and an atomic bool to interrupt search.
Definition at line 166 of file model_builder_helper.h.
|
explicit |
Definition at line 517 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::activity | ( | int | ct_index | ) |
Definition at line 724 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::best_objective_bound | ( | ) | const |
Definition at line 701 of file model_builder_helper.cc.
void operations_research::ModelSolverHelper::ClearLogCallback | ( | ) |
Definition at line 667 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::dual_value | ( | int | ct_index | ) | const |
Definition at line 718 of file model_builder_helper.cc.
void operations_research::ModelSolverHelper::EnableOutput | ( | bool | enabled | ) |
Definition at line 769 of file model_builder_helper.cc.
bool operations_research::ModelSolverHelper::has_response | ( | ) | const |
Definition at line 675 of file model_builder_helper.cc.
bool operations_research::ModelSolverHelper::has_solution | ( | ) | const |
Definition at line 677 of file model_builder_helper.cc.
bool operations_research::ModelSolverHelper::InterruptSolve | ( | ) |
Returns true if the interrupt signal was correctly sent, that is if the underlying solver supports it.
Definition at line 669 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::objective_value | ( | ) | const |
If not defined, or no solution, they will silently return 0.
Definition at line 696 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::reduced_cost | ( | int | var_index | ) | const |
Definition at line 712 of file model_builder_helper.cc.
const MPSolutionResponse & operations_research::ModelSolverHelper::response | ( | ) | const |
Definition at line 685 of file model_builder_helper.cc.
void operations_research::ModelSolverHelper::SetLogCallback | ( | std::function< void(const std::string &)> | log_callback | ) |
Definition at line 655 of file model_builder_helper.cc.
void operations_research::ModelSolverHelper::SetLogCallbackFromDirectorClass | ( | MbLogCallback * | log_callback | ) |
Definition at line 660 of file model_builder_helper.cc.
void operations_research::ModelSolverHelper::SetSolverSpecificParameters | ( | const std::string & | solver_specific_parameters | ) |
Definition at line 764 of file model_builder_helper.cc.
void operations_research::ModelSolverHelper::SetTimeLimitInSeconds | ( | double | limit | ) |
Solve parameters.
Definition at line 760 of file model_builder_helper.cc.
void operations_research::ModelSolverHelper::Solve | ( | const ModelBuilderHelper & | model | ) |
std::optional< MPSolutionResponse > operations_research::ModelSolverHelper::SolveRequest | ( | const MPModelRequest & | request | ) |
Only used by the CVXPY interface. Does not store the response internally.
Definition at line 470 of file model_builder_helper.cc.
bool operations_research::ModelSolverHelper::SolverIsSupported | ( | ) | const |
Definition at line 527 of file model_builder_helper.cc.
SolveStatus operations_research::ModelSolverHelper::status | ( | ) | const |
Definition at line 689 of file model_builder_helper.cc.
std::string operations_research::ModelSolverHelper::status_string | ( | ) | const |
Definition at line 743 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::user_time | ( | ) | const |
Definition at line 754 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::variable_value | ( | int | var_index | ) | const |
Definition at line 706 of file model_builder_helper.cc.
double operations_research::ModelSolverHelper::wall_time | ( | ) | const |
Definition at line 748 of file model_builder_helper.cc.