95 #include <mesosim/MELoop.h>
103 #ifdef CHECK_MEMORY_LEAKS
105 #endif // CHECK_MEMORY_LEAKS
154 throw ProcessError(
"A network was not yet constructed.");
162 myRouterTTInitialized(false),
163 myRouterTTDijkstra(0),
167 throw ProcessError(
"A network was already constructed.");
204 std::vector<SUMOTime> stateDumpTimes,
205 std::vector<std::string> stateDumpFiles) {
248 delete MSGlobals::gMesoNet;
311 std::ostringstream msg;
312 msg <<
"Performance: " <<
"\n" <<
" Duration: " << duration <<
" ms" <<
"\n";
315 msg.setf(std::ios::fixed , std::ios::floatfield);
316 msg.setf(std::ios::showpoint);
322 const std::string collisionNotice = (
325 const std::string teleportNotice = (
329 msg <<
"Vehicles: " <<
"\n"
374 MSGlobals::gMesoNet->simulate(
myStep);
458 if (stopTime >= 0 &&
myStep >= stopTime) {
471 return "The final simulation step has been reached.";
473 return "All vehicles have left the simulation.";
475 return "TraCI requested termination.";
477 return "An error occured (see log).";
479 return "Too many vehicles.";
481 return "Unknown reason.";
540 timestep = timestep.substr(0, timestep.length() - 3);
542 std::string filename = output +
"_" + timestep +
".vtp";
562 <<
"meanWaitingTime=\"";
564 od <<
"\" meanTravelTime=\"";
581 for (std::vector<MSEdge*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
582 const std::vector<MSLane*>& lanes = (*i)->getLanes();
583 for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
584 const std::vector<MSLink*>& links = (*j)->getLinkCont();
585 for (std::vector<MSLink*>::const_iterator k = links.begin(); k != links.end(); ++k) {
586 (*k)->writeApproaching(od, (*j)->getID());
628 std::ostringstream oss;
629 oss.setf(std::ios::fixed , std::ios::floatfield);
630 oss.setf(std::ios::showpoint);
637 oss <<
" (0ms ?*RT. ?";
639 oss <<
"UPS, vehicles"
644 std::cout << oss.str().substr(0, 78 - prev.length());
670 (*i)->vehicleStateChanged(vehicle, to);
692 for (std::map<std::string, MSBusStop*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
695 return stop->
getID();
707 if (routingAlgorithm ==
"dijkstra") {
711 if (routingAlgorithm !=
"astar") {
712 WRITE_WARNING(
"TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm +
"'. using 'astar' instead.");