diff --git a/methods/Method_D.cpp b/methods/Method_D.cpp index dcba488e5cd196be6a6f92c24fe0414fcddcbe12..2139806828567e3d365c2395036242b721e40036 100644 --- a/methods/Method_D.cpp +++ b/methods/Method_D.cpp @@ -73,6 +73,8 @@ bool Method_D::Process (const PedData& peddata,const std::string& scriptsLocatio _projectRootDir = peddata.GetProjectRootDir(); _measureAreaId = boost::lexical_cast(_areaForMethod_D->_id); _fps =peddata.GetFps(); + Log->Write("INFO:\tFrame rate fps: <%.2f>", _fps); + int minFrame = peddata.GetMinFrame(); if(_startFrame!=_stopFrame) { diff --git a/methods/PedData.cpp b/methods/PedData.cpp index a1e9325300a7d2ae58973b9bdf152388554bb8c1..0e27ec17fed46eb093260a4772401dde748cb570 100644 --- a/methods/PedData.cpp +++ b/methods/PedData.cpp @@ -111,12 +111,15 @@ bool PedData::InitializeVariables(const string& filename) //looking for the framerate which is suppposed to be at the second position if(line[0] == '#') { - std::vector strs; - boost::split(strs, line , boost::is_any_of(":"),boost::token_compress_on); - if(strs[0]=="#framerate" && strs.size()==2) + if(line.find("framerate") != std::string::npos) { - _fps= atof(strs[1].c_str()); + std::vector strs; + line.erase(0,1); // remove # + boost::split(strs, line , boost::is_any_of(":"),boost::token_compress_on); + if(strs.size()>1) + _fps= atof(strs[1].c_str()); + Log->Write("INFO:\tFrame rate fps: <%.2f>", _fps); } @@ -212,7 +215,6 @@ bool PedData::InitializeVariables(const string& filename) std::vector::iterator it; it = unique(unique_ids.begin(), unique_ids.end()); unique_ids.resize(distance(unique_ids.begin(),it)); - _numPeds = unique_ids.size(); Log->Write("INFO: Total number of Agents: %d", _numPeds); CreateGlobalVariables(_numPeds, _numFrames);