Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
ProblemGeneration.h
1//
2// Created by marechaljas on 27/10/23.
3//
4
5#pragma once
6
7#include <filesystem>
8#include <optional>
9#include <string>
10
11#include <antares/solver/lps/LpsFromAntares.h>
12
13#include "ConfigurationManager.h"
14#include "ProblemGenerationOptions.h"
15#include "antares-xpansion/helpers/ArchiveReader.h"
16#include "antares-xpansion/lpnamer/helper/ProblemGenerationLogger.h"
17#include "antares-xpansion/lpnamer/input_reader/MpsTxtWriter.h"
18#include "antares-xpansion/lpnamer/main/ProblemGenerationExeOptions.h"
19#include "antares-xpansion/lpnamer/model/Problem.h"
20#include "antares-xpansion/lpnamer/model/SimulationInputMode.h"
21#include "antares-xpansion/multisolver_interface/SolverAbstract.h"
22#include "antares-xpansion/multisolver_interface/SolverConfig.h"
23
25{
26public:
28 virtual void performAntaresSimulation(const std::filesystem::path& study_dir);
29 virtual ~ProblemGeneration() = default;
30 std::filesystem::path updateProblems();
31 const ProblemGenerationOptions& options_;
32
33private:
34 virtual void RunProblemGeneration(
35 const std::filesystem::path& xpansion_output_dir,
36 const std::string& master_formulation,
37 const std::string& additionalConstraintFilename_l,
38 const std::filesystem::path& archive_path,
39 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger,
40 const std::filesystem::path& log_file_path,
41 const std::filesystem::path& weights_file,
42 bool unnamed_problems);
43
44 void ExtractUtilsFiles(const std::filesystem::path& antares_archive_path,
45 const std::filesystem::path& xpansion_output_dir,
46 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger);
47 std::vector<std::shared_ptr<Problem>> getXpansionProblems(
48 SolverLogManager& solver_log_manager,
49 const std::vector<ProblemData>& mpsList,
50 std::filesystem::path& lpDir_,
51 std::shared_ptr<ArchiveReader> reader);
52 virtual void set_solver(std::filesystem::path study_dir,
54
55 Antares::Solver::LpsFromAntares lps_;
56 std::optional<SimulationInputMode> mode_;
57 virtual void generate_antares_problems(const std::filesystem::path& study_dir,
58 const std::filesystem::path& output_dir);
59 SolverConfig solver_config_{"Coin"};
60
61protected:
62 void loadProblemsFromAntares(const std::filesystem::path& study_dir,
63 const std::filesystem::path& simulation_dir,
65 ConfigurationManager configuration_manager_;
67};
Definition ConfigurationManager.h:11
Definition ProblemGenerationLogger.h:92
Definition ProblemGenerationOptions.h:14
Definition ProblemGeneration.h:25
virtual void performAntaresSimulation(const std::filesystem::path &study_dir)
Definition ProblemGeneration.cpp:83
Class to store the configuration of a solver Invariant: name is lowercase.
Definition SolverConfig.h:12
Definition SolverAbstract.h:20
Definition ConfigurationManager.h:14