Antares Simulator
Power System Simulator
result.h
1 /*
2 ** Copyright 2007-2025, 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 #ifndef __STUDY_RESULT_AGGREGATOR_RESULT_H__
22 #define __STUDY_RESULT_AGGREGATOR_RESULT_H__
23 
24 #include <map>
25 
26 #include <yuni/yuni.h>
27 #include <yuni/core/string.h>
28 
29 #include <antares/memory/memory.h>
30 #include "antares/solver/ts-generator/xcast/studydata.h"
31 
32 #include "datafile.h"
33 #include "studydata.h"
34 
35 using namespace Yuni;
36 
37 enum
38 {
39  maxSizePerCell = 42,
40 };
41 
43 using CellData = char[maxSizePerCell];
44 
46 class CellColumnData final
47 {
48 public:
50 
51 
58  ~CellColumnData();
60 
61 public:
63  Antares::Memory::Stored<CellData>::Type rows;
65  uint height;
66 
67 }; // class CellColumnData
68 
69 class ResultMatrix final
70 {
71 public:
73 
74 
77  ResultMatrix();
79  ResultMatrix(const ResultMatrix&);
81  ~ResultMatrix();
83 
87  void resize(uint i);
88 
92  bool saveToCSVFile(const Yuni::String& filename) const;
93 
94 public:
95  CellColumnData* columns;
97  uint width;
100 
101 }; // class ResultMatrix
102 
103 using ResultsAllVars = std::vector<ResultMatrix>;
104 
105 using ResultsForAllTimeLevels = std::map<DataFile::ShortString, ResultsAllVars>;
106 using ResultsForAllDataLevels = std::map<DataFile::ShortString, ResultsForAllTimeLevels>;
107 
108 using ResultsForAllStudyItems = std::map<StudyData::ShortString512, ResultsForAllDataLevels>;
109 
110 #endif // __STUDY_RESULT_AGGREGATOR_RESULT_H__
A single column.
Definition: result.h:47
uint height
The height of the column.
Definition: result.h:65
Antares::Memory::Stored< CellData >::Type rows
All rows.
Definition: result.h:63
Definition: result.h:70
uint width
Width of the matrix.
Definition: result.h:97
uint heightAfterAggregation
Valid Height found after aggregation.
Definition: result.h:99