Commit 284749ab authored by Mohcine Chraibi's avatar Mohcine Chraibi

fixes #309

- Write statistics avery 1000 frame.
- Add simulation time to the written information

WARNING: I deactivated ai_router_trips files, since I don't know where
they are (Tobi @schroedter1 ?)
parent c5424586
Pipeline #18283 passed with stages
in 18 minutes and 51 seconds
......@@ -594,20 +594,20 @@ routing/ai_router/perception/sign.cpp
routing/ai_router/Cortex.cpp
#AI router trips
routing/ai_router_trips/AIRouterTrips.cpp
routing/ai_router_trips/BrainStorage.cpp
routing/ai_router_trips/cognitiveMap/associations.cpp
routing/ai_router_trips/cognitiveMap/connection.cpp
routing/ai_router_trips/cognitiveMap/cognitivemap.cpp
routing/ai_router_trips/cognitiveMap/landmark.cpp
routing/ai_router_trips/cognitiveMap/region.cpp
routing/ai_router_trips/cognitiveMap/landmarknetwork.cpp
routing/ai_router_trips/cognitiveMap/internnavigationnetwork.cpp
routing/ai_router_trips/perception/visualsystem.cpp
routing/ai_router_trips/perception/visibleenvironment.cpp
routing/ai_router_trips/perception/cgalgeometry.cpp
routing/ai_router_trips/perception/sign.cpp
routing/ai_router_trips/Cortex.cpp
#routing/ai_router_trips/AIRouterTrips.cpp
#routing/ai_router_trips/BrainStorage.cpp
#routing/ai_router_trips/cognitiveMap/associations.cpp
#routing/ai_router_trips/cognitiveMap/connection.cpp
#routing/ai_router_trips/cognitiveMap/cognitivemap.cpp
#routing/ai_router_trips/cognitiveMap/landmark.cpp
#routing/ai_router_trips/cognitiveMap/region.cpp
#routing/ai_router_trips/cognitiveMap/landmarknetwork.cpp
#routing/ai_router_trips/cognitiveMap/internnavigationnetwork.cpp
#routing/ai_router_trips/perception/visualsystem.cpp
#routing/ai_router_trips/perception/visibleenvironment.cpp
#routing/ai_router_trips/perception/cgalgeometry.cpp
#routing/ai_router_trips/perception/sign.cpp
#routing/ai_router_trips/Cortex.cpp
)
SET(AIROUTER_HDR
......
......@@ -390,9 +390,9 @@ void Simulation::UpdateRoutesAndLocations()
// }
}
void Simulation::PrintStatistics()
void Simulation::PrintStatistics(double simTime)
{
Log->Write("\nRooms Egress Time:");
Log->Write("\nRooms Egress. Simulation Time: %.2f", simTime);
Log->Write("==================");
Log->Write("id\tcaption\tegress time (s)");
......@@ -421,6 +421,7 @@ void Simulation::PrintStatistics()
}
Log->Write("More Information in the file: %s", statsfile.c_str());
auto output = new FileHandler(statsfile.c_str());
output->Write("#Simulation time: %.2f", simTime);
output->Write("#Flow at exit "+goal->GetCaption()+"( ID "+to_string(goal->GetID())+" )");
output->Write("#Time (s) cummulative number of agents \n");
output->Write(goal->GetFlowCurve());
......@@ -441,6 +442,7 @@ void Simulation::PrintStatistics()
+ to_string(itr.first/1000) + "_" + to_string(itr.first % 1000) +".dat";
Log->Write("More Information in the file: %s", statsfile.c_str());
auto output = new FileHandler(statsfile.c_str());
output->Write("#Simulation time: %.2f", simTime);
output->Write("#Flow at crossing " + goal->GetCaption() + "( ID " + to_string(goal->GetID())
+ " ) in Room ( ID "+ to_string(itr.first / 1000) + " )");
output->Write("#Time (s) cummulative number of agents \n");
......@@ -593,6 +595,13 @@ double Simulation::RunBody(double maxSimTime)
}
if(frameNr % 1000 == 0)
{
Log->Write("INFO:\tUpdate door statistics at t=%.2f", t);
PrintStatistics(t);
}
}// while time
return t;
}
......
......@@ -157,7 +157,7 @@ public:
/**
* print some statistics about the simulation
*/
void PrintStatistics();
void PrintStatistics(double time);
/**
* @return the agents source manager
......
......@@ -106,7 +106,7 @@ int main(int argc, char** argv)
// some statistics output
if (configuration->ShowStatistics()) {
sim.PrintStatistics();
sim.PrintStatistics(evacTime);// negative means end of simulation
}
if (sim.GetPedsNumber()) {
......
  • ai_router_trips files were only accidentally committed, we will not need them at the moment.

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