From df8a20f1afa0156c8323c72462a7a672dff0dbf3 Mon Sep 17 00:00:00 2001 From: Abdoulbari Zakir Date: Wed, 18 Dec 2024 17:05:29 +0100 Subject: [PATCH] update --- src/solver/optimisation/constraints/Group1.cpp | 2 +- .../constraints/ShortTermStorageCumulation.cpp | 14 +++++++------- .../constraints/ShortTermStorageCumulation.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/solver/optimisation/constraints/Group1.cpp b/src/solver/optimisation/constraints/Group1.cpp index be8383d822..61de7cf2b3 100644 --- a/src/solver/optimisation/constraints/Group1.cpp +++ b/src/solver/optimisation/constraints/Group1.cpp @@ -137,7 +137,7 @@ void Group1::BuildConstraints() } } - for (uint32_t pays = 0; pays < problemeHebdo_->NombreDePays; pays++) + for (uint32_t pays = 0; pays < problemeHebdo_->NombreDePays; ++pays) { shortTermStorageCumulation.add(pays); } diff --git a/src/solver/optimisation/constraints/ShortTermStorageCumulation.cpp b/src/solver/optimisation/constraints/ShortTermStorageCumulation.cpp index f428b113ee..c44413318b 100644 --- a/src/solver/optimisation/constraints/ShortTermStorageCumulation.cpp +++ b/src/solver/optimisation/constraints/ShortTermStorageCumulation.cpp @@ -50,7 +50,7 @@ class WithdrawalCumulationConstraint: public CumulationConstraint return "WithdrawalSum"; } - virtual ~WithdrawalCumulationConstraint() = default; + ~WithdrawalCumulationConstraint() override = default; }; class InjectionCumulationConstraint: public CumulationConstraint @@ -68,7 +68,7 @@ class InjectionCumulationConstraint: public CumulationConstraint return "InjectionSum"; } - virtual ~InjectionCumulationConstraint() = default; + ~InjectionCumulationConstraint() override = default; }; class NettingCumulationConstraint: public CumulationConstraint @@ -87,7 +87,7 @@ class NettingCumulationConstraint: public CumulationConstraint return "NettingSum"; } - virtual ~NettingCumulationConstraint() = default; + ~NettingCumulationConstraint() override = default; }; std::unique_ptr cumulationConstraintFromVariable(const std::string& variable) @@ -130,18 +130,18 @@ void ShortTermStorageCumulation::add(int pays) for (const auto& storage: data.ShortTermStorage[pays]) { - // TODO global index for constraints for - // data.CorrespondanceCntNativesCntOptimHebdomadaires.ShortTermStorageCumulation[index] for (const auto& constraint: storage.additional_constraints) { - // sum (var[h]) sign rhs, h in list provied by user + // sum (var[h]) sign rhs, h in list provided by user where: + // var = injection for InjectionCumulationConstraint + // var = withdrawal for WithdrawalCumulationConstraint + // var = injectionEfficiency * injection - withdrawalEfficiency * withdrawal for Netting auto constraintHelper = cumulationConstraintFromVariable(constraint.variable); namer.ShortTermStorageCumulation(constraintHelper->name(), builder.data.nombreDeContraintes, storage.name, constraint.name); const auto index = storage.clusterGlobalIndex; - // TODO data.CorrespondanceCntNativesCntOptimHebdomadaires .ShortTermStorageCumulation[constraint.globalIndex] = builder.data.nombreDeContraintes; diff --git a/src/solver/optimisation/include/antares/solver/optimisation/constraints/ShortTermStorageCumulation.h b/src/solver/optimisation/include/antares/solver/optimisation/constraints/ShortTermStorageCumulation.h index 5aa710b956..2c4c540158 100644 --- a/src/solver/optimisation/include/antares/solver/optimisation/constraints/ShortTermStorageCumulation.h +++ b/src/solver/optimisation/include/antares/solver/optimisation/constraints/ShortTermStorageCumulation.h @@ -22,7 +22,7 @@ #pragma once #include "ConstraintBuilder.h" -class ShortTermStorageCumulation: private ConstraintFactory +class ShortTermStorageCumulation: ConstraintFactory { public: ShortTermStorageCumulation(ConstraintBuilder& builder,