Commit 03e4a1ce authored by Mohcine Chraibi's avatar Mohcine Chraibi

Small changes

parent 20884fdf
...@@ -88,9 +88,10 @@ int main(int argc, char** argv) ...@@ -88,9 +88,10 @@ int main(int argc, char** argv)
if (sim.GetAgentSrcManager().GetMaxAgentNumber()) { if (sim.GetAgentSrcManager().GetMaxAgentNumber()) {
//Start the thread for managing the sources of agents if any //Start the thread for managing the sources of agents if any
//std::thread t1(sim.GetAgentSrcManager()); //std::thread t1(sim.GetAgentSrcManager());
std::thread t1(&AgentsSourcesManager::Run, &sim.GetAgentSrcManager()); double simMaxTime = configuration->GetTmax();
std::thread t1(&AgentsSourcesManager::Run, &sim.GetAgentSrcManager());//@todo pass simMaxTime to Run
//main thread for the simulation //main thread for the simulation
evacTime = sim.RunStandardSimulation(configuration->GetTmax()); evacTime = sim.RunStandardSimulation(simMaxTime);
//Join the main thread //Join the main thread
t1.join(); t1.join();
} }
......
...@@ -81,12 +81,11 @@ void AgentsSourcesManager::Run() ...@@ -81,12 +81,11 @@ void AgentsSourcesManager::Run()
bool finished = false; bool finished = false;
long updateFrequency = 1; long updateFrequency = 1;
do do
{ { //@todo: break if max simulation time is reached.
int current_time = (int)Pedestrian::GetGlobalTime(); int current_time = (int)Pedestrian::GetGlobalTime();
if ((current_time != _lastUpdateTime) if ((current_time != _lastUpdateTime)
&& ((current_time % updateFrequency) == 0)) && ((current_time % updateFrequency) == 0))
{ {
finished=ProcessAllSources(); finished=ProcessAllSources();
_lastUpdateTime = current_time; _lastUpdateTime = current_time;
} }
......
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