21#ifndef __SOLVER_VARIABLE_SET_OF_AREAS_HXX__
22#define __SOLVER_VARIABLE_SET_OF_AREAS_HXX__
31void SetsOfAreas<NextT>::initializeFromStudy(Data::Study& study)
33 using namespace Antares;
38 auto& sets = study.setsOfAreas;
40 pSetsOfAreas.reserve(sets.size());
41 pOriginalSets.reserve(sets.size());
44 for (uint setIndex = 0; setIndex != sets.size(); ++setIndex)
46 if (!sets.hasOutput(setIndex))
51 const auto& setname = sets.caption(setIndex);
54 if (!sets.resultSize(setIndex))
56 logs.warning() <<
"The set of areas named '" << setname
57 <<
"' is empty. No output will be produced for this set.";
61 auto n = std::make_unique<NextT>();
65 n->initializeFromStudy(study);
70 n->broadcastNonApplicability(
true);
74 n->getPrintStatusFromStudy(study);
76 pSetsOfAreas.push_back(std::move(n));
78 auto* originalSet = &sets[setIndex];
79 assert(originalSet != NULL);
80 assert(!originalSet->empty());
81 pOriginalSets.push_back(originalSet);
83 pNames.push_back(setname);
100inline void SetsOfAreas<NextT>::initializeFromThermalCluster(
Data::Study*,
108inline void SetsOfAreas<NextT>::simulationBegin()
114inline void SetsOfAreas<NextT>::simulationEnd()
120inline void SetsOfAreas<NextT>::yearBegin(uint , uint )
126inline void SetsOfAreas<NextT>::yearEndBuild(
State& , uint , uint )
132inline void SetsOfAreas<NextT>::yearEnd(uint , uint )
138inline void SetsOfAreas<NextT>::computeSummary(
139 std::map<unsigned int, unsigned int>& ,
146inline void SetsOfAreas<NextT>::hourBegin(uint )
152inline void SetsOfAreas<NextT>::weekBegin(
State&)
158inline void SetsOfAreas<NextT>::weekForEachArea(
State&,
unsigned int )
164inline void SetsOfAreas<NextT>::weekEnd(
State&)
170void SetsOfAreas<NextT>::hourForEachArea(
State& state,
unsigned int)
176inline void SetsOfAreas<NextT>::hourForEachLink(
State& state)
182inline void SetsOfAreas<NextT>::hourEnd(
State& state, uint hourInTheYear)
189inline void SetsOfAreas<NextT>::buildSurveyReport(SurveyResults& results,
194 int count_int = count;
195 bool setOfAreasDataLevel = dataLevel & Category::DataLevel::setOfAreas;
196 if (count_int && setOfAreasDataLevel)
198 pSetsOfAreas[results.data.setOfAreasIndex]->buildSurveyReport(results,
206inline void SetsOfAreas<NextT>::buildAnnualSurveyReport(SurveyResults& results,
212 int count_int = count;
213 bool setOfAreasDataLevel = dataLevel & Category::DataLevel::setOfAreas;
214 if (count_int && setOfAreasDataLevel)
216 pSetsOfAreas[results.data.setOfAreasIndex]->buildAnnualSurveyReport(results,
225void SetsOfAreas<NextT>::buildDigest(SurveyResults& results,
int digestLevel,
int dataLevel)
const
227 int count_int = count;
228 bool setOfAreasDataLevel = dataLevel & Category::DataLevel::setOfAreas;
229 if (count_int && setOfAreasDataLevel)
232 results.data.rowCaptions.clear();
233 results.data.rowCaptions.resize(pSetsOfAreas.size());
234 results.data.area =
nullptr;
235 results.data.rowIndex = 0;
237 for (
auto& set: pSetsOfAreas)
239 results.data.columnIndex = 0;
240 results.data.rowCaptions[results.data.rowIndex].clear()
241 <<
"@ " << pNames[results.data.rowIndex];
242 set->buildDigest(results, digestLevel, dataLevel);
243 ++results.data.rowIndex;
250inline void SetsOfAreas<NextT>::provideInformations(I& infos)
253 if (VCardType::nodeDepthForGUI)
255 infos.template beginNode<VCardType>();
257 NextType::template provideInformations<I>(infos);
264 infos.template addVCard<VCardType>();
266 NextType::template provideInformations<I>(infos);
272void SetsOfAreas<NextT>::yearEndSpatialAggregates(V& allVars, uint year, uint numSpace)
274 for (uint setindex = 0; setindex != pSetsOfAreas.size(); ++setindex)
276 assert(setindex < pOriginalSets.size());
277 pSetsOfAreas[setindex]->yearEndSpatialAggregates(allVars,
279 *(pOriginalSets[setindex]),
286void SetsOfAreas<NextT>::computeSpatialAggregatesSummary(
288 std::map<unsigned int, unsigned int>& numSpaceToYear,
289 unsigned int nbYearsForCurrentSummary)
291 for (uint setindex = 0; setindex != pSetsOfAreas.size(); ++setindex)
293 assert(setindex < pOriginalSets.size());
294 pSetsOfAreas[setindex]->computeSpatialAggregatesSummary(allVars,
296 nbYearsForCurrentSummary);
302void SetsOfAreas<NextT>::simulationEndSpatialAggregates(V& allVars)
304 for (uint i = 0; i != pSetsOfAreas.size(); ++i)
306 pSetsOfAreas[i]->simulationEndSpatialAggregates(allVars, *(pOriginalSets[i]));
311void SetsOfAreas<NextT>::beforeYearByYearExport(uint year, uint numSpace)
313 for (uint i = 0; i != pSetsOfAreas.size(); ++i)
315 pSetsOfAreas[i]->beforeYearByYearExport(year, numSpace);
320template<
class SearchVCardT,
class O>
321inline void SetsOfAreas<NextT>::computeSpatialAggregateWith(O&)
327template<
class SearchVCardT,
class O>
328inline void SetsOfAreas<NextT>::computeSpatialAggregateWith(O& out,
339template<
class VCardToFindT>
340inline const double* SetsOfAreas<NextT>::retrieveHourlyResultsForCurrentYear()
const
346template<
class VCardToFindT>
347inline void SetsOfAreas<NextT>::retrieveResultsForArea(
356template<
class VCardToFindT>
357inline void SetsOfAreas<NextT>::retrieveResultsForThermalCluster(
366template<
class VCardToFindT>
367inline void SetsOfAreas<NextT>::retrieveResultsForLink(
376template<
class PredicateT>
Definition of a link between two areas (Interconnection)
Definition links.h:50
Definition for a single area.
Definition area.h:52
A single thermal cluster.
Definition cluster.h:78
static void RetrieveVariableList(PredicateT &predicate)
Retrieve the list of all individual variables.
Definition setofareas.hxx:377
Definition cbuilder.h:120
VariableAccessor< typenameVCardT::ResultsType, VCardT::columnCount >::Type ResultsType
The true type used for the results.
Definition info.h:764