100 #include <mesosim/MELoop.h>
108 #ifdef CHECK_MEMORY_LEAKS
110 #endif // CHECK_MEMORY_LEAKS
163 throw ProcessError(
"A network was not yet constructed.");
171 myRouterTTInitialized(false),
172 myRouterTTDijkstra(0),
175 myPedestrianRouter(0) {
177 throw ProcessError(
"A network was already constructed.");
215 std::vector<SUMOTime> stateDumpTimes,
216 std::vector<std::string> stateDumpFiles) {
261 delete MSGlobals::gMesoNet;
323 std::ostringstream msg;
325 msg <<
"Performance: " <<
"\n" <<
" Duration: " << duration <<
" ms" <<
"\n";
328 msg.setf(std::ios::fixed , std::ios::floatfield);
329 msg.setf(std::ios::showpoint);
335 msg <<
"Vehicles: " <<
"\n"
342 std::vector<std::string> reasons;
400 MSGlobals::gMesoNet->simulate(
myStep);
484 if (stopTime >= 0 &&
myStep >= stopTime) {
497 return "The final simulation step has been reached.";
499 return "All vehicles have left the simulation.";
501 return "TraCI requested termination.";
503 return "An error occured (see log).";
505 return "Too many vehicles.";
507 return "Unknown reason.";
567 timestep = timestep.substr(0, timestep.length() - 3);
569 std::string filename = output +
"_" + timestep +
".vtp";
590 .writeAttr(
"meanWaitingTime", meanWaitingTime).
writeAttr(
"meanTravelTime", meanTravelTime);
606 for (std::vector<MSEdge*>::const_iterator i = edges.begin(); i != edges.end(); ++i) {
607 const std::vector<MSLane*>& lanes = (*i)->getLanes();
608 for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
609 const std::vector<MSLink*>& links = (*j)->getLinkCont();
610 for (std::vector<MSLink*>::const_iterator k = links.begin(); k != links.end(); ++k) {
611 (*k)->writeApproaching(od, (*j)->getID());
653 std::ostringstream oss;
654 oss.setf(std::ios::fixed , std::ios::floatfield);
655 oss.setf(std::ios::showpoint);
662 oss <<
" (0ms ?*RT. ?";
664 oss <<
"UPS, vehicles"
669 std::cout << oss.str().substr(0, 78 - prev.length());
695 (*i)->vehicleStateChanged(vehicle, to);
717 for (std::map<std::string, MSBusStop*>::const_iterator it = vals.begin(); it != vals.end(); ++it) {
720 return stop->
getID();
732 if (routingAlgorithm ==
"dijkstra") {
736 if (routingAlgorithm !=
"astar") {
737 WRITE_WARNING(
"TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm +
"'. using 'astar' instead.");