Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <bop_portfolio.h>
Public Member Functions | |
PortfolioOptimizer (const ProblemState &problem_state, const BopParameters ¶meters, const BopSolverOptimizerSet &optimizer_set, absl::string_view name) | |
~PortfolioOptimizer () override | |
bool | ShouldBeRun (const ProblemState &problem_state) const override |
Status | Optimize (const BopParameters ¶meters, const ProblemState &problem_state, LearnedInfo *learned_info, TimeLimit *time_limit) override |
Public Member Functions inherited from operations_research::bop::BopOptimizerBase | |
BopOptimizerBase (absl::string_view name) | |
virtual | ~BopOptimizerBase () |
const std::string & | name () const |
Returns the name given at construction. | |
Additional Inherited Members | |
Public Types inherited from operations_research::bop::BopOptimizerBase | |
enum | Status { OPTIMAL_SOLUTION_FOUND , SOLUTION_FOUND , INFEASIBLE , LIMIT_REACHED , INFORMATION_FOUND , CONTINUE , ABORT } |
Static Public Member Functions inherited from operations_research::bop::BopOptimizerBase | |
static std::string | GetStatusString (Status status) |
Returns a string describing the status. | |
Protected Attributes inherited from operations_research::bop::BopOptimizerBase | |
const std::string | name_ |
StatsGroup | stats_ |
This class implements a portfolio optimizer. The portfolio currently includes all the following optimizers:
At each call of Optimize(), the portfolio optimizer selects the next optimizer to run and runs it. The selection is auto-adaptative, meaning that optimizers that succeeded more in the previous calls to Optimizer() are more likely to be selected.
Definition at line 69 of file bop_portfolio.h.
operations_research::bop::PortfolioOptimizer::PortfolioOptimizer | ( | const ProblemState & | problem_state, |
const BopParameters & | parameters, | ||
const BopSolverOptimizerSet & | optimizer_set, | ||
absl::string_view | name ) |
Definition at line 83 of file bop_portfolio.cc.
|
override |
Definition at line 100 of file bop_portfolio.cc.
|
overridevirtual |
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.
ABORT means that this optimizer can't be run until we found a new solution.
The gain is defined as 1 for the first solution.
Stop the portfolio optimizer after too many unsuccessful calls.
Implements operations_research::bop::BopOptimizerBase.
Definition at line 145 of file bop_portfolio.cc.
|
inlineoverridevirtual |
Returns true if this optimizer should be run on the given problem state. Some optimizer requires a feasible solution to run for instance.
Implements operations_research::bop::BopOptimizerBase.
Definition at line 77 of file bop_portfolio.h.