Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <bop_base.h>
Public Types | |
enum | Status { OPTIMAL_SOLUTION_FOUND , SOLUTION_FOUND , INFEASIBLE , LIMIT_REACHED , INFORMATION_FOUND , CONTINUE , ABORT } |
Public Member Functions | |
BopOptimizerBase (absl::string_view name) | |
virtual | ~BopOptimizerBase () |
const std::string & | name () const |
Returns the name given at construction. | |
virtual bool | ShouldBeRun (const ProblemState &problem_state) const =0 |
virtual Status | Optimize (const BopParameters ¶meters, const ProblemState &problem_state, LearnedInfo *learned_info, TimeLimit *time_limit)=0 |
Static Public Member Functions | |
static std::string | GetStatusString (Status status) |
Returns a string describing the status. | |
Protected Attributes | |
const std::string | name_ |
StatsGroup | stats_ |
Base class used to optimize a ProblemState. Optimizers implementing this class are used in a sort of portfolio and are run sequentially or concurrently. See for instance BopRandomLNSOptimizer.
Definition at line 48 of file bop_base.h.
Return status of the Optimize() function below.
Enumerator | |
---|---|
OPTIMAL_SOLUTION_FOUND | |
SOLUTION_FOUND | |
INFEASIBLE | |
LIMIT_REACHED | |
INFORMATION_FOUND | Some information was learned and the problem state will need to be updated. This will trigger a new optimization round.
|
CONTINUE | This optimizer didn't learn any information yet but can be called again on the same problem state to resume its work. |
ABORT | There is no need to call this optimizer again on the same problem state. |
Definition at line 69 of file bop_base.h.
|
explicit |
Definition at line 44 of file bop_base.cc.
|
virtual |
Definition at line 49 of file bop_base.cc.
|
static |
Returns a string describing the status.
Fallback. We don't use "default:" so the compiler will return an error if we forgot one enum case above.
Definition at line 53 of file bop_base.cc.
|
inline |
Returns the name given at construction.
Definition at line 54 of file bop_base.h.
|
pure virtual |
Tries to infer more information about the problem state, i.e. reduces the gap by increasing the lower bound or finding a better solution. Returns SOLUTION_FOUND when a new solution with a better objective cost is found before a time limit. The learned information is cleared and the filled with any new information about the problem, e.g. a new lower bound.
Preconditions: ShouldBeRun() must returns true.
Implemented in operations_research::bop::BopRandomFirstSolutionGenerator, operations_research::bop::GuidedSatFirstSolutionGenerator, operations_research::bop::LinearRelaxation, operations_research::bop::PortfolioOptimizer, and operations_research::bop::SatCoreBasedOptimizer.
|
pure virtual |
Returns true if this optimizer should be run on the given problem state. Some optimizer requires a feasible solution to run for instance.
Implemented in operations_research::bop::BopRandomFirstSolutionGenerator, operations_research::bop::GuidedSatFirstSolutionGenerator, operations_research::bop::LinearRelaxation, operations_research::bop::PortfolioOptimizer, and operations_research::bop::SatCoreBasedOptimizer.
|
protected |
Definition at line 106 of file bop_base.h.
|
mutableprotected |
Definition at line 108 of file bop_base.h.