Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
opt_period_string_generator.h
1/*
2** Copyright 2007-2024, RTE (https://www.rte-france.com)
3** See AUTHORS.txt
4** SPDX-License-Identifier: MPL-2.0
5** This file is part of Antares-Simulator,
6** Adequacy and Performance assessment for interconnected energy networks.
7**
8** Antares_Simulator is free software: you can redistribute it and/or modify
9** it under the terms of the Mozilla Public Licence 2.0 as published by
10** the Mozilla Foundation, either version 2 of the License, or
11** (at your option) any later version.
12**
13** Antares_Simulator is distributed in the hope that it will be useful,
14** but WITHOUT ANY WARRANTY; without even the implied warranty of
15** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16** Mozilla Public Licence 2.0 for more details.
17**
18** You should have received a copy of the Mozilla Public Licence 2.0
19** along with Antares_Simulator. If not, see <https://opensource.org/license/mpl-2-0/>.
20*/
21#pragma once
22#include <string>
23
24/*
25 MPS and criterion generated files wear the same time interval sequence in their names.
26 This time interval sequence is either <year>-<week> (for a weekly optimization),
27 or <year>-<week>-<day> (for a daily optimization).
28 So, depending on whether the optimization is weekly or daily, the files are named either :
29 - problem-<year>-<week>--optim-nb-<n>.mps
30 - problem-<year>-<week>-<day>--optim-nb-<n>.mps
31
32 The following class hierarchy intend to represent these time interval sequences (weekly or
33 daily), and it turns them into a string when building the names of the previous files. This
34 hierarchy is designed for polymorphism : whetever the time interval an object of that hierarchy
35 represents, it is passed as a base class argument, and the right 'to_string()' function is
36 called.
37*/
38
40{
41public:
42 virtual std::string to_string() const = 0;
43 virtual ~OptPeriodStringGenerator() = default;
44};
45
46// ------------------------------------
47// Daily optimization
48// ------------------------------------
50{
51public:
52 OptDailyStringGenerator(unsigned int day, unsigned int week, unsigned int year);
53 std::string to_string() const override;
54
55private:
56 unsigned int day_ = 0;
57 unsigned int week_ = 0;
58 unsigned int year_ = 0;
59};
60
61// ------------------------------------
62// Weekly optimization
63// ------------------------------------
65{
66public:
67 OptWeeklyStringGenerator(unsigned int week, unsigned int year);
68 std::string to_string() const override;
69
70private:
71 unsigned int week_ = 0;
72 unsigned int year_ = 0;
73};
Definition opt_period_string_generator.h:50
Definition opt_period_string_generator.h:40
Definition opt_period_string_generator.h:65