Skip to content

Commit

Permalink
Work in progress : fixed bugs on loading empty reserves and on hydro …
Browse files Browse the repository at this point in the history
…not participating to reserves

TODO : investigate on a possible bug in case of holes in the bimap
  • Loading branch information
sylvmara committed Nov 7, 2024
1 parent d031b91 commit 5de9853
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
15 changes: 12 additions & 3 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,10 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,

buffer.clear() << study.folderInput << SEP << "hydro" << SEP << "common" << SEP << area.id
<< SEP << "reserves.ini";
ret = area.hydro.loadReserveParticipations(area, buffer) && ret;
if (study.parameters.unitCommitment.ucMode != UnitCommitmentMode::ucHeuristicFast)
{
ret = area.hydro.loadReserveParticipations(area, buffer) && ret;
}
}

// Wind
Expand Down Expand Up @@ -1077,7 +1080,10 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
}
buffer.clear() << study.folderInput << SEP << "thermal" << SEP << "clusters" << SEP
<< area.id << SEP << "reserves.ini";
ret = area.thermal.list.loadReserveParticipations(area, buffer) && ret;
if (study.parameters.unitCommitment.ucMode != UnitCommitmentMode::ucHeuristicFast)
{
ret = area.thermal.list.loadReserveParticipations(area, buffer) && ret;
}
}

// Short term storage
Expand All @@ -1091,7 +1097,10 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,

fs::path reservesPath = study.folderInput / "st-storage" / "clusters"
/ area.id.to<std::string>() / "reserves.ini";
ret = area.shortTermStorage.loadReserveParticipations(area, reservesPath) && ret;
if (study.parameters.unitCommitment.ucMode != UnitCommitmentMode::ucHeuristicFast)
{
ret = area.shortTermStorage.loadReserveParticipations(area, reservesPath) && ret;
}
}

// Renewable cluster list
Expand Down
6 changes: 6 additions & 0 deletions src/libs/antares/study/include/antares/study/area/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ class BiMap
}
return -1; // Return -1 if value is not found
}

// Function to return the size of the bimap
int size()
{
return key_to_value.size();
}
};

namespace Antares
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class ReserveParticipationByLTStorage
pSize = 0;
for (int areaIndex = 0; areaIndex < study->areas.size(); areaIndex++)
{
pSize += study->areas[areaIndex]->allCapacityReservations.size();
pSize += study->areas[areaIndex]->reserveParticipationLTStorageIndexMap.size();
}
if (pSize)
{
Expand Down

0 comments on commit 5de9853

Please sign in to comment.