Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Dec 13, 2024
1 parent d2123e6 commit 0cfd4ab
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,7 @@ bool AreaList::loadFromFolder(const StudyLoadOptions& options)
fs::path folder = stsFolder / "clusters" / area->id.c_str();

ret = area->shortTermStorage.createSTStorageClustersFromIniFile(folder) && ret;
ret = area->shortTermStorage.LoadConstraintsFromIniFile(folder) && ret;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

namespace Antares::Data::ShortTermStorage {
struct AdditionalConstraint {
std::string name;
std::string cluster_id;
std::string variable;
std::string operatorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool STStorageInput::LoadConstraintsFromIniFile(const fs::path& parent_path)
for (auto* section = ini.firstSection; section; section = section->next)
{
AdditionalConstraint constraint;

constraint.name = section->name.c_str();
for (auto* property = section->firstProperty; property; property = property->next)
{
const std::string key = property->key;
Expand Down
38 changes: 22 additions & 16 deletions src/solver/optimisation/opt_decompte_variables_et_contraintes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
ProblemeAResoudre->NombreDeContraintes += 2; /* 2 constraints bounding the overall
energy generated over the period (10a in
the reference document) */
ProblemeAResoudre
->NombreDeContraintes++; /* 1 constraint setting the level variation over the period
(10b in the reference document) */
ProblemeAResoudre
->NombreDeContraintes++; /* 1 constraint bounding the overall energy pumped over the
period (10c in the reference document) */
ProblemeAResoudre->NombreDeContraintes++;
/* 1 constraint setting the level variation over the period
(10b in the reference document) */
ProblemeAResoudre->NombreDeContraintes++;
/* 1 constraint bounding the overall energy pumped over the
period (10c in the reference document) */
}

if (!Pump && TurbEntreBornes && !MonitorHourlyLev)
Expand Down Expand Up @@ -192,16 +192,16 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
ProblemeAResoudre->NombreDeContraintes += 2; /* 2 constraints bounding the overall
energy generated over the period (10a in
the reference document) */
ProblemeAResoudre
->NombreDeContraintes++; /* 1 constraint setting the level variation over the period
(10b in the reference document) */
ProblemeAResoudre
->NombreDeContraintes++; /* 1 constraint bounding the overall energy pumped over the
period (10c in the reference document) */
ProblemeAResoudre->NombreDeContraintes
+= nombreDePasDeTempsPourUneOptimisation; /* T constraints expressing the level hourly
variations (14a in the reference
document) */
ProblemeAResoudre->NombreDeContraintes++;
/* 1 constraint setting the level variation over the period
(10b in the reference document) */
ProblemeAResoudre->NombreDeContraintes++;
/* 1 constraint bounding the overall energy pumped over the
period (10c in the reference document) */
ProblemeAResoudre->NombreDeContraintes += nombreDePasDeTempsPourUneOptimisation;
/* T constraints expressing the level hourly
variations (14a in the reference
document) */
}
if (!Pump && !TurbEntreBornes && MonitorHourlyLev)
{
Expand Down Expand Up @@ -245,6 +245,12 @@ int OPT_DecompteDesVariablesEtDesContraintesDuProblemeAOptimiser(PROBLEME_HEBDO*
ProblemeAResoudre->NombreDeContraintes
+= 2 * nombreDePasDeTempsPourUneOptimisation;
}
if (!storage.additional_constraints.empty())
{
ProblemeAResoudre->NombreDeContraintes
+= storage.additional_constraints.size()
* nombreDePasDeTempsPourUneOptimisation;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ struct PROPERTIES
bool penalizeVariationInjection;

std::shared_ptr<Antares::Data::ShortTermStorage::Series> series;

std::vector<Antares::Data::ShortTermStorage::AdditionalConstraint> additional_constraints;
int clusterGlobalIndex;
std::string name;
};
Expand Down
2 changes: 1 addition & 1 deletion src/solver/simulation/sim_calcul_economique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static void importShortTermStorages(
toInsert.penalizeVariationInjection = st.properties.penalizeVariationInjection;
toInsert.penalizeVariationWithdrawal = st.properties.penalizeVariationWithdrawal;
toInsert.name = st.properties.name;

toInsert.additional_constraints = st.additional_constraints;
toInsert.series = st.series;

// TODO add missing properties, or use the same struct
Expand Down

0 comments on commit 0cfd4ab

Please sign in to comment.