Skip to content

Commit

Permalink
Remove unitcount limit for time series generation ANT-1248 (#1960)
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin authored Feb 26, 2024
1 parent 1d2e9a4 commit 4ba630c
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/solver/ts-generator/thermal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ class GeneratorTempData final

private:
uint nbThermalTimeseries_;
const uint nbHoursPerYear = HOURS_PER_YEAR;
const uint daysPerYear = DAYS_PER_YEAR;

MersenneTwister& rndgenerator;

Expand All @@ -96,8 +94,9 @@ class GeneratorTempData final
double ap[366];
double bf[366];
double bp[366];
double FPOW[366][102];
double PPOW[366][102];

std::vector<std::vector<double>> FPOW;
std::vector<std::vector<double>> PPOW;

String pTempFilename;
Solver::Progression::Task& pProgression;
Expand All @@ -119,6 +118,9 @@ GeneratorTempData::GeneratorTempData(Data::Study& study,
nbThermalTimeseries_ = parameters.nbTimeSeriesThermal;

derated = parameters.derated;

FPOW.resize(DAYS_PER_YEAR);
PPOW.resize(DAYS_PER_YEAR);
}

void GeneratorTempData::writeResultsToDisk(const Data::Area& area,
Expand Down Expand Up @@ -156,7 +158,7 @@ void GeneratorTempData::prepareIndispoFromLaw(Data::ThermalLaw law,
{
case Data::thermalLawUniform:
{
for (uint d = 0; d < daysPerYear; ++d)
for (uint d = 0; d < DAYS_PER_YEAR; ++d)
{
double D = (double)duration[d];
double xtemp = volatility * (D - 1.);
Expand All @@ -167,7 +169,7 @@ void GeneratorTempData::prepareIndispoFromLaw(Data::ThermalLaw law,
}
case Data::thermalLawGeometric:
{
for (uint d = 0; d < daysPerYear; ++d)
for (uint d = 0; d < DAYS_PER_YEAR; ++d)
{
double D = (double)duration[d];
double xtemp = volatility * volatility * D * (D - 1.);
Expand Down Expand Up @@ -272,8 +274,11 @@ void GeneratorTempData::operator()(Data::Area& area, Data::ThermalCluster& clust
int FOD_reel = 0;
int POD_reel = 0;

for (uint d = 0; d < daysPerYear; ++d)
for (uint d = 0; d < DAYS_PER_YEAR; ++d)
{
FPOW[d].resize(cluster.unitCount + 1);
PPOW[d].resize(cluster.unitCount + 1);

PODOfTheDay = (int)POD[d];
FODOfTheDay = (int)FOD[d];

Expand Down Expand Up @@ -345,9 +350,8 @@ void GeneratorTempData::operator()(Data::Area& area, Data::ThermalCluster& clust
if (tsIndex > 1)
dstSeries = cluster.series.timeSeries[tsIndex - 2];

for (uint dayInTheYear = 0; dayInTheYear < daysPerYear; ++dayInTheYear)
for (uint dayInTheYear = 0; dayInTheYear < DAYS_PER_YEAR; ++dayInTheYear)
{
assert(AUN <= 100 and "Thermal Prepro: AUN is out of bounds (>=100)");
assert(dayInTheYear < 366);
assert(not(lf[dayInTheYear] < 0.));
assert(not(lp[dayInTheYear] < 0.));
Expand Down

0 comments on commit 4ba630c

Please sign in to comment.