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{
11private:
12 char** argv_;
13 boost::mpi::environment* penv_ = nullptr;
14 boost::mpi::communicator* pworld_ = nullptr;
15 SOLVER solver_ = SOLVER::BENDERS;
16 SimulationOptions options_;
17 BendersLoggerBase benders_loggers_;
20 criterion_input_holder_;
21 pBendersBase benders_ = nullptr;
22 Logger logger_ = nullptr;
23 std::shared_ptr<Output::OutputWriter> writer_ = nullptr;
24 std::shared_ptr<MathLoggerDriver> math_log_driver_;
25 BENDERSMETHOD method_ = BENDERSMETHOD::BENDERS;
26 std::string context_ = bendersmethod_to_string(BENDERSMETHOD::BENDERS);
27 std::string positive_unsupplied_file_;
28 static constexpr const char* const LOLD_FILE = "LOLD.txt";
29
30 [[nodiscard]] int RunExternalLoop();
31 [[nodiscard]] int RunBenders();
32 [[nodiscard]] std::shared_ptr<MathLoggerDriver> BuildMathLogger(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
49public:
50 explicit BendersMainFactory(int argc,
51 char** argv,
52 boost::mpi::environment& env,
53 boost::mpi::communicator& world,
54 const SOLVER& solver);
55 explicit BendersMainFactory(int argc,
56 char** argv,
57 const std::filesystem::path& options_file,
58 boost::mpi::environment& env,
59 boost::mpi::communicator& world,
60 const SOLVER& solver);
61 int Run();
62 std::filesystem::path LogReportsName() const;
63};
64#endif // ANTARES_XPANSION_SRC_CPP_BENDERS_FACTORIES_INCLUDE_BENDERSFACTORY_H
Definition BendersFactory.h:10
this class contains all data read from user input file
Definition CriterionInputDataReader.h:84
this class contains all data read from user input file
Definition CriterionInputDataReader.h:104
Definition SimulationOptions.h:6
Definition common.h:208
Definition ILogger.h:131