@@ -21,10 +21,11 @@ double Math1::calculateKoef(float windSpeed, double slopeAngleRad) const
2121double Math1::calculateWindKoef (const cell *c, directions InvestigatedDirection) const
2222{
2323 auto wind = c->getWind ().get ();
24- if (wind == nullptr ){
24+ if (wind == nullptr )
25+ {
2526 return double (1 );
2627 }
27- float angleRadians = wind->angleBetweenDirections (InvestigatedDirection);// * pi() / 180;
28+ float angleRadians = wind->angleBetweenDirections (InvestigatedDirection); // * pi() / 180;
2829 double result = std::exp (wind->getWindSpeed () * (cos (angleRadians) - 1 ));
2930 result_wind_[result]++;
3031 return result;
@@ -43,7 +44,8 @@ double Math1::calculateGroundSlopeKoef(directions InvestigatedDirection, int alt
4344 coef = atan2 (static_cast <double >(altitudeDifference), static_cast <double >(cellSizeInMeters () * sqrt (2.0 )));
4445 }
4546 double result = std::exp (0.5 * coef);
46- result_slope_[result]++;
47+ SlopeMetaData meta = {InvestigatedDirection, altitudeDifference};
48+ result_slope_[meta]++;
4749 return result;
4850}
4951
@@ -65,19 +67,26 @@ bool Math1::willSpreadThroughOne(const cell *c, directions InvestigatedDirection
6567
6668Math1::~Math1 ()
6769{
68- printf (" slope profiling\n " );
70+ printf (" slope profiling\n " );
71+ std::map<int , int > slope_distribution;
6972 for (auto &&i : result_slope_)
7073 {
71- printf (" %2.2f;%d\n " ,i.first , i.second );
74+ printf (" %d,%d;%d\n " , i.first .altitude_difference_ , static_cast <int >(i.first .investigated_direction_ ), i.second );
75+ slope_distribution[i.second ]++;
76+ }
77+ printf (" slope distribution\n " );
78+ for (auto &&i : slope_distribution)
79+ {
80+ printf (" %d;%d\n " , i.first , i.second );
7281 }
73- printf (" wind profiling\n " );
82+ printf (" wind profiling\n " );
7483 for (auto &&i : result_wind_)
7584 {
76- printf (" %2.2f;%d\n " ,i.first , i.second );
85+ printf (" %2.2f;%d\n " , i.first , i.second );
7786 }
78- printf (" overall profiling\n " );
87+ printf (" overall profiling\n " );
7988 for (auto &&i : result_overall)
8089 {
81- printf (" %d;%d\n " ,i.first , i.second );
90+ printf (" %d;%d\n " , i.first , i.second );
8291 }
8392}
0 commit comments