From b3de8de7edfa1707edc9e29513264c8e85b552a4 Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Tue, 2 Jul 2024 14:11:28 +0200 Subject: [PATCH] Rename var --- .../study/parts/short-term-storage/properties.h | 2 +- .../study/parts/short-term-storage/properties.cpp | 12 ++++++------ src/solver/simulation/sim_calcul_economique.cpp | 2 +- src/tests/end-to-end/simple_study/simple-study.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/libs/antares/study/include/antares/study/parts/short-term-storage/properties.h b/src/libs/antares/study/include/antares/study/parts/short-term-storage/properties.h index c146d2cbc6..ac1d37e791 100644 --- a/src/libs/antares/study/include/antares/study/parts/short-term-storage/properties.h +++ b/src/libs/antares/study/include/antares/study/parts/short-term-storage/properties.h @@ -48,7 +48,7 @@ class Properties bool initialLevelOptim = false; /// Efficiency factor for injection between 0 and 1 - double efficiencyFactor = 1; + double injectionEfficiency = 1; /// Efficiency factor for withdrawal between 0 and 1 double withdrawalEfficiency = 1; diff --git a/src/libs/antares/study/parts/short-term-storage/properties.cpp b/src/libs/antares/study/parts/short-term-storage/properties.cpp index 546717588e..82ca18c738 100644 --- a/src/libs/antares/study/parts/short-term-storage/properties.cpp +++ b/src/libs/antares/study/parts/short-term-storage/properties.cpp @@ -61,7 +61,7 @@ bool Properties::loadKey(const IniFile::Property* p) if (p->key == "efficiency") { - return p->value.to(this->efficiencyFactor); + return p->value.to(this->injectionEfficiency); } if (p->key == "name") @@ -105,7 +105,7 @@ void Properties::save(IniFile& ini) const s->add("injectionnominalcapacity", this->injectionNominalCapacity); s->add("withdrawalnominalcapacity", this->withdrawalNominalCapacity); - s->add("efficiency", this->efficiencyFactor); + s->add("efficiency", this->injectionEfficiency); s->add("initialleveloptim", this->initialLevelOptim); s->add("enabled", this->enabled); } @@ -157,16 +157,16 @@ bool Properties::validate() return false; } - if (efficiencyFactor < 0) + if (injectionEfficiency < 0) { logs.warning() << "Property efficiency must be >= 0 " << "for short term storage " << name; - efficiencyFactor = 0; + injectionEfficiency = 0; } - if (efficiencyFactor > 1) + if (injectionEfficiency > 1) { logs.warning() << "Property efficiency must be <= 1 " << "for short term storage " << name; - efficiencyFactor = 1; + injectionEfficiency = 1; } if (initialLevel < 0) diff --git a/src/solver/simulation/sim_calcul_economique.cpp b/src/solver/simulation/sim_calcul_economique.cpp index 7fb3336599..12ac5a51b2 100644 --- a/src/solver/simulation/sim_calcul_economique.cpp +++ b/src/solver/simulation/sim_calcul_economique.cpp @@ -53,7 +53,7 @@ static void importShortTermStorages( // Properties toInsert.reservoirCapacity = st.properties.reservoirCapacity.value(); - toInsert.efficiency = st.properties.efficiencyFactor; + toInsert.efficiency = st.properties.injectionEfficiency; toInsert.injectionNominalCapacity = st.properties.injectionNominalCapacity.value(); toInsert.withdrawalNominalCapacity = st.properties.withdrawalNominalCapacity.value(); toInsert.initialLevel = st.properties.initialLevel; diff --git a/src/tests/end-to-end/simple_study/simple-study.cpp b/src/tests/end-to-end/simple_study/simple-study.cpp index 7005057209..2d0613707c 100644 --- a/src/tests/end-to-end/simple_study/simple-study.cpp +++ b/src/tests/end-to-end/simple_study/simple-study.cpp @@ -308,7 +308,7 @@ BOOST_FIXTURE_TEST_CASE(STS_initial_level_is_also_weekly_final_level, StudyFixtu props.injectionNominalCapacity = 10; props.withdrawalNominalCapacity = 10; props.reservoirCapacity = 100; - props.efficiencyFactor = .9; + props.injectionEfficiency = .9; props.initialLevel = .443; props.groupName = std::string("Some STS group"); // Default values for series