Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 18, 2024
1 parent 2dc8d74 commit df8a20f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/solver/optimisation/constraints/Group1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class WithdrawalCumulationConstraint: public CumulationConstraint
return "WithdrawalSum";
}

virtual ~WithdrawalCumulationConstraint() = default;
~WithdrawalCumulationConstraint() override = default;
};

class InjectionCumulationConstraint: public CumulationConstraint
Expand All @@ -68,7 +68,7 @@ class InjectionCumulationConstraint: public CumulationConstraint
return "InjectionSum";
}

virtual ~InjectionCumulationConstraint() = default;
~InjectionCumulationConstraint() override = default;
};

class NettingCumulationConstraint: public CumulationConstraint
Expand All @@ -87,7 +87,7 @@ class NettingCumulationConstraint: public CumulationConstraint
return "NettingSum";
}

virtual ~NettingCumulationConstraint() = default;
~NettingCumulationConstraint() override = default;
};

std::unique_ptr<CumulationConstraint> cumulationConstraintFromVariable(const std::string& variable)
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#pragma once
#include "ConstraintBuilder.h"

class ShortTermStorageCumulation: private ConstraintFactory
class ShortTermStorageCumulation: ConstraintFactory
{
public:
ShortTermStorageCumulation(ConstraintBuilder& builder,
Expand Down

0 comments on commit df8a20f

Please sign in to comment.