Loading...
Searching...
No Matches
CutPool.h
1//
2// Created by Henri on 30/03/2026.
3//
4
5#ifndef IDOL_CUTPOOL_H
6#define IDOL_CUTPOOL_H
7#include <list>
8
9#include "idol/general/utils/Point.h"
10#include "idol/mixed-integer/modeling/constraints/Ctr.h"
11
12namespace idol {
13 class CutPool;
14}
15
17
18 struct CutHistory {
19 idol::Ctr cut;
20 unsigned int age = 0;
21 unsigned int n_active = 0;
22 CutHistory(Ctr t_cut);
23 };
24
25 const unsigned int m_min_age = 10;
26 const double m_min_activity_threshold = .2;
27 const unsigned int m_max_pool_size = 20000;
28 std::list<CutHistory> m_cuts_in_relaxation;
29 std::list<Ctr> m_all_cuts;
30
31 bool add_existing_cut_to_relaxation(const Ctr& t_cut, Model& t_relaxation);
32public:
33 bool add_cut(const TempCtr& t_cut, Model& t_relaxation);
34 unsigned int recycle(const PrimalPoint& t_current_point, Model& t_relaxation, double t_tol_feasibility);
35 void clean_up(Model& t_relaxation);
36
37 static double cosine(const Env& t_env, const Ctr& t_cut1, const Ctr& t_cut2);
38};
39
40#endif //IDOL_CUTPOOL_H