diff --git a/Analysis.cpp b/Analysis.cpp index 748931aeea06199c2f7f1bb7cb9055551e6f99f9..7fce560cb304999adf3ab07aa4c47a8c0d808400 100644 --- a/Analysis.cpp +++ b/Analysis.cpp @@ -398,6 +398,7 @@ int Analysis::RunAnalysis(const string& filename, const string& path) if(result_D) { Log->Write("INFO:\tSuccess with Method D using measurement area id %d!\n",_areaForMethod_D[i]->_id); + std::cout << "INFO:\tSuccess with Method D using measurement area id "<< _areaForMethod_D[i]->_id << "\n"; if(_plotTimeseriesD[i]) { string parameters_Timeseries="python \""+_scriptsLocation+"/_Plot_timeseries_rho_v.py\" -p \""+ _projectRootDir+VORO_LOCATION + "\" -n "+filename+ diff --git a/main.cpp b/main.cpp index 06a0855ce8f991fcb99abf1e6d8dcfc910016b1b..c9c1b80fd70dbf5fc213ab7f361633e4329f8042 100644 --- a/main.cpp +++ b/main.cpp @@ -1,8 +1,8 @@ /** * \file main.cpp * \date Oct 10, 2014 - * \version v0.8.1 - * \copyright <2009-2015> Forschungszentrum Juelich GmbH. All rights reserved. + * \version v0.8.3 + * \copyright <2009-2018> Forschungszentrum Juelich GmbH. All rights reserved. * * \section License * This file is part of JuPedSim. @@ -29,18 +29,20 @@ * **/ +#include <chrono> #include "geometry/Building.h" #include "general/ArgumentParser.h" #include "Analysis.h" using namespace std; +using namespace std::chrono; int main(int argc, char **argv) { Log = new STDIOHandler(); // Parsing the arguments ArgumentParser* args = new ArgumentParser(); - + std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now(); if(args->ParseArgs(argc, argv)) { @@ -58,6 +60,7 @@ int main(int argc, char **argv) analysis.RunAnalysis(file, path); Log->Write("**********************************************************************"); Log->Write("INFO: \tEnd Analysis for the file: %s\n",file.c_str()); + std::cout << "INFO: \tEnd Analysis for the file: " << file.c_str() << "\n"; } } else @@ -65,9 +68,15 @@ int main(int argc, char **argv) //Log->Write("INFO:\tFail to parse the ini file"); Log->Write("INFO:\tFinishing..."); } + //do the last cleaning - delete args; - delete Log; + std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now(); + float duration = std::chrono::duration_cast<std::chrono::microseconds>(end - begin).count()/1000000.0; + Log->Write("Time elapsed:\t %0.2f [s]\n", duration); + + std::cout << "Time elapsed:\t " << duration << " [s]\n"; - return (EXIT_SUCCESS); + delete args; + delete Log; + return (EXIT_SUCCESS); } diff --git a/methods/Method_D.cpp b/methods/Method_D.cpp index 7444010f18b578514d04b0d14f33dbf027320656..41c11599066f8532812d1c5ec2b2e12af49a5d18 100644 --- a/methods/Method_D.cpp +++ b/methods/Method_D.cpp @@ -130,9 +130,9 @@ bool Method_D::Process (const PedData& peddata,const std::string& scriptsLocatio std::ostringstream ss; ss << std::setw(5) << std::setfill('0') << frid; const std::string str_frid = ss.str(); - if(!(frid%10)) + if(!(frid%50)) { - Log->Write("frame ID = %d",frid); + Log->Write("INFO:\tframe ID = %d",frid); } vector<int> ids=_peds_t[frameNr]; vector<int> IdInFrame = peddata.GetIdInFrame(frameNr, ids, zPos_measureArea); @@ -211,7 +211,7 @@ bool Method_D::Process (const PedData& peddata,const std::string& scriptsLocatio } // if N >3 else { - Log->Write("INFO: \tThe number of the pedestrians is less than 2. Frame = %d (minFrame = %d)\n", frid, minFrame); + Log->Write("INFO: \tThe number of the pedestrians is small (%d). Frame = %d (minFrame = %d)\n", NumPeds, frid, minFrame); } } fclose(_fVoronoiRhoV);