Skip to content

Commit

Permalink
Move economic thermal costs input files into series directory : oops,…
Browse files Browse the repository at this point in the history
… forgot to implement the saving
  • Loading branch information
guilpier-code committed Sep 11, 2023
1 parent 976acd4 commit 7bd1091
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ static bool AreaListSaveToFolderSingleArea(const Area& area, Clob& buffer, const
ret = area.thermal.list.savePreproToFolder(buffer) && ret;
buffer.clear() << folder << SEP << "input" << SEP << "thermal" << SEP << "series";
ret = area.thermal.list.saveDataSeriesToFolder(buffer) && ret;
ret = area.thermal.list.saveEconomicCosts(buffer) && ret;
}

// Renewable cluster list
Expand Down
24 changes: 19 additions & 5 deletions src/libs/antares/study/parts/thermal/cluster_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,15 +452,29 @@ bool ThermalClusterList::savePreproToFolder(const AnyString& folder) const
buffer.clear() << folder << SEP << c.parentArea->id << SEP << c.id();
ret = c.prepro->saveToFolder(buffer) and ret;
}
{
assert(c.parentArea and "cluster: invalid parent area");
buffer.clear() << folder << SEP << c.parentArea->id << SEP << c.id();
ret = c.ecoInput.saveToFolder(buffer) && ret;
}
});
return ret;
}

bool ThermalClusterList::saveEconomicCosts(const AnyString& folder) const
{
if (empty())
return true;

Clob buffer;
bool ret = true;

each([&](const Data::ThermalCluster& c) {
assert(c.parentArea and "cluster: invalid parent area");
buffer.clear() << folder << SEP << c.parentArea->id << SEP << c.id();
ret = c.ecoInput.saveToFolder(buffer) && ret;
});
return ret;



}

bool ThermalClusterList::loadPreproFromFolder(Study& study,
const StudyLoadOptions& options,
const AnyString& folder)
Expand Down
1 change: 1 addition & 0 deletions src/libs/antares/study/parts/thermal/cluster_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class ThermalClusterList : public ClusterList<ThermalCluster>
bool loadEconomicCosts(Study& s, const AnyString& folder);

bool savePreproToFolder(const AnyString& folder) const;
bool saveEconomicCosts(const AnyString& folder) const;

bool saveToFolder(const AnyString& folder) const override;
}; // class ThermalClusterList
Expand Down

0 comments on commit 7bd1091

Please sign in to comment.