99 #include <mesosim/MELoop.h>
100 #include <mesosim/StateHandler.h>
108 #ifdef CHECK_MEMORY_LEAKS
110 #endif // CHECK_MEMORY_LEAKS
159 throw ProcessError(
"A network was not yet constructed.");
167 myRouterTTInitialized(false),
168 myRouterTTDijkstra(0),
172 throw ProcessError(
"A network was already constructed.");
209 std::vector<SUMOTime> stateDumpTimes,
210 std::vector<std::string> stateDumpFiles) {
248 myMsgEmitter.clear();
257 delete MSGlobals::gMesoNet;
313 std::ostringstream msg;
314 msg <<
"Performance: " <<
"\n" <<
" Duration: " << duration <<
" ms" <<
"\n";
317 msg.setf(std::ios::fixed , std::ios::floatfield);
318 msg.setf(std::ios::showpoint);
324 const std::string collisionNotice = (
327 const std::string teleportNotice = (
331 msg <<
"Vehicles: " <<
"\n"
378 MSGlobals::gMesoNet->simulate(
myStep);
463 if (stopTime >= 0 &&
myStep >= stopTime) {
476 return "The final simulation step has been reached.";
478 return "All vehicles have left the simulation.";
480 return "TraCI requested termination.";
482 return "An error occured (see log).";
484 return "Too many vehicles.";
486 return "Unknown reason.";
545 timestep = timestep.substr(0, timestep.length() - 3);
547 std::string filename = output +
"_" + timestep +
".vtp";
567 <<
"meanWaitingTime=\"";
569 od <<
"\" meanTravelTime=\"";
615 std::ostringstream oss;
616 oss.setf(std::ios::fixed , std::ios::floatfield);
617 oss.setf(std::ios::showpoint);
624 oss <<
" (0ms ?*RT. ?";
626 oss <<
"UPS, vehicles"
631 std::cout << oss.str().substr(0, 78 - prev.length());
657 (*i)->vehicleStateChanged(vehicle, to);
679 for (std::map<std::string, MSBusStop*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
682 return stop->
getID();
694 if (routingAlgorithm ==
"dijkstra") {
698 if (routingAlgorithm !=
"astar") {
699 WRITE_WARNING(
"TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm +
"'. using 'astar' instead.");
730 MSNet::getMsgEmitter(
const std::string& whatemit) {
732 msgEmitVec = myMsgEmitter.buildAndGetStaticVector();
733 for (std::vector<MSMessageEmitter*>::iterator it = msgEmitVec.begin(); it != msgEmitVec.end(); ++it) {
734 if ((*it)->getEventsEnabled(whatemit)) {
743 MSNet::createMsgEmitter(std::string&
id,
745 const std::string& base,
746 std::string& whatemit,
751 MSMessageEmitter* msgEmitter =
new MSMessageEmitter(file, base, whatemit, reverse, table, xy, step);
752 myMsgEmitter.add(
id, msgEmitter);