14#ifndef OR_TOOLS_BOP_BOP_PORTFOLIO_H_
15#define OR_TOOLS_BOP_BOP_PORTFOLIO_H_
22#include "absl/strings/string_view.h"
73 absl::string_view
name);
94 int64_t state_update_stamp_;
96 std::unique_ptr<OptimizerSelector> selector_;
102 int number_of_consecutive_failing_optimizers_;
160 std::string
PrintStats(OptimizerIndex optimizer_index)
const;
169 void NewSolutionFound(int64_t gain);
172 void UpdateDeterministicTime(
double time_spent);
178 RunInfo(OptimizerIndex i, absl::string_view n)
179 : optimizer_index(i),
185 time_spent_since_last_solution(0),
190 bool RunnableAndSelectable()
const {
return runnable && selectable; }
192 OptimizerIndex optimizer_index;
198 double time_spent_since_last_solution;
204 std::vector<RunInfo> run_infos_;
BopOptimizerBase(absl::string_view name)
const std::string & name() const
Returns the name given at construction.
OptimizerIndex SelectOptimizer()
std::string PrintStats(OptimizerIndex optimizer_index) const
Returns statistics about the given optimizer.
void TemporarilyMarkOptimizerAsUnselectable(OptimizerIndex optimizer_index)
void SetOptimizerRunnability(OptimizerIndex optimizer_index, bool runnable)
void UpdateScore(int64_t gain, double time_spent)
int NumCallsForOptimizer(OptimizerIndex optimizer_index) const
void DebugPrint() const
Prints some debug information. Should not be used in production.
OptimizerSelector(const util_intops::StrongVector< OptimizerIndex, BopOptimizerBase * > &optimizers)
bool ShouldBeRun(const ProblemState &problem_state) const override
Status Optimize(const BopParameters ¶meters, const ProblemState &problem_state, LearnedInfo *learned_info, TimeLimit *time_limit) override
~PortfolioOptimizer() override
PortfolioOptimizer(const ProblemState &problem_state, const BopParameters ¶meters, const BopSolverOptimizerSet &optimizer_set, absl::string_view name)
util_intops::StrongVector< SparseIndex, BopConstraintTerm > BopConstraintTerms
const OptimizerIndex kInvalidOptimizerIndex(-1)
In SWIG mode, we don't want anything besides these top-level includes.
std::mt19937_64 random_engine_t
#define DEFINE_STRONG_INDEX_TYPE(index_type_name)