-
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
Update Final reservoir level implementation - cr25 #1564
Changes from 2 commits
4ffcfd0
e191e5a
d38d482
0c37370
41dd16d
94648ef
0cda6fe
950a0a2
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 | ||||
---|---|---|---|---|---|---|
|
@@ -46,6 +46,7 @@ FinalLevelInflowsModifier::FinalLevelInflowsModifier(const PartHydro& hydro, | |||||
bool FinalLevelInflowsModifier::CheckInfeasibility(uint year) | ||||||
{ | ||||||
ComputeDelta(year); | ||||||
logInfoFinLvlNotApplicable(year); | ||||||
|
||||||
if (!isActive()) | ||||||
return true; | ||||||
|
@@ -147,6 +148,18 @@ bool FinalLevelInflowsModifier::isActive() | |||||
isValidLevel(initialReservoirLevel_); | ||||||
} | ||||||
|
||||||
// if the user specifies the final reservoir level, but does not specifies initial reservoir level | ||||||
// or uses wrong hydro options | ||||||
// we should inform the user that the final reservoir level wont be reached | ||||||
void FinalLevelInflowsModifier::logInfoFinLvlNotApplicable(uint year) | ||||||
{ | ||||||
if (isValidLevel(finalReservoirLevel_) | ||||||
&& (!hydro_.reservoirManagement || hydro_.useWaterValue | ||||||
|| !isValidLevel(initialReservoirLevel_))) | ||||||
logs.info() << "Final reservoir level not applicable! Year:" << year + 1 | ||||||
<< ", Area:" << areaName_; | ||||||
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. Please tell the user why the final level is not applicable, so that they can change their input data accordingly. |
||||||
} | ||||||
|
||||||
bool FinalLevelInflowsModifier::makeChecks(uint year) | ||||||
{ | ||||||
// Simulation must end on day 365 and reservoir level must be initiated in January | ||||||
|
@@ -169,7 +182,7 @@ bool FinalLevelInflowsModifier::isApplicable(uint year) | |||||
{ | ||||||
// If isApplicable_.size() == 0, then instance was not properly initialized | ||||||
// and is not applicable. | ||||||
return isActive() && isApplicable_.size() && isApplicable_.at(year); | ||||||
return isApplicable_.size() && isApplicable_.at(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. Both versions are correct, though using
Suggested change
|
||||||
} | ||||||
|
||||||
} // namespace Antares::Data |
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.
To me, there is some inconsistencies here :
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.
These info logs are as Florian suggested for crazy users.
For example, final_level is set to 55% but initila_level is left at rand.
In this case, we log out that for the specified MC-year and area, the final reservoir level won't be implemented (will be skipped). But we continue on implementation for the next year/area.
Logic won't be implemented for this year/area because "isApplicable_" is going to be false for that year/area.
This behavior should be distinguished from the one when some of the pre-checks fail and we break the simulation immediately.
So we have situations where we exit Antares asap, or we skip the year/area and throw an info log.