Skip to content

Commit

Permalink
compute rhs
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 16, 2024
1 parent f141935 commit 02f2549
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ static void shortTermStorageLevelsRHS(
}
}

static void shortTermStorageCumulationRHS(
const std::vector<::ShortTermStorage::AREA_INPUT>& shortTermStorageInput,
int numberOfAreas,
std::vector<double>& SecondMembre,
const CORRESPONDANCES_DES_CONTRAINTES_HEBDOMADAIRES&
CorrespondancesDesContraintesHebdomadaires)
{
for (int areaIndex = 0; areaIndex < numberOfAreas; areaIndex++)
{
for (auto& storage: shortTermStorageInput[areaIndex])
{
for (const auto& constraint: storage.additional_constraints)
{
const int clusterGlobalIndex = storage.clusterGlobalIndex;
int cnt = CorrespondancesDesContraintesHebdomadaires.ShortTermStorageCumulation
[constraint.globalIndex];
SecondMembre[cnt] = constraint.rhs;
}
}
}
}

void OPT_InitialiserLeSecondMembreDuProblemeLineaire(PROBLEME_HEBDO* problemeHebdo,
int PremierPdtDeLIntervalle,
int DernierPdtDeLIntervalle,
Expand Down Expand Up @@ -145,7 +167,6 @@ void OPT_InitialiserLeSecondMembreDuProblemeLineaire(PROBLEME_HEBDO* problemeHeb
ProblemeAResoudre->SecondMembre,
CorrespondanceCntNativesCntOptim,
hourInTheYear);

for (uint32_t interco = 0; interco < problemeHebdo->NombreDInterconnexions; interco++)
{
if (const COUTS_DE_TRANSPORT& CoutDeTransport = problemeHebdo->CoutDeTransport[interco];
Expand Down Expand Up @@ -377,6 +398,10 @@ void OPT_InitialiserLeSecondMembreDuProblemeLineaire(PROBLEME_HEBDO* problemeHeb
}
}

shortTermStorageCumulationRHS(problemeHebdo->ShortTermStorage,
problemeHebdo->NombreDePays,
ProblemeAResoudre->SecondMembre,
problemeHebdo->CorrespondanceCntNativesCntOptimHebdomadaires);
if (problemeHebdo->OptimisationAvecCoutsDeDemarrage)
{
OPT_InitialiserLeSecondMembreDuProblemeLineaireCoutsDeDemarrage(problemeHebdo,
Expand Down

0 comments on commit 02f2549

Please sign in to comment.