Skip to content

Commit

Permalink
[skip ci] Split thermal TS generation : simple renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
guilpier-code committed Jun 28, 2024
1 parent 34eace9 commit 5486b05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/solver/ts-generator/availability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class AvailabilityTSgenerator final

uint nbOfSeriesToGen_;

MersenneTwister& rndgenerator;
MersenneTwister& randomGenerator_;

static constexpr int Log_size = 4000;

Expand All @@ -96,10 +96,10 @@ class AvailabilityTSgenerator final

AvailabilityTSgenerator::AvailabilityTSgenerator(bool derated,
unsigned int nbOfSeriesToGen,
MersenneTwister& rndGenerator):
MersenneTwister& randomGenerator):
derated(derated),
nbOfSeriesToGen_(nbOfSeriesToGen),
rndgenerator(rndGenerator)
randomGenerator_(randomGenerator)
{
}

Expand Down Expand Up @@ -160,7 +160,7 @@ int AvailabilityTSgenerator::durationGenerator(Data::StatisticalLaw law,
return expec;
}

double rndnumber = rndgenerator.next();
double rndnumber = randomGenerator_.next();

switch (law)
{
Expand Down Expand Up @@ -372,7 +372,7 @@ void AvailabilityTSgenerator::run(AvailabilityTSGeneratorData& tsGenerationData)

if (lf[dayInTheYear] > 0. && lf[dayInTheYear] <= FAILURE_RATE_EQ_1)
{
A = rndgenerator.next();
A = randomGenerator_.next();
last = FPOW[dayInTheYear][AUN];

if (A > last)
Expand Down Expand Up @@ -408,7 +408,7 @@ void AvailabilityTSgenerator::run(AvailabilityTSGeneratorData& tsGenerationData)
}

last = PPOW[dayInTheYear][AUN_app];
A = rndgenerator.next();
A = randomGenerator_.next();

if (A > last)
{
Expand Down
14 changes: 7 additions & 7 deletions src/tools/ts-generator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ std::vector<Data::ThermalCluster*> getClustersToGen(Data::AreaList& areas,
const std::string& clustersToGen)
{
std::vector<Data::ThermalCluster*> clusters;
const auto ids = splitStringIntoPairs(clustersToGen, ';', '.');
const auto pairsAreaCluster = splitStringIntoPairs(clustersToGen, ';', '.');

for (const auto& [areaID, clusterID]: ids)
for (const auto& [areaName, clusterName]: pairsAreaCluster)
{
logs.info() << "Searching for area: " << areaID << " and cluster: " << clusterID;
logs.info() << "Searching for area: " << areaName << " and cluster: " << clusterName;

auto* area = areas.find(areaID);
auto* area = areas.find(areaName);
if (!area)
{
logs.warning() << "Area not found: " << areaID;
logs.warning() << "Area not found: " << areaName;
continue;
}

auto* cluster = area->thermal.list.findInAll(clusterID);
auto* cluster = area->thermal.list.findInAll(clusterName);
if (!cluster)
{
logs.warning() << "Cluster not found: " << clusterID;
logs.warning() << "Cluster not found: " << clusterName;
continue;
}

Expand Down

0 comments on commit 5486b05

Please sign in to comment.