Skip to content
Snippets Groups Projects
Commit f880bb0f authored by Armin Co's avatar Armin Co
Browse files

Smoother wind calculation.

parent 3370b81b
Loading
...@@ -13,9 +13,10 @@ SmartGridModel::SmartGridModel(HardwareControl &modell) ...@@ -13,9 +13,10 @@ SmartGridModel::SmartGridModel(HardwareControl &modell)
void SmartGridModel::update_wind() void SmartGridModel::update_wind()
{ {
auto wind_by_sun = m_sun * 9.0 / 100.0; // wind by sun should be 5 max. auto base_wind = 10.0;
auto random_wind = ((std::rand() * 1.0) / RAND_MAX) * 1.0; auto wind_by_sun = m_sun * 10.0;
m_wind = power_wind[static_cast<int>(wind_by_sun + random_wind)]; auto random_wind = (((std::rand() * 1.0) / RAND_MAX) * 2.0) - 1.0;
m_wind = base_wind + wind_by_sun + random_wind;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment