Skip to content

Commit

Permalink
Added failsafe for hydro reserves bimap
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvmara committed Dec 11, 2024
1 parent b16f18d commit 80e6f34
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,15 @@ class ReserveParticipationByDispatchableOffUnitsPlant
i <= state.study.runtime.rangeLimits.hour[Data::rangeEnd];
++i)
{
/*if (results.data.area->reserveParticipationThermalClustersIndexMap.size() == 0) //Bimap in empty
for (auto const& [reserveName, reserveParticipation] :
state.reserveParticipationPerThermalClusterForYear[i][state.thermalCluster->name()])
{
logs.warning() << "Problem during the solver run, the thermal bimap is empty for area " << results.data.area->name;
break;
pValuesForTheCurrentYear
[numSpace][state.area->reserveParticipationThermalClustersIndexMap.get(
std::make_pair(reserveName, state.thermalCluster->name()))]
.hour[i]
= reserveParticipation.offUnitsParticipation;
}
else
{*/
for (auto const& [reserveName, reserveParticipation] :
state.reserveParticipationPerThermalClusterForYear[i][state.thermalCluster->name()])
{
pValuesForTheCurrentYear
[numSpace][state.area->reserveParticipationThermalClustersIndexMap.get(
std::make_pair(reserveName, state.thermalCluster->name()))]
.hour[i]
= reserveParticipation.offUnitsParticipation;
}
//}
}
}
// Next variable
Expand Down Expand Up @@ -276,7 +268,7 @@ class ReserveParticipationByDispatchableOffUnitsPlant
{
if (results.data.area->reserveParticipationThermalClustersIndexMap.size() == 0) //Bimap is empty
{
logs.warning() << "Problem during the solver run, the thermal bimap is empty for area " << results.data.area->name;
logs.warning() << "Problem during the results export, the thermal bimap is empty for area " << results.data.area->name;
break;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class ReserveParticipationByDispatchableOnUnitsPlant
{
if (results.data.area->reserveParticipationThermalClustersIndexMap.size() == 0) //Bimap is empty
{
logs.warning() << "Problem during the solver run, the thermal bimap is empty for area " << results.data.area->name;
logs.warning() << "Problem during the results export, the thermal bimap is empty for area " << results.data.area->name;
break;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,19 @@ void localBuildAnnualSurveyReport(SurveyResults& results,
assert(NULL != results.data.area);
for (uint i = 0; i < pSize; ++i)
{
auto reserveName = results.data.area->reserveParticipationLTStorageIndexMap.get(i);
results.variableCaption = "LongTermStorage_" + reserveName; // VCardType::Caption();
results.variableUnit = VCardType::Unit();
pValuesForTheCurrentYear[numSpace][0].template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
if (results.data.area->reserveParticipationLTStorageIndexMap.size() == 0) //Bimap in empty
{
logs.warning() << "Problem during the results export, the LTS bimap is empty for area " << results.data.area->name;
break;
}
else
{
auto reserveName = results.data.area->reserveParticipationLTStorageIndexMap.get(i);
results.variableCaption = "LongTermStorage_" + reserveName; // VCardType::Caption();
results.variableUnit = VCardType::Unit();
pValuesForTheCurrentYear[numSpace][0].template buildAnnualSurveyReport<VCardType>(
results, fileLevel, precision);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class ReserveParticipationBySTStorage
{
if (results.data.area->reserveParticipationSTStorageClustersIndexMap.size() == 0) //Bimap in empty
{
logs.warning() << "Problem during the solver run, the STS bimap is empty for area " << results.data.area->name;
logs.warning() << "Problem during the results export, the STS bimap is empty for area " << results.data.area->name;
break;
}
else
Expand Down

0 comments on commit 80e6f34

Please sign in to comment.