Antares Xpansion
Investment simulations for Antares studies
Loading...
Searching...
No Matches
RenameUtils.h
1#pragma once
2#include <mutex>
3#include <optional>
4#include <string>
5#include <string_view>
6#include <unordered_map>
7#include <vector>
8
9namespace ProblemGenerationLog
10{
11class ProblemGenerationLogger;
12}
13
15{
16public:
17 static bool try_replace_first_token(const std::string& name,
18 std::string_view prefix,
19 unsigned int week,
20 long long factor,
21 bool ignore_value,
22 std::string& out);
23
24 static std::optional<std::string> replace_time_step_in_name(const std::string& name,
25 unsigned int week);
26 std::optional<std::pair<const std::vector<std::string>&, const std::vector<std::string>&>>
27 rename_week_names(unsigned int week,
28 const std::vector<std::string>& variables,
29 const std::vector<std::string>& contraintes,
31
32private:
33 bool rename_week_names(unsigned int week,
34 const std::vector<std::string>& names,
35 std::unordered_map<int, std::vector<std::string>>& container_names,
37
38 using NamesByWeek = std::unordered_map<int, std::vector<std::string>>;
39 mutable NamesByWeek variables_names_;
40 mutable NamesByWeek constraints_names_;
41 mutable std::mutex rename_mutex_;
42};
Definition ProblemGenerationLogger.h:92
Definition RenameUtils.h:15