Skip to content

Commit

Permalink
Infeasibility analyzer : HydroPower constraint (#2227) [ANT-1825]
Browse files Browse the repository at this point in the history
Add constraint that can possibily lead to infeasibilities. HydroPower is the constraint on the sum of generated hydro energy over the week for a given area. The provided RHS in some cases makes the problem infeasible.

---------

Co-authored-by: Florian OMNES <[email protected]>
  • Loading branch information
guilpier-code and flomnes authored Jul 8, 2024
1 parent e9d7c45 commit 0742047
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
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

0 comments on commit 0742047

Please sign in to comment.