diff --git a/README.md b/README.md index 21e451e1..d9fba575 100644 --- a/README.md +++ b/README.md @@ -237,6 +237,10 @@ Telecom gives initial dataset day by day with a lot of fields and zipped. I have ##### COMMENT ON FUZZY ALGORITHM: Needs to be tuned, try different `num_tm` (3 or 4 for Bologna depending on the day). Increasing the number does not uncover the slow mobility (walkers,bikers), but it finds subgroups on higher velocity group. This bias is probably due to the sensitivity of the algorithm to the speed, giving more weight in for the separation for classes that have higher velocity. +# FOR DEVELOPERS +```std::vector poly``` is initialized with a null element in the position 0. Pay attention to that. +Or modify. + # LAUNCH ANALYSIS (WORK IN PROGRESS) ``` ./python/config_subnet_create.py ``` @@ -257,6 +261,7 @@ Output: distribuzione lunghezze e tempi per ogni classe fondamental diagram per ogni classe + #### POSTPROCESSING AGGREGATION PYTHON COMMAND: python3 fondamental_diagram_aggregated.py -c config_fundamental_diagram_aggregated.json diff --git a/source/data_analysis.cpp b/source/data_analysis.cpp index c1f03655..c80e5815 100644 --- a/source/data_analysis.cpp +++ b/source/data_analysis.cpp @@ -2548,11 +2548,16 @@ map> make_subnet(config &config_) int total_crossings = 0; for (const auto &n : poly) {int LocalIter = 0; - if (n.flux.at(t)>0 && n.length>0) + int LocalLength = n.length; // TODO: Handle the fect that the first poly is Invalid. + if (n.flux.at(t)>0 && LocalLength>0) { total_crossings += n.flux.at(t) * n.length; LocalIter++; - if (total_crossings < 0){std::cerr <<"total crossings < 0 at Iter: " << std::to_string(LocalIter); exit(1);} + if (total_crossings < 0) + {std::cerr <<"total crossings < 0 at Iter: " << std::to_string(LocalIter)<< std::endl; + std::cerr << "Length: " << std::to_string(LocalLength) << std::endl; + std::cerr << "Flux: " << std::to_string(n.flux.at(t)) << std::endl; + exit(1);} } } std::cout << "Total crossings per meters: " << total_crossings << std::endl; // totale di metri percorsi dai flussi. diff --git a/source/main_city-pro.cpp b/source/main_city-pro.cpp index a9c5f706..556392da 100644 --- a/source/main_city-pro.cpp +++ b/source/main_city-pro.cpp @@ -53,6 +53,7 @@ std::map> subnets; std::map> classes_flux; // FCM +// NOTE: The first poly is an invalid one, pay attention //------------------------------------------------------------------------------------------------- void idle_cb(void*) {