Skip to content

Commit

Permalink
Simplify TS numbers draws : test : removing empty TS management. Does…
Browse files Browse the repository at this point in the history
… it fail ?
  • Loading branch information
guilpier-code committed Nov 30, 2023
1 parent 9355df0 commit 95c631c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/libs/antares/series/series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,17 @@ int TimeSeries::saveToFolder(const AreaName& areaID,

double TimeSeries::getCoefficient(uint32_t year, uint32_t timestep) const
{
if (timeSeries.width == 0)
return 0;
return timeSeries[getSeriesIndex(year)][timestep];
}

const double* TimeSeries::getColumn(uint32_t year) const
{
if (timeSeries.width == 0)
return emptyColumn;
return timeSeries[getSeriesIndex(year)];
}

uint32_t TimeSeries::getSeriesIndex(uint32_t year) const
{
if (timeSeries.width == 1)
return 0;
else
return timeseriesNumbers[0][year];
return timeseriesNumbers[0][year];
}

double* TimeSeries::operator[](uint32_t index)
Expand Down
2 changes: 1 addition & 1 deletion src/solver/simulation/timeseries-numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ bool TimeSeriesNumbers::Generate(Study& study)

for (uint year = 0; year < years; ++year)
{
// Intra-modal TS : draw and store TS numbres
// Intra-modal TS : draw and store TS numbers
drawTSnumbersForIntraModal(
intramodal_draws, isTSintramodal, nbTimeseriesByMode, study.runtime->random);
storeTSnumbersForIntraModal(intramodal_draws, isTSintramodal, year, study.areas);
Expand Down

0 comments on commit 95c631c

Please sign in to comment.