Skip to content

Commit

Permalink
Make hydro time series cont a private member
Browse files Browse the repository at this point in the history
  • Loading branch information
guilpier-code committed Oct 19, 2023
1 parent 5d8f8a5 commit 219b810
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
23 changes: 3 additions & 20 deletions src/libs/antares/study/parts/hydro/series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,16 @@ DataSeriesHydro::DataSeriesHydro() :

void DataSeriesHydro::copyGenerationTS(DataSeriesHydro& source)
{
ror = source.ror;
storage = source.storage;
mingen = source.mingen;
ror.timeSeries = source.ror.timeSeries;
storage.timeSeries = source.storage.timeSeries;
mingen.timeSeries = source.mingen.timeSeries;

count = source.count;

source.ror.unloadFromMemory();
source.storage.unloadFromMemory();
source.mingen.unloadFromMemory();
}
void DataSeriesHydro::copyMaxPowerTS(DataSeriesHydro& source)
{
maxHourlyGenPower = source.maxHourlyGenPower;
maxHourlyPumpPower = source.maxHourlyPumpPower;

nbTimeSeriesSup_ = source.nbTimeSeriesSup_;

source.maxHourlyGenPower.unloadFromMemory();
source.maxHourlyPumpPower.unloadFromMemory();
}

bool DataSeriesHydro::saveToFolder(const AreaName& areaID, const AnyString& folder) const
{
Expand Down Expand Up @@ -258,13 +248,6 @@ void DataSeriesHydro::resizeGenerationTS(unsigned int w, unsigned int h)
count = w;
}

void DataSeriesHydro::resizeMaxPowerTS(unsigned int w, unsigned int h)
{
maxHourlyGenPower.reset(w, h);
maxHourlyPumpPower.reset(w, h);
nbTimeSeriesSup_ = w;
}

uint64_t DataSeriesHydro::memoryUsage() const
{
return sizeof(double) + ror.memoryUsage() + storage.memoryUsage() + mingen.memoryUsage();
Expand Down
12 changes: 5 additions & 7 deletions src/libs/antares/study/parts/hydro/series.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class DataSeriesHydro
//@}

void copyGenerationTS(DataSeriesHydro& source);
void copyMaxPowerTS(DataSeriesHydro& source);

//! \name Data
//@{
Expand All @@ -61,7 +60,6 @@ class DataSeriesHydro

void resizeRORandSTORAGE(unsigned int width);
void resizeGenerationTS(unsigned int w, unsigned int h);
void resizeMaxPowerTS(unsigned int w, unsigned int h);

/*!
** \brief Load all data not already loaded
Expand Down Expand Up @@ -139,6 +137,11 @@ class DataSeriesHydro

unsigned int TScount() const { return count; };

/*!
** \brief Monte-Carlo
*/
Matrix<uint32_t> timeseriesNumbers;

/*!
** \brief The number of time-series
**
Expand All @@ -150,11 +153,6 @@ class DataSeriesHydro
private:
uint count = 0;

/*!
** \brief Monte-Carlo
*/
Matrix<uint32_t> timeseriesNumbers;

}; // class DataSeriesHydro

} // namespace Data
Expand Down

0 comments on commit 219b810

Please sign in to comment.