Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
SensitivityOutputData.h
1#pragma once
2
3#include <iostream>
4#include <utility>
5
6#include "antares-xpansion/benders/benders_core/common.h"
7
8const std::string MIN_C("min");
9const std::string MAX_C("max");
10const std::string PROJECTION_C("investment");
11const std::string CAPEX_C("capex");
12
13enum class SensitivityPbType
14{
15 CAPEX,
16 PROJECTION,
17};
18
19inline std::string get_string_from_SensitivityPbType(SensitivityPbType type)
20{
21 if (type == SensitivityPbType::PROJECTION)
22 {
23 return PROJECTION_C;
24 }
25 else if (type == SensitivityPbType::CAPEX)
26 {
27 return CAPEX_C;
28 }
29 else
30 {
31 return "";
32 }
33}
34
36{
37 SensitivityPbType pb_type = SensitivityPbType::CAPEX;
38 std::string str_pb_type;
39 std::string candidate_name;
40 std::string opt_dir;
41 double objective = 0;
42 double system_cost = 0;
43 Point candidates;
44 int solver_status = 0;
45
46 SinglePbData() = default;
47
48 SinglePbData(const SensitivityPbType& pb_type,
49 std::string str_pb_type,
50 std::string candidate_name,
51 std::string opt_dir,
52 double objective,
53 double system_cost,
54 Point candidates,
55 int status):
56 pb_type(pb_type),
57 str_pb_type(std::move(str_pb_type)),
58 candidate_name(std::move(candidate_name)),
59 opt_dir(std::move(opt_dir)),
60 objective(objective),
61 system_cost(system_cost),
62 candidates(std::move(candidates)),
63 solver_status(status)
64 {
65 }
66
67 SinglePbData(const SensitivityPbType& pb_type,
68 std::string str_pb_type,
69 std::string candidate_name,
70 std::string opt_dir):
71 pb_type(pb_type),
72 str_pb_type(std::move(str_pb_type)),
73 candidate_name(std::move(candidate_name)),
74 opt_dir(std::move(opt_dir))
75 {
76 }
77
78 std::string get_pb_description() const
79 {
80 std::string pb_description = opt_dir + " " + str_pb_type;
81 if (pb_type == SensitivityPbType::PROJECTION)
82 {
83 pb_description += " " + candidate_name;
84 }
85 return pb_description;
86 }
87};
88
90{
91 int status;
92 double obj_value;
93 std::vector<double> obj_coeffs;
94 std::vector<double> solution;
95};
Definition SensitivityOutputData.h:90
Definition SensitivityOutputData.h:36