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 "ProblemGenerationOptions.h"
14#include "antares-xpansion/helpers/ArchiveReader.h"
15#include "antares-xpansion/lpnamer/helper/ProblemGenerationLogger.h"
16#include "antares-xpansion/lpnamer/input_reader/MpsTxtWriter.h"
17#include "antares-xpansion/lpnamer/main/ProblemGenerationExeOptions.h"
18#include "antares-xpansion/lpnamer/model/Problem.h"
19#include "antares-xpansion/lpnamer/model/SimulationInputMode.h"
20#include "antares-xpansion/multisolver_interface/SolverAbstract.h"
21#include "antares-xpansion/multisolver_interface/SolverConfig.h"
22
24{
25public:
27 virtual ~ProblemGeneration() = default;
28 std::filesystem::path updateProblems();
29 const ProblemGenerationOptions& options_;
30
31private:
32 virtual void RunProblemGeneration(
33 const std::filesystem::path& xpansion_output_dir,
34 const std::string& master_formulation,
35 const std::string& additionalConstraintFilename_l,
36 const std::filesystem::path& archive_path,
37 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger,
38 const std::filesystem::path& log_file_path,
39 const std::filesystem::path& weights_file,
40 bool unnamed_problems);
41
42 void ProcessWeights(
43 const std::vector<std::pair<std::shared_ptr<Problem>, ProblemData>>& problems_and_data,
44 const std::filesystem::path& xpansion_output_dir,
45 const std::filesystem::path& weights_file,
46 const std::string& solver_name,
47 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger);
48 void ExtractUtilsFiles(const std::filesystem::path& antares_archive_path,
49 const std::filesystem::path& xpansion_output_dir,
50 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger);
51 std::vector<std::shared_ptr<Problem>> getXpansionProblems(
52 SolverLogManager& solver_log_manager,
53 const std::vector<ProblemData>& mpsList,
54 std::filesystem::path& lpDir_,
55 std::shared_ptr<ArchiveReader> reader,
56 const Antares::Solver::LpsFromAntares& lps);
57 virtual void set_solver(std::filesystem::path study_dir,
59
60 Antares::Solver::LpsFromAntares lps_;
61 std::optional<SimulationInputMode> mode_;
62 virtual void performAntaresSimulation(const std::filesystem::path& output);
63 std::filesystem::path simulation_dir_;
64 SolverConfig solver_config_{"Coin"};
65};
Definition ProblemGenerationLogger.h:91
Definition ProblemGenerationOptions.h:12
Definition ProblemGeneration.h:24
Class to store the configuration of a solver Invariant: name is lowercase.
Definition SolverConfig.h:12
Definition SolverAbstract.h:17
Definition MpsTxtWriter.h:22