Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
cluster_list.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
23#include <filesystem>
24#include <functional>
25
26#include "../common/cluster_list.h"
27#include "cluster.h"
28
29namespace Antares
30{
31namespace Data
32{
37class ThermalClusterList: public ClusterList<ThermalCluster>
38{
39public:
40 std::string typeID() const override;
41
46 bool loadFromFolder(Study& s, const std::filesystem::path& folder, Area* area);
47
49
50
57 virtual ~ThermalClusterList();
59
61
62
66
72
74
75
82
84
85 auto each_mustrun_and_enabled() const
86 {
87 return allClusters_ | std::views::filter(&ThermalCluster::isMustRun)
88 | std::views::filter(&ThermalCluster::isEnabled);
89 }
90
91 auto each_enabled_and_not_mustrun() const
92 {
93 return allClusters_ | std::views::filter(&ThermalCluster::isEnabled)
94 | std::views::filter(std::not_fn(&ThermalCluster::isMustRun));
95 }
96
104 void ensureDataPrepro();
105
115 bool loadPreproFromFolder(Study& s, const std::filesystem::path& folder);
116 bool validatePrepro(const Study& study);
117
118 bool validateClusters(const Parameters& param) const;
119
120 bool loadEconomicCosts(Study& s, const std::filesystem::path& folder);
121
122 bool savePreproToFolder(const AnyString& folder) const;
123 bool saveEconomicCosts(const AnyString& folder) const;
124
125 bool saveToFolder(const AnyString& folder) const override;
126
127 unsigned int enabledAndMustRunCount() const;
128 unsigned int enabledAndNotMustRunCount() const;
129
130private:
131 // Give a special index to enbled and not must-run THERMAL clusters
132 void rebuildIndex() const;
133
134}; // class ThermalClusterList
135} // namespace Data
136} // namespace Antares
Definition for a single area.
Definition area.h:52
Generic list of clustersThis class implements the base functions for a list of cluster It's used for ...
Definition cluster_list.h:46
General data for a study.
Definition parameters.h:51
Definition study.h:61
List of clusters.
Definition cluster_list.h:38
virtual ~ThermalClusterList()
Destructor.
Definition cluster_list.cpp:54
bool loadPreproFromFolder(Study &s, const std::filesystem::path &folder)
Load data related to the preprocessor from a list of thermal clusters from a folder.
Definition cluster_list.cpp:573
bool loadFromFolder(Study &s, const std::filesystem::path &folder, Area *area)
Get the size (bytes) occupied in memory by a ThermalClusterList structure.
Definition cluster_list.cpp:91
void enableMustrunForEveryone()
Enable the 'mustrun' mode for every cluster.
Definition cluster_list.cpp:367
void reverseCalculationOfSpinning()
Calculation of Spinning for all thermal clusters (reverse)
Definition cluster_list.cpp:359
ThermalClusterList()
Default constructor.
Definition cluster_list.cpp:50
void ensureDataPrepro()
Ensure data for the prepro are initialized.
Definition cluster_list.cpp:375
void calculationOfSpinning()
Calculation of Spinning for all thermal clusters.
Definition cluster_list.cpp:351