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