Skip to content

Commit

Permalink
Rename var
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Jul 2, 2024
1 parent 1d9db83 commit b3de8de
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/libs/antares/study/parts/short-term-storage/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ bool Properties::loadKey(const IniFile::Property* p)

if (p->key == "efficiency")
{
return p->value.to<double>(this->efficiencyFactor);
return p->value.to<double>(this->injectionEfficiency);
}

if (p->key == "name")
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
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 @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/end-to-end/simple_study/simple-study.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b3de8de

Please sign in to comment.