-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify TS numbers drawings, fix bug related to refresh & local thermal generation #1752
Changes from 41 commits
7239dc1
8fa5257
106df5e
f2ebc1a
60cefd6
4416e6b
cdbde28
e45e560
561c156
868cd1c
57d65e0
123056b
0f00962
5a9b61e
80d5335
c607d9c
c8d6bac
610a7b6
80aba94
935bcc5
5568862
2433c84
9355df0
95c631c
19df9ac
ceb8a73
3580fe0
d707e59
47c0871
4a5b20c
d1edf1d
6d14a07
f42bde3
bcd83c3
08b3609
45486ce
416a9bf
3ef29e8
a733e0b
f900c39
009f3d7
470524f
d446816
b990b4c
3104805
6fff86c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,14 +277,14 @@ void Area::resizeAllTimeseriesNumbers(uint n) | |
} | ||
else | ||
{ | ||
load.series.timeseriesNumbers.resize(1, n); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explanation : now we reset (resize + assign zeros), which makes TS number zero by default. This allows to reduce the amount of code in timeseries-numbers.cpp (see changes in GenerateDeratedMode(...) for instance) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can put this as a comment in the code ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
What kind of comment do you want to put exactly ? |
||
solar.series.timeseriesNumbers.resize(1, n); | ||
wind.series.timeseriesNumbers.resize(1, n); | ||
hydro.series->timeseriesNumbers.resize(1, n); | ||
load.series.timeseriesNumbers.reset(1, n); | ||
solar.series.timeseriesNumbers.reset(1, n); | ||
wind.series.timeseriesNumbers.reset(1, n); | ||
hydro.series->timeseriesNumbers.reset(1, n); | ||
for (auto& namedLink : links) | ||
{ | ||
AreaLink* link = namedLink.second; | ||
link->timeseriesNumbers.resize(1, n); | ||
link->timeseriesNumbers.reset(1, n); | ||
} | ||
} | ||
thermal.resizeAllTimeseriesNumbers(n); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,11 +236,22 @@ void DataSeriesHydro::reset() | |
count = 1; | ||
} | ||
|
||
void DataSeriesHydro::resizeRORandSTORAGE(unsigned int width) | ||
void DataSeriesHydro::resize_ROR_STORAGE_MINGEN_whenGeneratedTS(unsigned int newWidth) | ||
{ | ||
ror.resize(width, HOURS_PER_YEAR); | ||
storage.resize(width, DAYS_PER_YEAR); | ||
count = width; | ||
ror.resize(newWidth, HOURS_PER_YEAR); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explanations : in case we generate hydro TS, ror and storage are generated, but not mingen.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you include this as a comment ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done |
||
storage.resize(newWidth, DAYS_PER_YEAR); | ||
|
||
// Resizing mingen : new extra columns are copies of the first column. | ||
// Note that mingen has necessarily one column at least, by construction | ||
flomnes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uint mingenOriginalSize = mingen.timeSeries.width; | ||
mingen.timeSeries.resizeWithoutDataLost(newWidth, mingen.timeSeries.height); | ||
if (mingenOriginalSize < newWidth) | ||
{ | ||
for (uint col = mingenOriginalSize; col < newWidth; ++col) | ||
mingen.timeSeries.pasteToColumn(col, mingen[0]); | ||
} | ||
|
||
count = newWidth; | ||
} | ||
|
||
void DataSeriesHydro::resizeGenerationTS(unsigned int w, unsigned int h) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,6 +312,8 @@ void ISimulation<Impl>::run() | |
|
||
ImplementationType::setNbPerformedYearsInParallel(pNbMaxPerformedYearsInParallel); | ||
|
||
TSGenerator::ResizeGeneratedTimeSeries(study.areas, study.parameters); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explanations : this is the place where we call the resizing for TS to be generated. |
||
|
||
if (settings.tsGeneratorsOnly) | ||
{ | ||
// Only the preprocessors can be used | ||
|
@@ -323,7 +325,7 @@ void ISimulation<Impl>::run() | |
|
||
// Destroy the TS Generators if any | ||
// It will export the time-series into the output in the same time | ||
Solver::TSGenerator::DestroyAll(study); | ||
TSGenerator::DestroyAll(study); | ||
} | ||
else | ||
{ | ||
|
@@ -370,7 +372,7 @@ void ISimulation<Impl>::run() | |
} | ||
// Destroy the TS Generators if any | ||
// It will export the time-series into the output in the same time | ||
Solver::TSGenerator::DestroyAll(study); | ||
TSGenerator::DestroyAll(study); | ||
|
||
// Post operations | ||
{ | ||
|
@@ -449,7 +451,7 @@ void ISimulation<Impl>::regenerateTimeSeries(uint year) | |
// * The option "Preprocessor" is checked in the interface _and_ year == 0 | ||
// * Both options "Preprocessor" and "Refresh" are checked in the interface | ||
// _and_ the refresh must be done for the given year (always done for the first year). | ||
using namespace Solver::TSGenerator; | ||
using namespace TSGenerator; | ||
// Load | ||
if (pData.haveToRefreshTSLoad && (year % pData.refreshIntervalLoad == 0)) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR contains console logs. Please review or remove them.