Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
BendersFactory.h
1#ifndef ANTARES_XPANSION_SRC_CPP_BENDERS_FACTORIES_INCLUDE_BENDERSFACTORY_H
2#define ANTARES_XPANSION_SRC_CPP_BENDERS_FACTORIES_INCLUDE_BENDERSFACTORY_H
3#include <variant>
4
5#include "antares-xpansion/benders/benders_core/CriterionComputation.h"
6#include "antares-xpansion/benders/benders_core/common.h"
7#include "antares-xpansion/benders/benders_mpi/BendersMPI.h"
8
10 private:
11 char** argv_;
12 boost::mpi::environment* penv_ = nullptr;
13 boost::mpi::communicator* pworld_ = nullptr;
14 SOLVER solver_ = SOLVER::BENDERS;
15 SimulationOptions options_;
16 BendersLoggerBase benders_loggers_;
19 criterion_input_holder_;
20 pBendersBase benders_ = nullptr;
21 Logger logger_ = nullptr;
22 Writer writer_ = nullptr;
23 std::shared_ptr<MathLoggerDriver> math_log_driver_;
24 BENDERSMETHOD method_ = BENDERSMETHOD::BENDERS;
25 std::string context_ = bendersmethod_to_string(BENDERSMETHOD::BENDERS);
26 std::string positive_unsupplied_file_;
27 static constexpr const char* const LOLD_FILE = "LOLD.txt";
28
29 [[nodiscard]] int RunExternalLoop();
30 [[nodiscard]] int RunBenders();
31 [[nodiscard]] std::shared_ptr<MathLoggerDriver> BuildMathLogger(
32 bool benders_log_console) const;
33 void PrepareForExecution(bool outer_loop);
34 [[nodiscard]] std::variant<Benders::Criterion::CriterionInputData,
36 ProcessCriterionInput();
37
38 Benders::Criterion::CriterionInputData BuildPatternsUsingAreaFile();
39 std::set<std::string> ReadAreaFile();
40 void StartMessage();
41 void EndMessage(const double execution_time);
42 void AddCriterionOutputs();
43 bool isCriterionListEmpty() const;
44 void SetupLoggerAndOutputWriter(const BendersBaseOptions& benders_options);
45 void ConfigureBenders(const BendersBaseOptions& benders_options,
46 const CouplingMap& coupling_map);
47 void ConfigureSolverLog();
48
49 public:
50 explicit BendersMainFactory(int argc, char** argv,
51 boost::mpi::environment& env,
52 boost::mpi::communicator& world,
53 const SOLVER& solver);
54 explicit BendersMainFactory(int argc, char** argv,
55 const std::filesystem::path& options_file,
56 boost::mpi::environment& env,
57 boost::mpi::communicator& world,
58 const SOLVER& solver);
59 int Run();
60 std::filesystem::path LogReportsName() const;
61};
62#endif // ANTARES_XPANSION_SRC_CPP_BENDERS_FACTORIES_INCLUDE_BENDERSFACTORY_H
Definition BendersFactory.h:9
this class contains all data read from user input file
Definition CriterionInputDataReader.h:80
this class contains all data read from user input file
Definition CriterionInputDataReader.h:100
Definition SimulationOptions.h:5
Definition common.h:171
Definition ILogger.h:114