Skip to content

Commit

Permalink
Fix SAM issue #1417, tested macOS 14.0
Browse files Browse the repository at this point in the history
Note that stochastic simulations not currently available or supported for hybrid configurations.
  • Loading branch information
sjanzou committed Oct 18, 2023
1 parent ed0b465 commit 736ade5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/parametric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2830,8 +2830,7 @@ bool ParametricGridData::RunSimulations_multi()
if (VarValue *vv = &m_par.Setup[col].Values[i])
{
// set for simulation
// m_par.Runs[i]->Override(m_var_names[col], *vv, m_par.Setup[col].ndxHybrid); // TODO: hybrids
m_par.Runs[i]->Override(m_par.Setup[col].varName, *vv, m_par.Setup[col].ndxHybrid); // TODO: hybrids
m_par.Runs[i]->Override(m_par.Setup[col].varName, *vv, m_par.Setup[col].ndxHybrid);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/stochastic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2288,6 +2288,8 @@ void StochasticPanel::Simulate()
{
Simulation *s = new Simulation(m_case, wxString::Format("Stochastic #%d", (int)(i + 1)));
m_sims.push_back(s);

s->Clear(); // resizes inputs for Override to work

for (size_t j = 0; j < m_sd.InputDistributions.size(); j++)
{
Expand All @@ -2299,12 +2301,12 @@ void StochasticPanel::Simulate()
if (!GetWeatherFileForSum(m_input_data(i, j), &weather_file))
continue;
weather_file = m_folder->GetValue() + "/" + weather_file;
s->Override("use_specific_weather_file", VarValue(true), 0); // TODO:hybrids
s->Override("use_specific_weather_file", VarValue(true), 0); // TODO:hybrids NOT currently supported
s->Override("user_specified_weather_file", VarValue(weather_file), 0);
s->Override("use_specific_wf_wind", VarValue(true), 0);
s->Override("user_specified_wf_wind", VarValue(weather_file), 0);
}
else if (m_case->Values(0).Get(iname)->Length() == 1)
else if (m_case->Values(0).Get(iname)->Length() == 1)// hybrids
{
double val[1];
val[0] = (double)m_input_data(i, j);
Expand Down

0 comments on commit 736ade5

Please sign in to comment.