idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
PADM.h
1//
2// Created by henri on 18.09.24.
3//
4
5#ifndef IDOL_PADM_H
6#define IDOL_PADM_H
7
8#include "idol/general/optimizers/OptimizerFactory.h"
9#include "idol/mixed-integer/modeling/annotations/Annotation.h"
10#include "idol/general/utils/Map.h"
11#include "SubProblem.h"
12#include "Formulation.h"
13#include "PenaltyUpdates.h"
14#include "idol/mixed-integer/optimizers/callbacks/watchers/PlotManager.h"
15#include <optional>
16
17namespace idol {
18 class PADM;
19}
20
22public:
23 explicit PADM(Annotation<unsigned int> t_decomposition);
24
25 PADM(Annotation<unsigned int> t_decomposition, Annotation<double> t_penalized_constraints);
26
27 PADM(const PADM& t_src);
28 PADM(PADM&&) = default;
29
30 PADM& operator=(const PADM&) = delete;
31 PADM& operator=(PADM&&) = default;
32
33 PADM& with_default_sub_problem_spec(ADM::SubProblem t_sub_problem);
34
35 PADM& with_sub_problem_spec(unsigned int t_id, ADM::SubProblem t_sub_problem);
36
37 PADM& with_rescaling_threshold(double t_threshold);
38
39 PADM& with_penalty_update(const PenaltyUpdate& t_penalty_update);
40
41 PADM& with_feasible_solution_status(SolutionStatus t_status);
42
43 PADM& with_iteration_plot(Plots::Manager& t_manager);
44
45 Optimizer *operator()(const Model &t_model) const override;
46
47 [[nodiscard]] OptimizerFactory *clone() const override;
48private:
49 Annotation<unsigned int> m_decomposition;
50 std::optional<Annotation<double>> m_penalized_constraints;
51 std::optional<ADM::SubProblem> m_default_sub_problem_spec;
52 Map<unsigned int, ADM::SubProblem> m_sub_problem_specs;
53 std::optional<double> m_rescaling;
54 std::unique_ptr<PenaltyUpdate> m_penalty_update;
55 std::optional<SolutionStatus> m_feasible_solution_status;
56 std::optional<Plots::Manager*> m_plot_manager;
57
58 [[nodiscard]] std::vector<ADM::SubProblem> create_sub_problem_specs(const Model& t_model, const ADM::Formulation& t_formulation) const;
59};
60
61
62#endif //IDOL_PADM_H
OptimizerFactory * clone() const override
Optimizer * operator()(const Model &t_model) const override