@@ -20,35 +20,34 @@ int main()
2020{
2121
2222 printf (" Size of cell from %.2ld to %.2ld bytes \n " , sizeof (cell), sizeof (cell) + sizeof (Fire) + sizeof (Wind));
23-
2423 Connection c = Connection ();
2524 Math1 formula = Math1 ();
2625 auto formulaDecorator = ProfilingDecorator (&formula);
2726 CellStorage s = CellStorage (&formulaDecorator);
2827 auto xRange = std::make_pair<int , int >(0 , getXArea ());
2928 auto yRange = std::make_pair<int , int >(0 , getYArea ()/2 );
30- auto w = std::make_shared<const Wind>(directions::SouthWest, float (5 .0 ), 80 ); // Surgut
29+ auto w = std::make_shared<const Wind>(directions::SouthWest, float (2 .0 ), 20 ); // Surgut
3130 // auto w = std::make_shared<const Wind>(directions::NorthEast, float(2.0)); // Vanderhoof
3231
3332 s.setWindToArea (xRange, yRange, w);
3433
3534 yRange = std::make_pair<int , int >(getYArea ()/2 , getYArea ());
36- w = std::make_shared<const Wind>(directions::SouthEast , float (2.0 ), 80 );
35+ w = std::make_shared<const Wind>(directions::SouthWest , float (2.0 ), 20 );
3736 s.setWindToArea (xRange, yRange, w);
3837
39- for (size_t i = 0 ; i < 10 ; i++)
40- {
38+ // for (size_t i = 0; i < 10; i++)
39+ // {
4140
4241 c.setStatesToStorage (s);
4342
4443 clock_t tStart = clock ();
4544 for (size_t i = 0 ; i < numberOfSimulations (); i++)
4645 {
4746 s.iterate();
48- if ((i % 10 == 0 ) && (i != 0 ))
49- {
50- std::cout << " we have calculated " << i << " iterations" << std::endl;
51- }
47+ // if ((i % 10 == 0) && (i != 0))
48+ // {
49+ // std::cout << "we have calculated " << i << " iterations" << std::endl;
50+ // }
5251 // s.printCurrentStates();
5352 }
5453 // PROCESS_MEMORY_COUNTERS memCounter;
@@ -57,7 +56,7 @@ int main()
5756
5857 printf (" Time taken: %.2fs\n " , (double )(clock () - tStart) / CLOCKS_PER_SEC);
5958
60- };
59+ // };
6160 s.printCurrentStates ();
6261 // s.saveFiresToJson();
6362
@@ -71,11 +70,18 @@ int main()
7170 // fired.push_back(std::make_pair<int, int>(9, 10));
7271 CellStorage other_s = CellStorage (&formulaDecorator);
7372 other_s.uploadFromTxt ();
73+ other_s.iterate();
74+ // other_s.printCurrentStates();
7475 clock_t tStartMetrics = clock ();
7576 // m->calculateVariables(s, fired, burnt);
7677
7778 m->calculateVariablesFrom2Storages (s, other_s);
7879 printf (" Jaccard metric is equal to: %f\n " , m->compute ());
80+ auto simpson_metric = new SimpsonMetric (*m);
81+ printf (" %s metric is equal to: %f\n " , simpson_metric->metricName (), simpson_metric->compute ());
82+ auto sneath_metric = new SneathMetric (*m);
83+ printf (" %s metric is equal to: %f\n " , sneath_metric->metricName (), sneath_metric->compute ());
84+ m->printConfusionMatrix ();
7985 printf (" Time taken: %.2fs\n " , (double )(clock () - tStartMetrics) / CLOCKS_PER_SEC);
8086 return 0 ;
8187}
0 commit comments