Skip to content

Commit

Permalink
active cumulation constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 16, 2024
1 parent af38876 commit 8c49f56
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/solver/optimisation/constraints/Group1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "antares/solver/optimisation/constraints/Group1.h"

#include "antares/solver/optimisation/constraints/ShortTermStorageCostVariation.h"
#include "antares/solver/optimisation/constraints/ShortTermStorageCumulation.h"

AreaBalanceData Group1::GetAreaBalanceData()
{
Expand Down Expand Up @@ -49,6 +50,15 @@ ShortTermStorageData Group1::GetShortTermStorageData()
};
}

ShortTermStorageCumulativeConstraintData Group1::ShortTermStorageCumulativeConstraintData()
{
return {
problemeHebdo_->CorrespondanceCntNativesCntOptim,
problemeHebdo_->ShortTermStorage,
problemeHebdo_->CorrespondanceCntNativesCntOptimHebdomadaires
};
}

FlowDissociationData Group1::GetFlowDissociationData()
{
return {.CorrespondanceCntNativesCntOptim = problemeHebdo_->CorrespondanceCntNativesCntOptim,
Expand Down Expand Up @@ -89,6 +99,11 @@ void Group1::BuildConstraints()
ShortTermStorageCostVariationWithdrawalForward shortTermStorageCostVariationWithdrawalForward(
builder_,
shortTermStorageData);

auto shortTermStorageCumulativeConstraintData = GetShortTermStorageCumulativeConstraintData();
ShortTermStorageCumulation shortTermStorageCumulation(builder_,
shortTermStorageCumulativeConstraintData);

auto flowDissociationData = GetFlowDissociationData();
FlowDissociation flowDissociation(builder_, flowDissociationData);

Expand Down Expand Up @@ -123,4 +138,9 @@ void Group1::BuildConstraints()
bindingConstraintHour.add(pdt, cntCouplante);
}
}

for (uint32_t pays = 0; pays < problemeHebdo_->NombreDePays; pays++)
{
shortTermStorageCumulation.add(pays);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -308,5 +308,5 @@ struct ShortTermStorageData

struct ShortTermStorageCumulativeConstraintData: ShortTermStorageData
{
CORRESPONDANCES_DES_CONTRAINTES_HEBDOMADAIRES CorrespondanceCntNativesCntOptimHebdomadaires;
CORRESPONDANCES_DES_CONTRAINTES_HEBDOMADAIRES& CorrespondanceCntNativesCntOptimHebdomadaires;
};

0 comments on commit 8c49f56

Please sign in to comment.