diff --git a/src/solver/infeasible-problem-analysis/constraint.cpp b/src/solver/infeasible-problem-analysis/constraint.cpp index 1f04e50cd3..8d9491695e 100644 --- a/src/solver/infeasible-problem-analysis/constraint.cpp +++ b/src/solver/infeasible-problem-analysis/constraint.cpp @@ -26,6 +26,7 @@ #include #include +#include namespace { @@ -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; @@ -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(); diff --git a/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint-slack-analysis.h b/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint-slack-analysis.h index a298b6b026..bb56228b2f 100644 --- a/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint-slack-analysis.h +++ b/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint-slack-analysis.h @@ -57,7 +57,8 @@ class ConstraintSlackAnalysis: public UnfeasibilityAnalysis std::vector slackVariables_; const std::string constraint_name_pattern = "^AreaHydroLevel::|::hourly::|::daily::|::weekly::|" - "^FictiveLoads::|^Level::"; + "^FictiveLoads::|^Level::|" + "^HydroPower::"; }; } // namespace Antares::Optimization diff --git a/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint.h b/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint.h index c5443f951c..92bab3c87b 100644 --- a/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint.h +++ b/src/solver/infeasible-problem-analysis/include/antares/solver/infeasible-problem-analysis/constraint.h @@ -32,6 +32,7 @@ enum class ConstraintType binding_constraint_weekly, fictitious_load, hydro_reservoir_level, + hydro_production_weekly, short_term_storage_level, none }; diff --git a/src/solver/infeasible-problem-analysis/report.cpp b/src/solver/infeasible-problem-analysis/report.cpp index 0964c251ab..2022bfbfd6 100644 --- a/src/solver/infeasible-problem-analysis/report.cpp +++ b/src/solver/infeasible-problem-analysis/report.cpp @@ -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,";