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 CAPEX,
15 PROJECTION,
16};
17
18inline std::string get_string_from_SensitivityPbType(SensitivityPbType type) {
19 if (type == SensitivityPbType::PROJECTION) {
20 return PROJECTION_C;
21 } else if (type == SensitivityPbType::CAPEX) {
22 return CAPEX_C;
23 } else {
24 return "";
25 }
26}
28 SensitivityPbType pb_type = SensitivityPbType::CAPEX;
29 std::string str_pb_type;
30 std::string candidate_name;
31 std::string opt_dir;
32 double objective = 0;
33 double system_cost = 0;
34 Point candidates;
35 int solver_status = 0;
36
37 SinglePbData() = default;
38 SinglePbData(const SensitivityPbType &pb_type, std::string str_pb_type,
39 std::string candidate_name, std::string opt_dir,
40 double objective, double system_cost, Point candidates,
41 int status)
42 : pb_type(pb_type),
43 str_pb_type(std::move(str_pb_type)),
44 candidate_name(std::move(candidate_name)),
45 opt_dir(std::move(opt_dir)),
46 objective(objective),
47 system_cost(system_cost),
48 candidates(std::move(candidates)),
49 solver_status(status) {}
50
51 SinglePbData(const SensitivityPbType &pb_type, std::string str_pb_type,
52 std::string candidate_name, std::string opt_dir)
53 : pb_type(pb_type),
54 str_pb_type(std::move(str_pb_type)),
55 candidate_name(std::move(candidate_name)),
56 opt_dir(std::move(opt_dir)) {}
57
58 std::string get_pb_description() const {
59 std::string pb_description = opt_dir + " " + str_pb_type;
60 if (pb_type == SensitivityPbType::PROJECTION) {
61 pb_description += " " + candidate_name;
62 }
63 return pb_description;
64 };
65};
66
67struct RawPbData {
68 int status;
69 double obj_value;
70 std::vector<double> obj_coeffs;
71 std::vector<double> solution;
72};
Definition SensitivityOutputData.h:67
Definition SensitivityOutputData.h:27