Skip to content
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

Infeasibility analyzer : HydroPower constraint #2227

Merged
merged 8 commits into from
Jul 8, 2024
7 changes: 7 additions & 0 deletions src/solver/infeasible-problem-analysis/constraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <sstream>

#include <boost/algorithm/string/regex.hpp>
#include <boost/regex.hpp>

namespace
{
Expand Down Expand Up @@ -143,6 +144,10 @@ ConstraintType Constraint::getType() const
{
return ConstraintType::hydro_reservoir_level;
}
if (nameComponents_.at(0) == "HydroPower")
{
return ConstraintType::hydro_production_weekly;
}
if (nameComponents_.at(0) == "Level")
{
return ConstraintType::short_term_storage_level;
Expand Down Expand Up @@ -194,6 +199,8 @@ std::string Constraint::prettyPrint() const
case ConstraintType::hydro_reservoir_level:
return "Hydro reservoir constraint at area '" + getAreaName() + "' at hour "
+ getTimeStepInYear();
case ConstraintType::hydro_production_weekly:
return "Hydro weekly production at area '" + getAreaName() + "'";
case ConstraintType::short_term_storage_level:
return "Short-term-storage reservoir constraint at area '" + getAreaName() + "' in STS '"
+ getSTSName() + "' at hour " + getTimeStepInYear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class ConstraintSlackAnalysis: public UnfeasibilityAnalysis

std::vector<const operations_research::MPVariable*> slackVariables_;
const std::string constraint_name_pattern = "^AreaHydroLevel::|::hourly::|::daily::|::weekly::|"
"^FictiveLoads::|^Level::";
"^FictiveLoads::|^Level::|"
"^HydroPower::";
};

} // namespace Antares::Optimization
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ enum class ConstraintType
binding_constraint_weekly,
fictitious_load,
hydro_reservoir_level,
hydro_production_weekly,
short_term_storage_level,
none
};
Expand Down
4 changes: 4 additions & 0 deletions src/solver/infeasible-problem-analysis/report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ void InfeasibleProblemReport::logSuspiciousConstraints()
Antares::logs.error() << "* Hydro reservoir impossible to manage with cumulative options "
"\"hard bounds without heuristic\"";
}
if (nbConstraintsByType_[ConstraintType::hydro_production_weekly] > 0)
{
Antares::logs.error() << "* impossible to generate exactly the weekly hydro target";
}
if (nbConstraintsByType_[ConstraintType::fictitious_load] > 0)
{
Antares::logs.error() << "* Last resort shedding status,";
Expand Down
Loading