Skip to content

Commit

Permalink
remove duplicate code caused by merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
bencamus committed Nov 6, 2024
1 parent 0c9eca8 commit d031b91
Showing 1 changed file with 0 additions and 74 deletions.
74 changes: 0 additions & 74 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,80 +985,6 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
}
}

// Reserves
{
buffer.clear() << study.folderInput << SEP << "reserves" << SEP << area.id << SEP
<< "reserves.ini";
if (ini.open(buffer, false))
{
ini.each(
[&](const IniFile::Section& section)
{
if (area.allCapacityReservations.contains(section.name))
{
logs.warning() << area.name << ": reserve name already exists for reserve "
<< section.name;
}
else
{
CapacityReservation tmpCapacityReservation;
std::string file_name = AllCapacityReservations::toFilename(section.name);
int type = -1;
for (auto* p = section.firstProperty; p; p = p->next)
{
CString<30, false> tmp;
tmp = p->key;
tmp.toLower();

if (tmp == "failure-cost")
{
if (!p->value.to<float>(tmpCapacityReservation.failureCost))
{
logs.warning()
<< area.name << ": invalid failure cost for reserve "
<< section.name;
}
}
else if (tmp == "spillage-cost")
{
if (!p->value.to<float>(tmpCapacityReservation.spillageCost))
{
logs.warning()
<< area.name << ": invalid spillage cost for reserve "
<< section.name;
}
}
else if (tmp == "type")
{
if (p->value == "up")
type = 0;
else if (p->value == "down")
type = 1;
else
logs.warning()
<< area.name << ": invalid type for reserve " << section.name;
}
else
logs.warning()
<< area.name << ": invalid key " << tmp << " in file " << buffer;
}
fs::path filePath = study.folderInput / "reserves" / area.id.to<std::string>()
/ (file_name + ".txt");
ret = tmpCapacityReservation.need.loadFromFile(filePath, false) && ret;
if (type == 0)
area.allCapacityReservations.areaCapacityReservationsUp.emplace(
section.name, tmpCapacityReservation);
else if (type == 1)
area.allCapacityReservations.areaCapacityReservationsDown.emplace(
section.name, tmpCapacityReservation);
else
logs.warning()
<< area.name << ": invalid type for reserve " << section.name;
}
});
}
}

// Solar
{
if (area.solar.prepro) // Prepro
Expand Down

0 comments on commit d031b91

Please sign in to comment.