108 :
public Variable::IVariable<CongestionProbability<NextT>, NextT, VCardCongestionProbability>
129 template<
int CDataLevel,
int CFile>
145 delete[] pValuesForTheCurrentYear;
146 delete[] pValuesForYearLocalReport;
151 pNbYearsParallel = study.maxNbYearsInParallel;
153 yearsWeight = study.parameters.getYearsWeight();
154 yearsWeightSum = study.parameters.getYearsWeightSum();
163 pValuesForTheCurrentYear =
new VCardType::IntermediateValuesBaseType[pNbYearsParallel];
164 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; ++numSpace)
168 pValuesForTheCurrentYear[numSpace][i].initializeFromStudy(study);
172 pValuesForYearLocalReport =
new VCardType::IntermediateValuesBaseType[pNbYearsParallel];
173 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; ++numSpace)
177 pValuesForYearLocalReport[numSpace][i].initializeFromStudy(study);
182 NextType::initializeFromStudy(study);
188 NextType::initializeFromArea(study, area);
194 NextType::initializeFromAreaLink(study, link);
197 void simulationBegin()
199 for (
unsigned int numSpace = 0; numSpace < pNbYearsParallel; ++numSpace)
201 pValuesForTheCurrentYear[numSpace][0].reset();
202 pValuesForTheCurrentYear[numSpace][1].reset();
206 NextType::simulationBegin();
212 NextType::simulationEnd();
215 void yearBegin(uint year,
unsigned int numSpace)
218 pValuesForTheCurrentYear[numSpace][0].reset();
219 pValuesForTheCurrentYear[numSpace][1].reset();
221 pValuesForYearLocalReport[numSpace][0].reset();
222 pValuesForYearLocalReport[numSpace][1].reset();
225 NextType::yearBegin(year, numSpace);
228 void yearEndBuild(
State& state,
unsigned int year,
unsigned int numSpace)
231 NextType::yearEndBuild(state, year, numSpace);
234 void yearEnd(uint year, uint numSpace)
239 pValuesForTheCurrentYear[numSpace][i].computeProbabilitiesForTheCurrentYear();
243 NextType::yearEnd(year, numSpace);
246 void computeSummary(std::map<unsigned int, unsigned int>& numSpaceToYear,
247 unsigned int nbYearsForCurrentSummary)
249 for (
unsigned int numSpace = 0; numSpace < nbYearsForCurrentSummary; ++numSpace)
255 pValuesForTheCurrentYear[numSpace][i]);
260 NextType::computeSummary(numSpaceToYear, nbYearsForCurrentSummary);
263 void hourBegin(uint hourInTheYear)
266 NextType::hourBegin(hourInTheYear);
269 void hourForEachArea(
State& state,
unsigned int numSpace)
272 NextType::hourForEachArea(state, numSpace);
275 void hourForEachLink(
State& state,
unsigned int numSpace)
278 float ratio = yearsWeight[state.year] / yearsWeightSum;
280 assert(state.link != NULL);
281 const auto& linkDirectCapa = state.link->directCapacities;
282 const auto& linkIndirectCapa = state.link->indirectCapacities;
284 if (state.ntc.ValeurDuFlux[state.link->index]
285 > +linkDirectCapa.getCoefficient(state.year, state.hourInTheYear) - 10e-6)
287 pValuesForTheCurrentYear[numSpace][0].hour[state.hourInTheYear] += 100.0 * ratio;
290 if (state.ntc.ValeurDuFlux[state.link->index]
291 < -linkIndirectCapa.getCoefficient(state.year, state.hourInTheYear) + 10e-6)
293 pValuesForTheCurrentYear[numSpace][1].hour[state.hourInTheYear] += 100.0 * ratio;
297 NextType::hourForEachLink(state, numSpace);
300 void beforeYearByYearExport(uint , uint numSpace)
304 for (uint h = 0; h != HOURS_PER_YEAR; ++h)
306 pValuesForYearLocalReport[numSpace][i].hour[h] = (pValuesForTheCurrentYear[numSpace]
314 for (uint d = 0; d != DAYS_PER_YEAR; ++d)
316 pValuesForYearLocalReport[numSpace][i].day[d] = (pValuesForTheCurrentYear[numSpace]
324 for (uint w = 0; w != WEEKS_PER_YEAR; ++w)
326 pValuesForYearLocalReport[numSpace][i].week[w] = (pValuesForTheCurrentYear[numSpace]
334 for (uint m = 0; m != MONTHS_PER_YEAR; ++m)
336 pValuesForYearLocalReport[numSpace][i].month[m] = (pValuesForTheCurrentYear
344 pValuesForYearLocalReport[numSpace][i].year = (pValuesForTheCurrentYear[numSpace][i]
352 Antares::Memory::Stored<double>::ConstReturnType retrieveRawHourlyValuesForCurrentYear(
356 return pValuesForTheCurrentYear[numSpace][column].hour;
359 void localBuildAnnualSurveyReport(SurveyResults&
results,
365 results.isCurrentVarNA = AncestorType::isNonApplicable;
369 if (AncestorType::isPrinted[i])
374 pValuesForYearLocalReport[numSpace][i]
375 .template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
382 std::vector<float> yearsWeight;
383 float yearsWeightSum;
385 typename VCardType::IntermediateValuesType pValuesForTheCurrentYear;
386 typename VCardType::IntermediateValuesType pValuesForYearLocalReport;
387 unsigned int pNbYearsParallel;