Commit 89e8a2a7 authored by Mohcine Chraibi's avatar Mohcine Chraibi

Return Evacuation Time as double (not int)

parent ac1a499e
......@@ -278,12 +278,12 @@ bool Simulation::InitArgs()
return true;
}
int Simulation::RunStandardSimulation(double maxSimTime)
double Simulation::RunStandardSimulation(double maxSimTime)
{
RunHeader(_nPeds+_agentSrcManager.GetMaxAgentNumber());
double t = RunBody(maxSimTime);
RunFooter();
return (int) t;
return t;
}
void Simulation::UpdateRoutesAndLocations()
......@@ -478,7 +478,7 @@ void Simulation::RunHeader(long nPed)
ProcessAgentsQueue();
}
int Simulation::RunBody(double maxSimTime)
double Simulation::RunBody(double maxSimTime)
{
//needed to control the execution time PART 1
//in the case you want to run in no faster than realtime
......@@ -548,7 +548,7 @@ int Simulation::RunBody(double maxSimTime)
// while (goal > clock());
++frameNr;
}
return (int) t;
return t;
}
void Simulation::RunFooter()
......
......@@ -139,7 +139,7 @@ public:
/**
* Run the main part of the simulation
*/
int RunBody(double maxSimTime);
double RunBody(double maxSimTime);
/**
* Perform some finalization like writing the
......@@ -151,7 +151,7 @@ public:
* Run a standard simulation
* @return the total simulated/evacuation time
*/
int RunStandardSimulation(double maxSimTime);
double RunStandardSimulation(double maxSimTime);
/**
* print some statistics about the simulation
......
......@@ -73,7 +73,7 @@ int main(int argc, char** argv)
if (status && sim.InitArgs()) {
//evacuation time
int evacTime = 0;
double evacTime = 0;
Log->Write("INFO: \tStart runSimulation() with %d pedestrians", sim.GetPedsNumber());
#ifdef _JPS_AS_A_SERVICE
......
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