Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
CandidatesINIReader.h
1//
2
3#ifndef ANTARESXPANSION_CANDIDATESINIREADER_H
4#define ANTARESXPANSION_CANDIDATESINIREADER_H
5
6#include <filesystem>
7#include <string>
8#include <utility>
9#include <vector>
10
11#include "antares-xpansion/lpnamer/model/Candidate.h"
12#include "antares-xpansion/lpnamer/input_reader/INIReader.h"
13#include "antares-xpansion/lpnamer/helper/ProblemGenerationLogger.h"
14
16 int index_interco;
17 int index_pays_origine;
18 int index_pays_extremite;
19};
20
22 public:
24 const std::filesystem::path& antaresIntercoFile,
25 const std::filesystem::path& areaFile,
26 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger);
27 explicit CandidatesINIReader(
28 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger)
29 : logger_(logger) {}
30 std::vector<IntercoFileData> ReadAntaresIntercoFile(
31 const std::filesystem::path& antaresIntercoFile) const;
32 std::vector<IntercoFileData> ReadAntaresIntercoFile(
33 std::istringstream& antaresIntercoFileInStringStream) const;
34
35 std::vector<IntercoFileData> ReadLineByLineInterco(
36 std::istream& stream) const;
37 std::vector<CandidateData> readCandidateData(
38 const std::filesystem::path& candidateFile) const;
39
41 : public LogUtils::XpansionError<std::runtime_error> {
42 using LogUtils::XpansionError<std::runtime_error>::XpansionError;
43 };
44
45 private:
46 bool checkArea(std::string const& areaName_p) const;
47 CandidateData readCandidateSection(const std::filesystem::path& candidateFile,
48 const INIReader& reader,
49 const std::string& sectionName,
50 std::ostringstream& err_msg) const;
51
52 std::map<std::string, int> _intercoIndexMap;
53 std::vector<IntercoFileData> _intercoFileData;
54 std::vector<std::string> _areaNames;
55 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger_;
56 void ProcessAreaFile(const std::filesystem::path& areaFile);
57};
58
59#endif // ANTARESXPANSION_CANDIDATESINIREADER_H
Definition CandidatesINIReader.h:41
Definition CandidatesINIReader.h:21
Definition INIReader.h:292
Definition Candidate.h:8
Definition CandidatesINIReader.h:15