Loading...
Searching...
No Matches
Counterfactual_Instance.h
1//
2// Created by Henri on 22/04/2026.
3//
4
5#ifndef IDOL_COUNTERFACTUAL_H
6#define IDOL_COUNTERFACTUAL_H
7
8#include <string>
9#include <vector>
10
11#include "idol/bilevel/modeling/Description.h"
12
13namespace idol::Problems::Counterfactual {
14 class Instance;
15}
16
17namespace idol::Bilevel {
18 Description make_weak_CE_bilevel_model(Model& t_model, const Problems::Counterfactual::Instance& t_instance);
19};
20
22public:
23 Instance(std::string t_CE_filename, std::string t_mps_filename);
24
25 struct DesiredSpec {
26 unsigned int column = -1;
27 double lb = 0.0;
28 double ub = 0.0;
29 };
30
31 struct MutableCost {
32 unsigned int column = -1;
33 };
34
36 unsigned int row = -1;
37 unsigned int column = -1;
38 };
39
40 struct MutableRhs {
41 unsigned int row = -1;
42 };
43
44 [[nodiscard]] const std::vector<DesiredSpec>& desired_space() const { return m_desired_space; }
45
46 [[nodiscard]] const std::vector<MutableCost>& mutable_costs() const { return m_mutable_costs; }
47
48 [[nodiscard]] const std::vector<MutableCoefficient>& mutable_coefficients() const { return m_mutable_coefficients; }
49
50 [[nodiscard]] const std::vector<MutableRhs>& mutable_rhs() const { return m_mutable_rhs; }
51
52 [[nodiscard]] const std::string& CE_path() const { return m_CE_filename; }
53
54 [[nodiscard]] const std::string& mps_path() const { return m_mps_filename; }
55private:
56 const std::string m_CE_filename;
57 const std::string m_mps_filename;
58
59 std::vector<DesiredSpec> m_desired_space;
60 std::vector<MutableCost> m_mutable_costs;
61 std::vector<MutableCoefficient> m_mutable_coefficients;
62 std::vector<MutableRhs> m_mutable_rhs;
63
64 void parse();
65};
66
67std::ostream& operator<<(std::ostream& t_os, const idol::Problems::Counterfactual::Instance& t_instance);
68
69#endif //IDOL_COUNTERFACTUAL_H