Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
MultipleProblemGeneration.h
1#pragma once
2
3#include "ConfigurationManager.h"
4#include "antares-xpansion/benders/merge_master_mps/NodeLpDataLocation.h"
5#include "antares-xpansion/lpnamer/helper/ProblemGenerationLogger.h"
6#include "antares-xpansion/lpnamer/main/ProblemGeneration.h"
7#include "antares-xpansion/lpnamer/main/ProblemGenerationExeOptions.h"
8
10{
11private:
12 // Path to which we want to write the nodal_lp_info obtained after problem generation.
13 std::filesystem::path nodal_lp_info_path_;
14 // Input root, used to write the paths as relative to the input root
15 std::filesystem::path input_root_;
16
17public:
19
20 ~MultipleProblemGenerationExeOptions() override = default;
21
22 void Parse(unsigned int argc, const char* const* argv) override;
23
24 void checkMandatoryOptions(const std::string& log_location) const;
25
26 std::filesystem::path NodalLpInfoPath() const
27 {
28 return nodal_lp_info_path_;
29 }
30
31 // Path to the folder containing the studies we work on.
32 std::filesystem::path InputRootPath() const
33 {
34 return input_root_;
35 }
36};
37
39{
40public:
42
43 virtual ~MultipleProblemGeneration() = default;
44
45private:
46 /*
47 Parse a list of paths provided by the user in the form of a text file with two columns :
48 node_name1 path/to/archive
49 node_name2 or/path/to/output
50 node_name3 or/path/to/study
51 ...
52 Wether the path corresponds to a study, Antares output or archive does not matter for this
53 function
54*/
55 void load_input_paths();
56
57 /*
58 Parse a list of weight files provided by the user in the form of a text file with two
59 columns :
60 node_name1 path/to/weight/file
61 node_name2 path/to/weight/file
62 ...
63 If a node is absent from this file, it will be assumed to have no custom weights.
64 */
65 void load_input_weight_files();
66 /*
67 Parse a list of additional constraints files provided by the user in the form of a text file
68 with two columns : *
69 node_name1 path/to/constraints/file
70 node_name2 path/to/constraints/file
71 ...
72 If a node is absent from this file, it will be assumed to have additional constraints.
73 */
74 void load_additional_constraints_files();
75
76public:
77 /*
78 Load all the necessary data
79 */
80 void load_data();
81
82 /*
83 Runs the problem generation for every node given in the input file
84 */
85 void run_generation();
86 /*
87 Writes the lp_folder paths to a Json file
88 */
89 void write_lp_paths() const;
90
91private:
92 using NodeToPathMap = std::map<std::string, std::filesystem::path>;
93 // Inputs
95 NodeToPathMap node_to_input_path_;
96 NodeToPathMap node_to_weight_file_;
97 NodeToPathMap node_to_additional_constraints_file_;
98 // Outputs
99 NodesToLpDataLocationMap node_to_lp_info_;
100 // TODO // Logger
101 // std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger_;
102 // ConfigurationManager configuration_manager_;
103 // ConfigurationManager::ConfigDirectories directories_;
104};
Definition MultipleProblemGeneration.h:10
Definition MultipleProblemGeneration.h:39
Definition ProblemGenerationExeOptions.h:11