idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
RENS.h
1//
2// Created by henri on 16.10.23.
3//
4
5#ifndef IDOL_RENS_H
6#define IDOL_RENS_H
7
8#include "idol/mixed-integer/optimizers/callbacks/CallbackFactory.h"
9#include "idol/mixed-integer/optimizers/callbacks/Callback.h"
10#include "idol/general/optimizers/OptimizerFactory.h"
11
12namespace idol::Heuristics {
13 class RENS;
14}
15
17
18 std::unique_ptr<OptimizerFactory> m_optimizer_factory;
19 double m_minimum_ratio_of_integer_variables_to_fix = .75;
20 double m_minimum_ratio_of_variables_to_fix = .25;
21
22 RENS(const RENS& t_src);
23public:
24 RENS() = default;
25
26 class Strategy : public Callback {
27 double m_minimum_ratio_of_integer_variables_to_fix;
28 double m_minimum_ratio_of_variables_to_fix;
29 std::unique_ptr<OptimizerFactory> m_optimizer_factory;
30 unsigned int m_n_relevant_calls = 0;
31 unsigned int m_frequency = 10;
32 protected:
33 void operator()(CallbackEvent t_event) override;
34 public:
35 Strategy(double t_minimum_ratio_of_integer_variables_to_fix,
36 double t_minimum_ratio_of_variables_to_fix,
37 OptimizerFactory* t_optimizer_factory);
38 };
39
40 Callback *operator()() override {
41
42 auto* result = new Strategy(m_minimum_ratio_of_integer_variables_to_fix,
43 m_minimum_ratio_of_variables_to_fix,
44 m_optimizer_factory->clone());
45
46 return result;
47 }
48
49 [[nodiscard]] CallbackFactory *clone() const override {
50 return new RENS(*this);
51 }
52
53 RENS& with_optimizer(const OptimizerFactory& t_optimizer_factory);
54
55};
56
57#endif //IDOL_RENS_H
void operator()(CallbackEvent t_event) override