Commit b413112c authored by pitiot's avatar pitiot

l

parent 14ce6b30
......@@ -5,7 +5,7 @@
New behaviour algorithm based on a dynamic model
\*=====================================================================*/
//#define POTENTIAL
#define POTENTIAL
#include "agent.h"
#include "simulator.h"
#include "Geometry/frame.h"
......
......@@ -844,6 +844,7 @@ void SocialAgents::cb_redraw()
clock_gettime(CLOCK_MONOTONIC, &realTime) ;
elapsedTime += timespec_delta(startTime,realTime).tv_nsec ;
clock_gettime(CLOCK_MONOTONIC, &startTime) ;
float refresh = 1;
if(display_times)
{
CGoGNout <<CGoGNendl;
......@@ -858,7 +859,7 @@ void SocialAgents::cb_redraw()
display_times= false;
}
if (elapsedTime/100000000.0f >= nextUpdate)
if (elapsedTime/(1000000000.0f*refresh) >= nextUpdate)
{
// Sortie des stats pour analyse externe
// std::cout << elapsedTime << ";" << frames << ";" << sim.nbUpdates << ";"
......@@ -867,8 +868,8 @@ void SocialAgents::cb_redraw()
// Affichage des stats dans la barre d'état
std::ostringstream oss ;
oss << "Elapsed time : " << elapsedTime/1000000000;
oss << " | " << frames << " fps" ;
oss << "Elapsed time : " << elapsedTime/(1000000000.0f*refresh);
oss << " | " << ((float)frames)/refresh << " fps" ;
oss << " | Iterations " << nbIterations ;
oss << " | Neighbors " << simulator.totalNeighbors
<< " [" << (simulator.nbUpdates == 0 ? 0 : simulator.totalNeighbors / simulator.nbUpdates) << "]" ;
......@@ -892,7 +893,7 @@ void SocialAgents::cb_redraw()
simulator.nbRefineCandidate = 0 ;
simulator.nbCoarsenCandidate = 0 ;
frames = 0 ;
nextUpdate = elapsedTime/100000000.0f + 1 ;
nextUpdate = elapsedTime/(1000000000.0f*refresh) + 1 ;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment