Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
ProblemGenerationExeOptions.h
1#ifndef ANTARES_XPANSION_SRC_CPP_LPNAMER_MAIN_INCLUDE_PROBLEMGENERATIONEXEOPTIONS_H
2#define ANTARES_XPANSION_SRC_CPP_LPNAMER_MAIN_INCLUDE_PROBLEMGENERATIONEXEOPTIONS_H
3#include <filesystem>
4#include <vector>
5
6#include "ProblemGenerationOptions.h"
7#include "antares-xpansion/core/ProblemFormat.h"
8#include "antares-xpansion/helpers/OptionsParser.h"
9
11{
12 std::filesystem::path xpansion_output_dir_;
13 std::string master_formulation_;
14 std::string additional_constraintFilename_l_;
15 std::filesystem::path archive_path_;
16 std::filesystem::path weights_file_;
17 std::vector<int> active_years_;
18 bool unnamed_problems_ = false;
19 std::filesystem::path study_path_;
20 ProblemsFormat format_;
21
22public:
24
25 ~ProblemGenerationExeOptions() override = default;
26
27 [[nodiscard]] std::filesystem::path XpansionOutputDir() const override
28 {
29 return xpansion_output_dir_;
30 }
31
32 [[nodiscard]] std::string MasterFormulation() const override
33 {
34 return master_formulation_;
35 }
36
37 [[nodiscard]] std::string AdditionalConstraintsFilename() const override
38 {
39 return additional_constraintFilename_l_;
40 }
41
42 [[nodiscard]] std::filesystem::path ArchivePath() const override
43 {
44 return archive_path_;
45 }
46
47 [[nodiscard]] std::filesystem::path WeightsFile() const override
48 {
49 return weights_file_;
50 }
51
52 [[nodiscard]] std::vector<int> ActiveYears() const override
53 {
54 return active_years_;
55 }
56
57 [[nodiscard]] bool UnnamedProblems() const override
58 {
59 return unnamed_problems_;
60 }
61
62 [[nodiscard]] ProblemsFormat Format() const
63 {
64 return format_;
65 }
66
67 void Parse(unsigned int argc, const char* const* argv) override;
68
69 [[nodiscard]] std::filesystem::path deduceXpansionDirIfEmpty(
70 std::filesystem::path xpansion_output_dir,
71 const std::filesystem::path& archive_path) const override;
72 [[nodiscard]] std::filesystem::path StudyPath() const override;
73 virtual void checkMandatoryOptions(const std::string& log_location) const;
74 [[nodiscard]] auto exclusiveMandatoryParameters() const;
75
76 // Returns the relevant path (should be the only non-empty one)
77 std::filesystem::path getRelevantPath() const;
78 // Sets the relevant path (should be the only non-empty one before changing the value)
79 void setRelevantPath(const std::filesystem::path& path);
80
81 void setAdditionalConstraintsFilePath(const std::filesystem::path& path)
82 {
83 additional_constraintFilename_l_ = path.string();
84 }
85
86 void setWeightsFilePath(const std::filesystem::path& path)
87 {
88 weights_file_ = path;
89 }
90};
91#endif // ANTARES_XPANSION_SRC_CPP_LPNAMER_MAIN_INCLUDE_PROBLEMGENERATIONEXEOPTIONS_H
Definition OptionsParser.h:12
Definition ProblemGenerationExeOptions.h:11
Definition ProblemGenerationOptions.h:14