Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
LinkProfileReader.h
1#ifndef ANTARESXPANSION_LINKPROFILEREADER_H
2#define ANTARESXPANSION_LINKPROFILEREADER_H
3
4#include <filesystem>
5#include <map>
6#include <utility>
7
8#include "antares-xpansion/lpnamer/model/Candidate.h"
9#include "antares-xpansion/lpnamer/model/LinkProfile.h"
10#include "antares-xpansion/lpnamer/helper/ProblemGenerationLogger.h"
11
13 public:
14 explicit LinkProfileReader(
15 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger)
16 : logger_(std::move(logger)) {}
17
18 std::vector<LinkProfile> ReadLinkProfile(
19 const std::filesystem::path& direct_filename,
20 const std::filesystem::path& indirect_file_name);
21 std::vector<LinkProfile> ReadLinkProfile(
22 const std::filesystem::path& direct_filename);
23 std::map<std::string, std::vector<LinkProfile>> getLinkProfileMap(
24 const std::filesystem::path& capacity_folder,
25 const std::vector<CandidateData>& candidateList);
26
27 private:
28 void importProfile(
29 std::map<std::string, std::vector<LinkProfile>>& mapLinkProfile,
30 const std::filesystem::path& capacitySubfolder,
31 const std::string& direct_profile_name,
32 const std::string& indirect_profile_name);
33
34 void ReadLinkProfile(const std::filesystem::path& filename,
35 std::vector<LinkProfile>& result,
36 bool fillDirectProfile);
37
38 void ConstructChronicle(std::vector<LinkProfile>& result, int chronicle_id)const;
39 void UpdateProfile(std::vector<LinkProfile>& result, bool directProfile,
40 double value, int chronicle_id, size_t time_step)const;
41 void EnsureFileIsGood(const std::filesystem::path& direct_filename) const;
42 std::shared_ptr<ProblemGenerationLog::ProblemGenerationLogger> logger_;
43};
44
45#endif // ANTARESXPANSION_LINKPROFILEREADER_H
Definition LinkProfileReader.h:12