Eclipse SUMO - Simulation of Urban MObility
MSNet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
22 // The simulated network and simulation perfomer
23 /****************************************************************************/
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #include <config.h>
30 
31 #ifdef HAVE_VERSION_H
32 #include <version.h>
33 #endif
34 
35 #include <string>
36 #include <iostream>
37 #include <sstream>
38 #include <typeinfo>
39 #include <algorithm>
40 #include <cassert>
41 #include <vector>
42 #include <ctime>
43 
44 #include "trigger/MSTrigger.h"
45 #include "trigger/MSCalibrator.h"
47 #include "MSVehicleControl.h"
49 #include <utils/common/ToString.h>
50 #include <utils/common/SysUtils.h>
65 #include <utils/xml/XMLSubSys.h>
67 #include <libsumo/Simulation.h>
68 #include <mesosim/MELoop.h>
92 #include <utils/router/FareModul.h>
93 
94 #include "MSTransportableControl.h"
95 #include "MSEdgeControl.h"
96 #include "MSJunctionControl.h"
97 #include "MSInsertionControl.h"
98 #include "MSDynamicShapeUpdater.h"
99 #include "MSEventControl.h"
100 #include "MSEdge.h"
101 #include "MSJunction.h"
102 #include "MSJunctionLogic.h"
103 #include "MSLane.h"
104 #include "MSVehicleTransfer.h"
105 #include "MSRoute.h"
106 #include "MSGlobals.h"
107 #include "MSContainer.h"
108 #include "MSEdgeWeightsStorage.h"
109 #include "MSStateHandler.h"
110 #include "MSFrame.h"
111 #include "MSParkingArea.h"
112 #include "MSStoppingPlace.h"
113 #include "MSNet.h"
114 
115 
116 // ===========================================================================
117 // debug constants
118 // ===========================================================================
119 //#define DEBUG_SIMSTEP
120 
121 
122 // ===========================================================================
123 // static member definitions
124 // ===========================================================================
125 MSNet* MSNet::myInstance = nullptr;
126 
127 const std::string MSNet::STAGE_EVENTS("events");
128 const std::string MSNet::STAGE_MOVEMENTS("move");
129 const std::string MSNet::STAGE_LANECHANGE("laneChange");
130 const std::string MSNet::STAGE_INSERTIONS("insertion");
131 
132 // ===========================================================================
133 // static member method definitions
134 // ===========================================================================
135 double
136 MSNet::getEffort(const MSEdge* const e, const SUMOVehicle* const v, double t) {
137  double value;
138  const MSVehicle* const veh = dynamic_cast<const MSVehicle* const>(v);
139  if (veh != nullptr && veh->getWeightsStorage().retrieveExistingEffort(e, t, value)) {
140  return value;
141  }
142  if (getInstance()->getWeightsStorage().retrieveExistingEffort(e, t, value)) {
143  return value;
144  }
145  return 0;
146 }
147 
148 
149 double
150 MSNet::getTravelTime(const MSEdge* const e, const SUMOVehicle* const v, double t) {
151  double value;
152  const MSVehicle* const veh = dynamic_cast<const MSVehicle* const>(v);
153  if (veh != nullptr && veh->getWeightsStorage().retrieveExistingTravelTime(e, t, value)) {
154  return value;
155  }
157  return value;
158  }
159  return e->getMinimumTravelTime(v);
160 }
161 
162 
163 // ---------------------------------------------------------------------------
164 // MSNet - methods
165 // ---------------------------------------------------------------------------
166 MSNet*
168  if (myInstance != nullptr) {
169  return myInstance;
170  }
171  throw ProcessError("A network was not yet constructed.");
172 }
173 
174 void
176  if (!MSGlobals::gUseMesoSim) {
178  }
179 }
180 
181 void
183  if (!MSGlobals::gUseMesoSim) {
185  }
186 }
187 
188 
189 MSNet::MSNet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents,
190  MSEventControl* endOfTimestepEvents,
191  MSEventControl* insertionEvents,
192  ShapeContainer* shapeCont):
193  myAmInterrupted(false),
194  myVehiclesMoved(0),
195  myPersonsMoved(0),
196  myHavePermissions(false),
197  myHasInternalLinks(false),
198  myHasElevation(false),
199  myHasPedestrianNetwork(false),
200  myHasBidiEdges(false),
201  myEdgeDataEndTime(-1),
202  myDynamicShapeUpdater(nullptr) {
203  if (myInstance != nullptr) {
204  throw ProcessError("A network was already constructed.");
205  }
207  myStep = string2time(oc.getString("begin"));
208  myMaxTeleports = oc.getInt("max-num-teleports");
209  myLogExecutionTime = !oc.getBool("no-duration-log");
210  myLogStepNumber = !oc.getBool("no-step-log");
211  myInserter = new MSInsertionControl(*vc, string2time(oc.getString("max-depart-delay")), oc.getBool("eager-insert"), oc.getInt("max-num-vehicles"),
212  string2time(oc.getString("random-depart-offset")));
213  myVehicleControl = vc;
215  myEdges = nullptr;
216  myJunctions = nullptr;
217  myRouteLoaders = nullptr;
218  myLogics = nullptr;
219  myPersonControl = nullptr;
220  myContainerControl = nullptr;
221  myEdgeWeights = nullptr;
222  myShapeContainer = shapeCont == nullptr ? new ShapeContainer() : shapeCont;
223 
224  myBeginOfTimestepEvents = beginOfTimestepEvents;
225  myEndOfTimestepEvents = endOfTimestepEvents;
226  myInsertionEvents = insertionEvents;
227  myLanesRTree.first = false;
228 
230  MSGlobals::gMesoNet = new MELoop(string2time(oc.getString("meso-recheck")));
231  }
232  myInstance = this;
233  initStatic();
234 }
235 
236 
237 void
239  SUMORouteLoaderControl* routeLoaders,
240  MSTLLogicControl* tlc,
241  std::vector<SUMOTime> stateDumpTimes,
242  std::vector<std::string> stateDumpFiles,
243  bool hasInternalLinks,
244  bool hasNeighs,
245  bool lefthand,
246  double version) {
247  myEdges = edges;
248  myJunctions = junctions;
249  myRouteLoaders = routeLoaders;
250  myLogics = tlc;
251  // save the time the network state shall be saved at
252  myStateDumpTimes = stateDumpTimes;
253  myStateDumpFiles = stateDumpFiles;
254  myStateDumpPeriod = string2time(oc.getString("save-state.period"));
255  myStateDumpPrefix = oc.getString("save-state.prefix");
256  myStateDumpSuffix = oc.getString("save-state.suffix");
257 
258  // initialise performance computation
261  if (hasNeighs && MSGlobals::gLateralResolution > 0) {
262  WRITE_WARNING("Opposite direction driving does not work together with the sublane model.");
263  }
268  myVersion = version;
269 }
270 
271 
273  cleanupStatic();
274  // delete controls
275  delete myJunctions;
276  delete myDetectorControl;
277  // delete mean data
278  delete myEdges;
279  delete myInserter;
280  delete myLogics;
281  delete myRouteLoaders;
282  if (myPersonControl != nullptr) {
283  delete myPersonControl;
284  }
285  if (myContainerControl != nullptr) {
286  delete myContainerControl;
287  }
288  delete myVehicleControl; // must happen after deleting transportables
289  // delete events late so that vehicles can get rid of references first
291  myBeginOfTimestepEvents = nullptr;
292  delete myEndOfTimestepEvents;
293  myEndOfTimestepEvents = nullptr;
294  delete myInsertionEvents;
295  myInsertionEvents = nullptr;
296  delete myShapeContainer;
297  delete myEdgeWeights;
298  for (auto& router : myRouterTT) {
299  delete router.second;
300  }
301  myRouterTT.clear();
302  for (auto& router : myRouterEffort) {
303  delete router.second;
304  }
305  myRouterEffort.clear();
306  for (auto& router : myPedestrianRouter) {
307  delete router.second;
308  }
309  myPedestrianRouter.clear();
310  for (auto& router : myIntermodalRouter) {
311  delete router.second;
312  }
313  myIntermodalRouter.clear();
314  myLanesRTree.second.RemoveAll();
315  clearAll();
317  delete MSGlobals::gMesoNet;
318  }
319  myInstance = nullptr;
320 }
321 
322 
323 void
324 MSNet::addRestriction(const std::string& id, const SUMOVehicleClass svc, const double speed) {
325  myRestrictions[id][svc] = speed;
326 }
327 
328 
329 const std::map<SUMOVehicleClass, double>*
330 MSNet::getRestrictions(const std::string& id) const {
331  std::map<std::string, std::map<SUMOVehicleClass, double> >::const_iterator i = myRestrictions.find(id);
332  if (i == myRestrictions.end()) {
333  return nullptr;
334  }
335  return &i->second;
336 }
337 
338 
341  // report the begin when wished
342  WRITE_MESSAGE("Simulation version " + std::string(VERSION_STRING) + " started with time: " + time2string(start));
343  // the simulation loop
345  // state loading may have changed the start time so we need to reinit it
346  myStep = start;
347  while (state == SIMSTATE_RUNNING) {
348  if (myLogStepNumber) {
350  }
351  simulationStep();
352  if (myLogStepNumber) {
354  }
355  state = simulationState(stop);
356 #ifdef DEBUG_SIMSTEP
357  std::cout << SIMTIME << " MSNet::simulate(" << start << ", " << stop << ")"
358  << "\n simulation state: " << getStateMessage(state)
359  << std::endl;
360 #endif
361  if (state == SIMSTATE_LOADING) {
364  } else if (state != SIMSTATE_RUNNING) {
365  if (TraCIServer::getInstance() != nullptr && !TraCIServer::wasClosed()) {
366  // overrides SIMSTATE_END_STEP_REACHED, e.g. (TraCI ignore SUMO's --end option)
367  state = SIMSTATE_RUNNING;
368  }
369  }
370  }
371  // report the end when wished
372  WRITE_MESSAGE("Simulation ended at time: " + time2string(getCurrentTimeStep()));
373  WRITE_MESSAGE("Reason: " + getStateMessage(state));
374  // exit simulation loop
375  closeSimulation(start);
376  return state;
377 }
378 
379 
380 void
383 }
384 
385 
386 const std::string
388  long duration = SysUtils::getCurrentMillis() - mySimBeginMillis;
389  std::ostringstream msg;
390  // print performance notice
391  msg << "Performance: " << "\n" << " Duration: " << duration << "ms" << "\n";
392  if (duration != 0) {
393  msg << " Real time factor: " << (STEPS2TIME(myStep - start) * 1000. / (double)duration) << "\n";
394  msg.setf(std::ios::fixed, std::ios::floatfield); // use decimal format
395  msg.setf(std::ios::showpoint); // print decimal point
396  msg << " UPS: " << ((double)myVehiclesMoved / ((double)duration / 1000)) << "\n";
397  if (myPersonsMoved > 0) {
398  msg << " UPS-Persons: " << ((double)myPersonsMoved / ((double)duration / 1000)) << "\n";
399  }
400  }
401  // print vehicle statistics
402  const std::string discardNotice = ((myVehicleControl->getLoadedVehicleNo() != myVehicleControl->getDepartedVehicleNo()) ?
403  " (Loaded: " + toString(myVehicleControl->getLoadedVehicleNo()) + ")" : "");
404  msg << "Vehicles: " << "\n"
405  << " Inserted: " << myVehicleControl->getDepartedVehicleNo() << discardNotice << "\n"
406  << " Running: " << myVehicleControl->getRunningVehicleNo() << "\n"
407  << " Waiting: " << myInserter->getWaitingVehicleNo() << "\n";
408 
410  // print optional teleport statistics
411  std::vector<std::string> reasons;
412  if (myVehicleControl->getCollisionCount() > 0) {
413  reasons.push_back("Collisions: " + toString(myVehicleControl->getCollisionCount()));
414  }
415  if (myVehicleControl->getTeleportsJam() > 0) {
416  reasons.push_back("Jam: " + toString(myVehicleControl->getTeleportsJam()));
417  }
418  if (myVehicleControl->getTeleportsYield() > 0) {
419  reasons.push_back("Yield: " + toString(myVehicleControl->getTeleportsYield()));
420  }
422  reasons.push_back("Wrong Lane: " + toString(myVehicleControl->getTeleportsWrongLane()));
423  }
424  msg << "Teleports: " << myVehicleControl->getTeleportCount() << " (" << joinToString(reasons, ", ") << ")\n";
425  }
426  if (myVehicleControl->getEmergencyStops() > 0) {
427  msg << "Emergency Stops: " << myVehicleControl->getEmergencyStops() << "\n";
428  }
429  if (myPersonControl != nullptr && myPersonControl->getLoadedNumber() > 0) {
430  msg << "Persons: " << "\n"
431  << " Inserted: " << myPersonControl->getLoadedNumber() << "\n"
432  << " Running: " << myPersonControl->getRunningNumber() << "\n";
433  if (myPersonControl->getJammedNumber() > 0) {
434  msg << " Jammed: " << myPersonControl->getJammedNumber() << "\n";
435  }
436  }
437  if (OptionsCont::getOptions().getBool("duration-log.statistics")) {
439  }
440  return msg.str();
441 }
442 
443 
444 void
447  if (OptionsCont::getOptions().getBool("vehroute-output.write-unfinished")) {
449  }
450  if (OptionsCont::getOptions().getBool("tripinfo-output.write-unfinished")) {
452  }
453  if (OptionsCont::getOptions().isSet("chargingstations-output")) {
455  }
456  if (OptionsCont::getOptions().isSet("railsignal-block-output")) {
458  }
459  if (myLogExecutionTime) {
461  }
462 }
463 
464 
465 void
467 #ifdef DEBUG_SIMSTEP
468  std::cout << SIMTIME << ": MSNet::simulationStep() called"
469  << ", myStep = " << myStep
470  << std::endl;
471 #endif
473  if (t != nullptr) {
474  if (myLogExecutionTime) {
476  }
478 #ifdef DEBUG_SIMSTEP
479  bool loadRequested = !TraCI::getLoadArgs().empty();
480  assert(t->getTargetTime() >= myStep || loadRequested || TraCIServer::wasClosed());
481 #endif
482  if (myLogExecutionTime) {
484  }
485  if (TraCIServer::wasClosed()) {
486  return;
487  }
488  }
489 #ifdef DEBUG_SIMSTEP
490  std::cout << SIMTIME << ": TraCI target time: " << t->getTargetTime() << std::endl;
491 #endif
492  // execute beginOfTimestepEvents
493  if (myLogExecutionTime) {
495  }
496  // simulation state output
497  std::vector<SUMOTime>::iterator timeIt = std::find(myStateDumpTimes.begin(), myStateDumpTimes.end(), myStep);
498  if (timeIt != myStateDumpTimes.end()) {
499  const int dist = (int)distance(myStateDumpTimes.begin(), timeIt);
501  }
502  if (myStateDumpPeriod > 0 && myStep % myStateDumpPeriod == 0) {
503  std::string timeStamp = time2string(myStep);
504  std::replace(timeStamp.begin(), timeStamp.end(), ':', '-');
506  }
508 #ifdef HAVE_FOX
509  MSRoutingEngine::waitForAll();
510 #endif
513  }
514  // check whether the tls programs need to be switched
516 
520  } else {
521  // assure all lanes with vehicles are 'active'
523 
524  // compute safe velocities for all vehicles for the next few lanes
525  // also register ApproachingVehicleInformation for all links
527 
528  // register junction approaches based on planned velocities as basis for right-of-way decision
530 
531  // decide right-of-way and execute movements
535  }
536 
537  // vehicles may change lanes
539 
542  }
543  }
544  loadRoutes();
545 
546  // persons
547  if (myPersonControl != nullptr && myPersonControl->hasTransportables()) {
549  }
550  // containers
553  }
554  // insert vehicles
557 #ifdef HAVE_FOX
558  MSRoutingEngine::waitForAll();
559 #endif
562  //myEdges->patchActiveLanes(); // @note required to detect collisions on lanes that were empty before insertion. wasteful?
564  }
566 
567  // execute endOfTimestepEvents
569 
570  if (myLogExecutionTime) {
572  }
574  if (myLogExecutionTime) {
576  }
577  // update and write (if needed) detector values
578  writeOutput();
579 
580  if (myLogExecutionTime) {
583  if (myPersonControl != nullptr) {
585  }
586  }
587  myStep += DELTA_T;
588 }
589 
590 
593  if (TraCIServer::wasClosed()) {
595  }
596  if (TraCIServer::getInstance() != nullptr && !TraCIServer::getInstance()->getLoadArgs().empty()) {
597  return SIMSTATE_LOADING;
598  }
599  if ((stopTime < 0 || myStep > stopTime) && TraCIServer::getInstance() == nullptr && (stopTime > 0 || myStep > myEdgeDataEndTime)) {
601  && (myInserter->getPendingFlowCount() == 0)
602  && (myPersonControl == nullptr || !myPersonControl->hasNonWaiting())
603  && (myContainerControl == nullptr || !myContainerControl->hasNonWaiting())) {
604  if (myPersonControl) {
606  }
607  if (myContainerControl) {
609  }
612  }
613  }
614  if (stopTime >= 0 && myStep >= stopTime) {
616  }
619  }
620  if (myAmInterrupted) {
621  return SIMSTATE_INTERRUPTED;
622  }
623  return SIMSTATE_RUNNING;
624 }
625 
626 
627 std::string
629  switch (state) {
631  return "";
633  return "The final simulation step has been reached.";
635  return "All vehicles have left the simulation.";
637  return "TraCI requested termination.";
639  return "An error occurred (see log).";
641  return "Interrupted.";
643  return "Too many teleports.";
645  return "TraCI issued load command.";
646  default:
647  return "Unknown reason.";
648  }
649 }
650 
651 
652 void
654  // clear container
655  MSEdge::clear();
656  MSLane::clear();
657  MSRoute::clear();
669  if (t != nullptr) {
670  t->cleanup();
671  }
674 }
675 
676 
677 void
679  // update detector values
681  const OptionsCont& oc = OptionsCont::getOptions();
682 
683  // check state dumps
684  if (oc.isSet("netstate-dump")) {
686  oc.getInt("netstate-dump.precision"));
687  }
688 
689  // check fcd dumps
690  if (OptionsCont::getOptions().isSet("fcd-output")) {
692  }
693 
694  // check emission dumps
695  if (OptionsCont::getOptions().isSet("emission-output")) {
697  oc.getInt("emission-output.precision"));
698  }
699 
700  // battery dumps
701  if (OptionsCont::getOptions().isSet("battery-output")) {
703  oc.getInt("battery-output.precision"));
704  }
705 
706  // check full dumps
707  if (OptionsCont::getOptions().isSet("full-output")) {
709  }
710 
711  // check queue dumps
712  if (OptionsCont::getOptions().isSet("queue-output")) {
714  }
715 
716  // check amitran dumps
717  if (OptionsCont::getOptions().isSet("amitran-output")) {
719  }
720 
721  // check vtk dumps
722  if (OptionsCont::getOptions().isSet("vtk-output")) {
723 
724  if (MSNet::getInstance()->getVehicleControl().getRunningVehicleNo() > 0) {
725  std::string timestep = time2string(myStep);
726  timestep = timestep.substr(0, timestep.length() - 3);
727  std::string output = OptionsCont::getOptions().getString("vtk-output");
728  std::string filename = output + "_" + timestep + ".vtp";
729 
730  OutputDevice_File dev = OutputDevice_File(filename, false);
731 
732  //build a huge mass of xml files
734 
735  }
736 
737  }
738 
739  // summary output
740  if (OptionsCont::getOptions().isSet("summary-output")) {
741  OutputDevice& od = OutputDevice::getDeviceByOption("summary-output");
742  int departedVehiclesNumber = myVehicleControl->getDepartedVehicleNo();
743  const double meanWaitingTime = departedVehiclesNumber != 0 ? myVehicleControl->getTotalDepartureDelay() / (double) departedVehiclesNumber : -1.;
744  int endedVehicleNumber = myVehicleControl->getEndedVehicleNo();
745  const double meanTravelTime = endedVehicleNumber != 0 ? myVehicleControl->getTotalTravelTime() / (double) endedVehicleNumber : -1.;
746  od.openTag("step");
747  od.writeAttr("time", time2string(myStep));
751  od.writeAttr("waiting", myInserter->getWaitingVehicleNo());
754  od.writeAttr("collisions", myVehicleControl->getCollisionCount());
755  od.writeAttr("teleports", myVehicleControl->getTeleportCount());
757  od.writeAttr("meanWaitingTime", meanWaitingTime);
758  od.writeAttr("meanTravelTime", meanTravelTime);
759  std::pair<double, double> meanSpeed = myVehicleControl->getVehicleMeanSpeeds();
760  od.writeAttr("meanSpeed", meanSpeed.first);
761  od.writeAttr("meanSpeedRelative", meanSpeed.second);
762  if (myLogExecutionTime) {
763  od.writeAttr("duration", mySimStepDuration);
764  }
765  od.closeTag();
766  }
767 
768  // write detector values
770 
771  // write link states
772  if (OptionsCont::getOptions().isSet("link-output")) {
773  OutputDevice& od = OutputDevice::getDeviceByOption("link-output");
774  od.openTag("timestep");
776  const MSEdgeVector& edges = myEdges->getEdges();
777  for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) {
778  const std::vector<MSLane*>& lanes = (*i)->getLanes();
779  for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
780  const std::vector<MSLink*>& links = (*j)->getLinkCont();
781  for (std::vector<MSLink*>::const_iterator k = links.begin(); k != links.end(); ++k) {
782  (*k)->writeApproaching(od, (*j)->getID());
783  }
784  }
785  }
786  od.closeTag();
787  }
788 
789  // write SSM output
791  dev->updateAndWriteOutput();
792  }
793 
794  // write ToC output
796  if (dev->generatesOutput()) {
797  dev->writeOutput();
798  }
799  }
800 }
801 
802 
803 bool
805  return myLogExecutionTime;
806 }
807 
808 
811  if (myPersonControl == nullptr) {
813  }
814  return *myPersonControl;
815 }
816 
819  if (myContainerControl == nullptr) {
821  }
822  return *myContainerControl;
823 }
824 
827  myDynamicShapeUpdater = std::unique_ptr<MSDynamicShapeUpdater> (new MSDynamicShapeUpdater(MSNet::getInstance()->getShapeContainer()));
828  return myDynamicShapeUpdater.get();
829 }
830 
833  if (myEdgeWeights == nullptr) {
835  }
836  return *myEdgeWeights;
837 }
838 
839 
840 void
842  std::cout << "Step #" << time2string(myStep);
843 }
844 
845 
846 void
848  if (myLogExecutionTime) {
849  std::ostringstream oss;
850  oss.setf(std::ios::fixed, std::ios::floatfield); // use decimal format
851  oss.setf(std::ios::showpoint); // print decimal point
852  oss << std::setprecision(gPrecision);
853  if (mySimStepDuration != 0) {
854  const double durationSec = (double)mySimStepDuration / 1000.;
855  oss << " (" << mySimStepDuration << "ms ~= "
856  << (TS / durationSec) << "*RT, ~"
857  << ((double) myVehicleControl->getRunningVehicleNo() / durationSec);
858  } else {
859  oss << " (0ms ?*RT. ?";
860  }
861  oss << "UPS, ";
862  if (TraCIServer::getInstance() != nullptr) {
863  oss << "TraCI: " << myTraCIStepDuration << "ms, ";
864  }
865  oss << "vehicles TOT " << myVehicleControl->getDepartedVehicleNo()
866  << " ACT " << myVehicleControl->getRunningVehicleNo()
867  << " BUF " << myInserter->getWaitingVehicleNo()
868  << ") ";
869  std::string prev = "Step #" + time2string(myStep - DELTA_T);
870  std::cout << oss.str().substr(0, 90 - prev.length());
871  }
872  std::cout << '\r';
873 }
874 
875 
876 void
878  if (find(myVehicleStateListeners.begin(), myVehicleStateListeners.end(), listener) == myVehicleStateListeners.end()) {
879  myVehicleStateListeners.push_back(listener);
880  }
881 }
882 
883 
884 void
886  std::vector<VehicleStateListener*>::iterator i = std::find(myVehicleStateListeners.begin(), myVehicleStateListeners.end(), listener);
887  if (i != myVehicleStateListeners.end()) {
888  myVehicleStateListeners.erase(i);
889  }
890 }
891 
892 
893 void
894 MSNet::informVehicleStateListener(const SUMOVehicle* const vehicle, VehicleState to, const std::string& info) {
895 #ifdef HAVE_FOX
896  FXConditionalLock lock(myStateListenerMutex, MSGlobals::gNumThreads > 1);
897 #endif
898  for (VehicleStateListener* const listener : myVehicleStateListeners) {
899  listener->vehicleStateChanged(vehicle, to, info);
900  }
901 }
902 
903 
904 bool
906  return myStoppingPlaces[category == SUMO_TAG_TRAIN_STOP ? SUMO_TAG_BUS_STOP : category].add(stop->getID(), stop);
907 }
908 
909 
911 MSNet::getStoppingPlace(const std::string& id, const SumoXMLTag category) const {
912  if (myStoppingPlaces.count(category) > 0) {
913  return myStoppingPlaces.find(category)->second.get(id);
914  }
915  return nullptr;
916 }
917 
918 
919 std::string
920 MSNet::getStoppingPlaceID(const MSLane* lane, const double pos, const SumoXMLTag category) const {
921  if (myStoppingPlaces.count(category) > 0) {
922  for (const auto& it : myStoppingPlaces.find(category)->second) {
923  MSStoppingPlace* stop = it.second;
924  if (&stop->getLane() == lane && stop->getBeginLanePosition() - POSITION_EPS <= pos && stop->getEndLanePosition() + POSITION_EPS >= pos) {
925  return stop->getID();
926  }
927  }
928  }
929  return "";
930 }
931 
932 
935  auto it = myStoppingPlaces.find(category);
936  if (it != myStoppingPlaces.end()) {
937  return it->second;
938  } else {
939  throw ProcessError("No stoppingPlace of type '" + toString(category) + "' found");
940  }
941 }
942 
943 
944 void
947  OutputDevice& output = OutputDevice::getDeviceByOption("chargingstations-output");
948  for (const auto& it : myStoppingPlaces.find(SUMO_TAG_CHARGING_STATION)->second) {
949  static_cast<MSChargingStation*>(it.second)->writeChargingStationOutput(output);
950  }
951  }
952 }
953 
954 
955 void
957  OutputDevice& output = OutputDevice::getDeviceByOption("railsignal-block-output");
958  for (auto tls : myLogics->getAllLogics()) {
959  MSRailSignal* rs = dynamic_cast<MSRailSignal*>(tls);
960  if (rs != nullptr) {
961  rs->writeBlocks(output);
962  }
963  }
964 }
965 
966 
968 MSNet::getRouterTT(const int rngIndex, const MSEdgeVector& prohibited) const {
969  if (myRouterTT.count(rngIndex) == 0) {
970  const std::string routingAlgorithm = OptionsCont::getOptions().getString("routing-algorithm");
971  if (routingAlgorithm == "dijkstra") {
972  myRouterTT[rngIndex] = new DijkstraRouter<MSEdge, SUMOVehicle>(MSEdge::getAllEdges(), true, &MSNet::getTravelTime, nullptr, false, nullptr, true);
973  } else {
974  if (routingAlgorithm != "astar") {
975  WRITE_WARNING("TraCI and Triggers cannot use routing algorithm '" + routingAlgorithm + "'. using 'astar' instead.");
976  }
978  }
979  }
980  myRouterTT[rngIndex]->prohibit(prohibited);
981  return *myRouterTT[rngIndex];
982 }
983 
984 
986 MSNet::getRouterEffort(const int rngIndex, const MSEdgeVector& prohibited) const {
987  if (myRouterEffort.count(rngIndex) == 0) {
989  }
990  myRouterEffort[rngIndex]->prohibit(prohibited);
991  return *myRouterEffort[rngIndex];
992 }
993 
994 
996 MSNet::getPedestrianRouter(const int rngIndex, const MSEdgeVector& prohibited) const {
997  if (myPedestrianRouter.count(rngIndex) == 0) {
998  myPedestrianRouter[rngIndex] = new MSPedestrianRouter();
999  }
1000  myPedestrianRouter[rngIndex]->prohibit(prohibited);
1001  return *myPedestrianRouter[rngIndex];
1002 }
1003 
1004 
1006 MSNet::getIntermodalRouter(const int rngIndex, const int routingMode, const MSEdgeVector& prohibited) const {
1007  const OptionsCont& oc = OptionsCont::getOptions();
1008  const int key = rngIndex * oc.getInt("thread-rngs") + routingMode;
1009  if (myIntermodalRouter.count(key) == 0) {
1010  int carWalk = 0;
1011  for (const std::string& opt : oc.getStringVector("persontrip.transfer.car-walk")) {
1012  if (opt == "parkingAreas") {
1014  } else if (opt == "ptStops") {
1016  } else if (opt == "allJunctions") {
1018  }
1019  }
1020  const std::string routingAlgorithm = OptionsCont::getOptions().getString("routing-algorithm");
1021  if (routingMode == libsumo::ROUTING_MODE_COMBINED) {
1022  myIntermodalRouter[key] = new MSIntermodalRouter(MSNet::adaptIntermodalRouter, carWalk, routingAlgorithm, routingMode, new FareModul());
1023  } else {
1024  myIntermodalRouter[key] = new MSIntermodalRouter(MSNet::adaptIntermodalRouter, carWalk, routingAlgorithm, routingMode);
1025  }
1026  }
1027  myIntermodalRouter[key]->prohibit(prohibited);
1028  return *myIntermodalRouter[key];
1029 }
1030 
1031 
1032 void
1034  // add access to all parking areas
1035  for (const auto& i : myInstance->myStoppingPlaces[SUMO_TAG_PARKING_AREA]) {
1036  const MSEdge* const edge = &i.second->getLane().getEdge();
1037  router.getNetwork()->addAccess(i.first, edge, i.second->getAccessPos(edge), i.second->getAccessDistance(edge), SUMO_TAG_PARKING_AREA);
1038  }
1039  EffortCalculator* const external = router.getExternalEffort();
1040  // add access to all public transport stops
1041  for (const auto& i : myInstance->myStoppingPlaces[SUMO_TAG_BUS_STOP]) {
1042  const MSEdge* const edge = &i.second->getLane().getEdge();
1043  router.getNetwork()->addAccess(i.first, edge, i.second->getAccessPos(edge),
1044  i.second->getAccessDistance(edge), SUMO_TAG_BUS_STOP);
1045  for (const auto& a : i.second->getAllAccessPos()) {
1046  router.getNetwork()->addAccess(i.first, &std::get<0>(a)->getEdge(), std::get<1>(a), std::get<2>(a), SUMO_TAG_BUS_STOP);
1047  }
1048  if (external != nullptr) {
1049  external->addStop(router.getNetwork()->getStopEdge(i.first)->getNumericalID(), *i.second);
1050  }
1051  }
1054 }
1055 
1056 
1057 bool
1059  const MSEdgeVector& edges = myEdges->getEdges();
1060  for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) {
1061  for (std::vector<MSLane*>::const_iterator i = (*e)->getLanes().begin(); i != (*e)->getLanes().end(); ++i) {
1062  if ((*i)->getShape().hasElevation()) {
1063  return true;
1064  }
1065  }
1066  }
1067  return false;
1068 }
1069 
1070 
1071 bool
1073  for (const MSEdge* e : myEdges->getEdges()) {
1074  if (e->getFunction() == EDGEFUNC_WALKINGAREA) {
1075  return true;
1076  }
1077  }
1078  return false;
1079 }
1080 
1081 
1082 bool
1084  for (const MSEdge* e : myEdges->getEdges()) {
1085  if (e->getBidiEdge() != nullptr) {
1086  return true;
1087  }
1088  }
1089  return false;
1090 }
1091 
1092 bool
1093 MSNet::warnOnce(const std::string& typeAndID) {
1094  if (myWarnedOnce.find(typeAndID) == myWarnedOnce.end()) {
1095  myWarnedOnce[typeAndID] = true;
1096  return true;
1097  }
1098  return false;
1099 }
1100 
1101 
1102 /****************************************************************************/
MSNet::myShapeContainer
ShapeContainer * myShapeContainer
A container for geometrical shapes;.
Definition: MSNet.h:737
MSNet::MSNet
MSNet(MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents, ShapeContainer *shapeCont=0)
Constructor.
Definition: MSNet.cpp:189
SUMO_TAG_TRAIN_STOP
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
Definition: SUMOXMLDefinitions.h:99
MSStoppingPlace::getLane
const MSLane & getLane() const
Returns the lane this stop is located at.
Definition: MSStoppingPlace.cpp:57
MSVehicle::Influencer::cleanup
static void cleanup()
Static cleanup.
Definition: MSVehicle.cpp:381
OptionsCont::isSet
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Definition: OptionsCont.cpp:135
MSFullExport::write
static void write(OutputDevice &of, SUMOTime timestep)
Dumping a hugh List of Parameters available in the Simulation.
Definition: MSFullExport.cpp:44
MSNet::hasInternalLinks
bool hasInternalLinks() const
return whether the network contains internal links
Definition: MSNet.h:643
MSEventControl
Stores time-dependant events and executes them at the proper time.
Definition: MSEventControl.h:49
MSNet::getEffort
static double getEffort(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the effort to pass an edge.
Definition: MSNet.cpp:136
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
MSNet::getRouterTT
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:968
OptionsCont::getInt
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
Definition: OptionsCont.cpp:215
MSNet::getStoppingPlace
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
Definition: MSNet.cpp:911
ToString.h
MSStoppingPlace
A lane area vehicles can halt at.
Definition: MSStoppingPlace.h:59
MSNet::myHasElevation
bool myHasElevation
Whether the network contains elevation data.
Definition: MSNet.h:792
MSStopOut.h
PedestrianRouter
Definition: MSNet.h:81
MSCModel_NonInteracting::cleanup
static void cleanup()
remove state at simulation end
Definition: MSCModel_NonInteracting.cpp:79
IntermodalNetwork::getStopEdge
_IntermodalEdge * getStopEdge(const std::string &stopId) const
Returns the associated stop edge.
Definition: IntermodalNetwork.h:434
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
MSVehicleControl::getDepartedVehicleNo
int getDepartedVehicleNo() const
Returns the number of inserted vehicles.
Definition: MSVehicleControl.h:265
MSVehicleControl::getTeleportsWrongLane
int getTeleportsWrongLane() const
return the number of teleports due to vehicles stuck on the wrong lane
Definition: MSVehicleControl.h:304
MSNet::preSimStepOutput
void preSimStepOutput() const
Prints the current step number.
Definition: MSNet.cpp:841
MSTLLogicControl.h
MSNet.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSDetectorControl.h
MSDevice_SSM
A device which collects info on the vehicle trip (mainly on departure and arrival)
Definition: MSDevice_SSM.h:56
MSNet::STAGE_INSERTIONS
static const std::string STAGE_INSERTIONS
Definition: MSNet.h:846
OutputDevice::closeAll
static void closeAll(bool keepErrorRetrievers=false)
Definition: OutputDevice.cpp:126
MSNet::simulationStep
void simulationStep()
Performs a single simulation step.
Definition: MSNet.cpp:466
IntermodalNetwork::ALL_JUNCTIONS
@ ALL_JUNCTIONS
junctions with edges allowing the additional mode
Definition: IntermodalNetwork.h:93
MSInsertionControl::emitVehicles
int emitVehicles(SUMOTime time)
Emits vehicles that want to depart at the given time.
Definition: MSInsertionControl.cpp:109
MSNet::myVehicleControl
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
Definition: MSNet.h:715
MSXMLRawOut::write
static void write(OutputDevice &of, const MSEdgeControl &ec, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
Definition: MSXMLRawOut.cpp:48
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MSNet::mySimStepDuration
long mySimStepDuration
Definition: MSNet.h:754
MSNet::cleanupStatic
static void cleanupStatic()
Place for static initializations of simulation components (called after successful net build)
Definition: MSNet.cpp:182
MSNet::removeVehicleStateListener
void removeVehicleStateListener(VehicleStateListener *listener)
Removes a vehicle states listener.
Definition: MSNet.cpp:885
MSInsertionControl::getPendingFlowCount
int getPendingFlowCount() const
Returns the number of flows that are still active.
Definition: MSInsertionControl.cpp:265
DELTA_T
SUMOTime DELTA_T
Definition: SUMOTime.cpp:36
MSNet::myPersonsMoved
long long int myPersonsMoved
Definition: MSNet.h:761
libsumo::Helper::cleanup
static void cleanup()
Definition: Helper.cpp:404
MSNet::getShapeContainer
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:459
SUMORouteLoaderControl::loadNext
void loadNext(SUMOTime step)
loads the next routes up to and including the given time step
Definition: SUMORouteLoaderControl.cpp:59
MSNet::myInstance
static MSNet * myInstance
Unique instance of MSNet.
Definition: MSNet.h:695
MSNet::writeOutput
void writeOutput()
Write netstate, summary and detector output.
Definition: MSNet.cpp:678
MSVehicleControl::getActiveVehicleCount
int getActiveVehicleCount() const
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a ...
Definition: MSVehicleControl.h:283
OptionsCont.h
MSNet::simulationState
SimulationState simulationState(SUMOTime stopTime) const
Called after a simulation step, this method returns the current simulation state.
Definition: MSNet.cpp:592
IntermodalRouter
Definition: MSNet.h:79
MSCModel_NonInteracting.h
MSVehicleControl::getEmergencyStops
int getEmergencyStops() const
return the number of emergency stops
Definition: MSVehicleControl.h:312
MSNet::getContainerControl
virtual MSTransportableControl & getContainerControl()
Returns the container control.
Definition: MSNet.cpp:818
MSNet::informVehicleStateListener
void informVehicleStateListener(const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")
Informs all added listeners about a vehicle's state change.
Definition: MSNet.cpp:894
MSJunctionLogic.h
MSNet::VehicleStateListener
Interface for objects listening to vehicle state changes.
Definition: MSNet.h:568
MSDetectorControl
Detectors container; responsible for string and output generation.
Definition: MSDetectorControl.h:52
MsgHandler.h
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
MSCalibrator.h
MSNet::myEndOfTimestepEvents
MSEventControl * myEndOfTimestepEvents
Controls events executed at the end of a time step;.
Definition: MSNet.h:733
MSStoppingPlace::getBeginLanePosition
double getBeginLanePosition() const
Returns the begin position of this stop.
Definition: MSStoppingPlace.cpp:63
WrappingCommand.h
MSNet::myDynamicShapeUpdater
std::unique_ptr< MSDynamicShapeUpdater > myDynamicShapeUpdater
Updater for dynamic shapes that are tracking traffic objects (ensures removal of shape dynamics when ...
Definition: MSNet.h:839
MSVehicleControl::abortWaiting
void abortWaiting()
informes about all waiting vehicles (deletion in destructor)
Definition: MSVehicleControl.cpp:394
MSNet::getInsertionControl
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:389
MSNet::warnOnce
bool warnOnce(const std::string &typeAndID)
return whether a warning regarding the given object shall be issued
Definition: MSNet.cpp:1093
OptionsCont::getString
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:201
MSEmissionExport::write
static void write(OutputDevice &of, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
Definition: MSEmissionExport.cpp:41
MSNet::myMaxTeleports
int myMaxTeleports
Maximum number of teleports.
Definition: MSNet.h:704
MSNet::STAGE_LANECHANGE
static const std::string STAGE_LANECHANGE
Definition: MSNet.h:845
MSNet::myEdgeDataEndTime
SUMOTime myEdgeDataEndTime
end of loaded edgeData
Definition: MSNet.h:807
libsumo::ROUTING_MODE_COMBINED
TRACI_CONST int ROUTING_MODE_COMBINED
Definition: TraCIConstants.h:458
MSTLLogicControl::getAllLogics
std::vector< MSTrafficLightLogic * > getAllLogics() const
Returns a vector which contains all logics.
Definition: MSTLLogicControl.cpp:578
MSVehicleControl::getTeleportsJam
int getTeleportsJam() const
return the number of teleports due to jamming
Definition: MSVehicleControl.h:294
MSVehicle::Influencer::init
static void init()
Static initalization.
Definition: MSVehicle.cpp:376
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:60
MSNet::postSimStepOutput
void postSimStepOutput() const
Prints the statistics of the step at its end.
Definition: MSNet.cpp:847
GeoConvHelper.h
MSNet::MSIntermodalRouter
IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle > MSIntermodalRouter
Definition: MSNet.h:116
ShapeContainer
Storage for geometrical objects.
Definition: ShapeContainer.h:49
IntermodalNetwork::PARKING_AREAS
@ PARKING_AREAS
parking areas
Definition: IntermodalNetwork.h:89
MSNet::myVersion
double myVersion
the network version
Definition: MSNet.h:804
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
MSNet::myStateDumpTimes
std::vector< SUMOTime > myStateDumpTimes
Times at which a state shall be written.
Definition: MSNet.h:770
MSFCDExport::write
static void write(OutputDevice &of, SUMOTime timestep, bool elevation)
Writes the position and the angle of each vehicle into the given device.
Definition: MSFCDExport.cpp:49
MSDevice_SSM::cleanup
static void cleanup()
Clean up remaining devices instances.
Definition: MSDevice_SSM.cpp:191
MSVehicleControl::getLoadedVehicleNo
int getLoadedVehicleNo() const
Returns the number of build vehicles.
Definition: MSVehicleControl.h:213
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
MSJunctionControl.h
MSGlobals::gUseMesoSim
static bool gUseMesoSim
Definition: MSGlobals.h:90
MSNet::clearAll
static void clearAll()
Clears all dictionaries.
Definition: MSNet.cpp:653
MSVehicleControl::getTeleportsYield
int getTeleportsYield() const
return the number of teleports due to vehicles stuck on a minor road
Definition: MSVehicleControl.h:299
MSChargingStation.h
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
MSNet::logSimulationDuration
bool logSimulationDuration() const
Returns whether duration shall be logged.
Definition: MSNet.cpp:804
MSDevice_SSM::getInstances
static const std::set< MSDevice_SSM *, ComparatorNumericalIdLess > & getInstances()
returns all currently existing SSM devices
Definition: MSDevice_SSM.cpp:186
MSEdge.h
MSNet::myPedestrianRouter
std::map< int, MSPedestrianRouter * > myPedestrianRouter
Definition: MSNet.h:830
MSNet::simulate
SimulationState simulate(SUMOTime start, SUMOTime stop)
Simulates from timestep start to stop.
Definition: MSNet.cpp:340
MSInsertionControl.h
MSInsertionControl::getWaitingVehicleNo
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
Definition: MSInsertionControl.cpp:259
MSNet::makeDynamicShapeUpdater
MSDynamicShapeUpdater * makeDynamicShapeUpdater()
Creates and returns a dynamic shapes updater.
Definition: MSNet.cpp:826
MSNet::getStoppingPlaceID
std::string getStoppingPlaceID(const MSLane *lane, const double pos, const SumoXMLTag category) const
Returns the stop of the given category close to the given position.
Definition: MSNet.cpp:920
MSDetectorControl::close
void close(SUMOTime step)
Closes the detector outputs.
Definition: MSDetectorControl.cpp:54
MSStateHandler::saveState
static void saveState(const std::string &file, SUMOTime step)
Saves the current state.
Definition: MSStateHandler.cpp:74
MSDynamicShapeUpdater
Definition: MSDynamicShapeUpdater.h:25
MSNet::closeSimulation
void closeSimulation(SUMOTime start)
Closes the simulation (all files, connections, etc.)
Definition: MSNet.cpp:445
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
MSQueueExport::write
static void write(OutputDevice &of, SUMOTime timestep)
Export the queueing length in front of a junction (very experimental!)
Definition: MSQueueExport.cpp:40
DijkstraRouter
Computes the shortest path through a network using the Dijkstra algorithm.
Definition: DijkstraRouter.h:61
MSEdgeControl::changeLanes
void changeLanes(const SUMOTime t)
Moves (precomputes) critical vehicles.
Definition: MSEdgeControl.cpp:225
MSNet::myStateDumpFiles
std::vector< std::string > myStateDumpFiles
The names for the state files.
Definition: MSNet.h:772
MSDynamicShapeUpdater.h
MSEdgeWeightsStorage
A storage for edge travel times and efforts.
Definition: MSEdgeWeightsStorage.h:43
MSFCDExport.h
MSGlobals::gLateralResolution
static double gLateralResolution
Definition: MSGlobals.h:84
SysUtils::getCurrentMillis
static long getCurrentMillis()
Returns the current time in milliseconds.
Definition: SysUtils.cpp:38
OutputDevice::closeTag
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
Definition: OutputDevice.cpp:253
MSVehicleControl::getEndedVehicleNo
int getEndedVehicleNo() const
Returns the number of removed vehicles.
Definition: MSVehicleControl.h:235
MSTrigger::cleanup
static void cleanup()
properly deletes all trigger instances
Definition: MSTrigger.cpp:43
MSTransportableControl::hasNonWaiting
bool hasNonWaiting() const
checks whether any transportable is still engaged in walking / stopping
Definition: MSTransportableControl.cpp:243
OptionsCont::getStringVector
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
Definition: OptionsCont.cpp:235
MSNet::myLogExecutionTime
bool myLogExecutionTime
Information whether the simulation duration shall be logged.
Definition: MSNet.h:748
MSNet::writeChargingStationOutput
void writeChargingStationOutput() const
write charging station output
Definition: MSNet.cpp:945
MSVehicleTransfer::getInstance
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
Definition: MSVehicleTransfer.cpp:185
MSNet::myVehiclesMoved
long long int myVehiclesMoved
The overall number of vehicle movements.
Definition: MSNet.h:760
MSTransportableControl
Definition: MSTransportableControl.h:51
MSVehicleControl::getRunningVehicleNo
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
Definition: MSVehicleControl.h:257
MSNet::getRestrictions
const std::map< SUMOVehicleClass, double > * getRestrictions(const std::string &id) const
Returns the restrictions for an edge type If no restrictions are present, 0 is returned.
Definition: MSNet.cpp:330
MSTrafficLightLogic.h
MSGlobals::gNumThreads
static int gNumThreads
how many threads to use
Definition: MSGlobals.h:126
MSDetectorControl::writeOutput
void writeOutput(SUMOTime step, bool closing)
Writes the output to be generated within the given time step.
Definition: MSDetectorControl.cpp:125
MSNet::SIMSTATE_NO_FURTHER_VEHICLES
@ SIMSTATE_NO_FURTHER_VEHICLES
The simulation does not contain further vehicles.
Definition: MSNet.h:104
TraCIServer::getLoadArgs
std::vector< std::string > & getLoadArgs()
Definition: TraCIServer.h:248
MSJunctionControl
Container for junctions; performs operations on all stored junctions.
Definition: MSJunctionControl.h:44
MSInsertionControl::adaptIntermodalRouter
void adaptIntermodalRouter(MSNet::MSIntermodalRouter &router) const
Definition: MSInsertionControl.cpp:322
MSDevice_ToC
The ToC Device controls transition of control between automated and manual driving.
Definition: MSDevice_ToC.h:54
MSNet::mySimBeginMillis
long mySimBeginMillis
The overall simulation duration.
Definition: MSNet.h:757
OutputDevice::writeAttr
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:255
MSNet::myAmInterrupted
bool myAmInterrupted
whether an interrupt occured
Definition: MSNet.h:707
MSVehicleControl::getArrivedVehicleNo
int getArrivedVehicleNo() const
Returns the number of arrived vehicles.
Definition: MSVehicleControl.h:242
MSNet::myStoppingPlaces
std::map< SumoXMLTag, NamedObjectCont< MSStoppingPlace * > > myStoppingPlaces
Dictionary of bus / container stops.
Definition: MSNet.h:810
MSEdgeWeightsStorage::retrieveExistingTravelTime
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
Definition: MSEdgeWeightsStorage.cpp:39
MSNet::myLanesRTree
std::pair< bool, NamedRTree > myLanesRTree
An RTree structure holding lane IDs.
Definition: MSNet.h:834
MSNet::SimulationState
SimulationState
Possible states of a simulation - running or stopped with different reasons.
Definition: MSNet.h:96
Simulation.h
MELoop
The main mesocopic simulation loop.
Definition: MELoop.h:48
SIMTIME
#define SIMTIME
Definition: SUMOTime.h:63
MSStopOut::cleanup
static void cleanup()
Definition: MSStopOut.cpp:47
MSNet::getStoppingPlaces
const NamedObjectCont< MSStoppingPlace * > & getStoppingPlaces(SumoXMLTag category) const
Definition: MSNet.cpp:934
MSNet::getIntermodalRouter
MSIntermodalRouter & getIntermodalRouter(const int rngIndex, const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:1006
MSNet::SIMSTATE_END_STEP_REACHED
@ SIMSTATE_END_STEP_REACHED
The final simulation step has been performed.
Definition: MSNet.h:102
NamedObjectCont
A map of named object pointers.
Definition: NamedObjectCont.h:43
MSGlobals::gCheck4Accidents
static bool gCheck4Accidents
Definition: MSGlobals.h:75
SUMO_TAG_CHARGING_STATION
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
Definition: SUMOXMLDefinitions.h:111
MSNet::myStep
SUMOTime myStep
Current time step.
Definition: MSNet.h:701
MSEdgeWeightsStorage.h
MSVehicleControl::adaptIntermodalRouter
void adaptIntermodalRouter(MSNet::MSIntermodalRouter &router) const
Definition: MSVehicleControl.cpp:461
MSTransportableControl.h
MSNet::getWeightsStorage
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
Definition: MSNet.cpp:832
SystemFrame.h
MSNet::VehicleState
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:535
MSJunction.h
PedestrianRouter.h
OutputDevice_File
An output device that encapsulates an ofstream.
Definition: OutputDevice_File.h:40
TS
#define TS
Definition: SUMOTime.h:43
MSNet::lefthand
bool lefthand() const
return whether the network was built for lefthand traffic
Definition: MSNet.h:663
SysUtils.h
EDGEFUNC_WALKINGAREA
@ EDGEFUNC_WALKINGAREA
Definition: SUMOXMLDefinitions.h:1084
AStarRouter.h
IntermodalEdge::getNumericalID
int getNumericalID() const
Definition: IntermodalEdge.h:63
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:283
MSNet::myTraCIStepDuration
long myTraCIStepDuration
The last simulation step duration.
Definition: MSNet.h:754
MSDevice_Vehroutes::generateOutputForUnfinished
static void generateOutputForUnfinished()
generate vehroute output for vehicles which are still in the network
Definition: MSDevice_Vehroutes.cpp:397
MSAmitranTrajectories.h
IntermodalRouter::getExternalEffort
EffortCalculator * getExternalEffort() const
Definition: IntermodalRouter.h:238
MSRailSignal
A signal for rails.
Definition: MSRailSignal.h:46
MSEdge::clear
static void clear()
Clears the dictionary.
Definition: MSEdge.cpp:804
MSNet::~MSNet
virtual ~MSNet()
Destructor.
Definition: MSNet.cpp:272
FXConditionalLock
A scoped lock which only triggers on condition.
Definition: FXConditionalLock.h:36
STEPS2TIME
#define STEPS2TIME(x)
Definition: SUMOTime.h:56
MSNet::SIMSTATE_ERROR_IN_SIM
@ SIMSTATE_ERROR_IN_SIM
An error occurred during the simulation step.
Definition: MSNet.h:108
MSInsertionControl
Inserts vehicles into the network when their departure time is reached.
Definition: MSInsertionControl.h:61
MSNet::myStateDumpPrefix
std::string myStateDumpPrefix
name components for periodic state
Definition: MSNet.h:776
MSNet::myRouterEffort
std::map< int, SUMOAbstractRouter< MSEdge, SUMOVehicle > * > myRouterEffort
Definition: MSNet.h:829
MSTransportableControl::hasTransportables
bool hasTransportables() const
checks whether any transportable waits to finish her plan
Definition: MSTransportableControl.cpp:237
SUMO_TAG_PARKING_AREA
@ SUMO_TAG_PARKING_AREA
A parking area.
Definition: SUMOXMLDefinitions.h:107
MSRoute::clear
static void clear()
Clears the dictionary (delete all known routes, too)
Definition: MSRoute.cpp:169
MSNet::getPedestrianRouter
MSPedestrianRouter & getPedestrianRouter(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:996
MSEmissionExport.h
MSNet::myInserter
MSInsertionControl * myInserter
Controls vehicle insertion;.
Definition: MSNet.h:727
IntermodalNetwork::PT_STOPS
@ PT_STOPS
public transport stops and access
Definition: IntermodalNetwork.h:91
MSNet::myLogics
MSTLLogicControl * myLogics
Controls tls logics, realizes waiting on tls rules;.
Definition: MSNet.h:725
OutputDevice.h
MSRailSignal::writeBlocks
void writeBlocks(OutputDevice &od) const
write rail signal block output for all links and driveways
Definition: MSRailSignal.cpp:277
MSNet::addVehicleStateListener
void addVehicleStateListener(VehicleStateListener *listener)
Adds a vehicle states listener.
Definition: MSNet.cpp:877
MSVehicle::getWeightsStorage
const MSEdgeWeightsStorage & getWeightsStorage() const
Returns the vehicle's internal edge travel times/efforts container.
Definition: MSVehicle.cpp:1185
MSLane::clear
static void clear()
Clears the dictionary.
Definition: MSLane.cpp:1889
ProcessError
Definition: UtilExceptions.h:39
MSNet::myWarnedOnce
std::map< std::string, bool > myWarnedOnce
container to record warnings that shall only be issued once
Definition: MSNet.h:821
MSNet::addStoppingPlace
bool addStoppingPlace(const SumoXMLTag category, MSStoppingPlace *stop)
Adds a stopping place.
Definition: MSNet.cpp:905
MSInsertionControl::determineCandidates
void determineCandidates(SUMOTime time)
Checks for all vehicles whether they can be emitted.
Definition: MSInsertionControl.cpp:195
MSDevice::cleanupAll
static void cleanupAll()
perform cleanup for all devices
Definition: MSDevice.cpp:119
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
MSTransportableControl::abortAnyWaitingForVehicle
void abortAnyWaitingForVehicle()
aborts the plan for any transportable that is still waiting for a ride
Definition: MSTransportableControl.cpp:255
MSNet::SIMSTATE_LOADING
@ SIMSTATE_LOADING
The simulation is loading.
Definition: MSNet.h:98
EffortCalculator::addStop
virtual void addStop(const int stopEdge, const Parameterised &params)=0
MSGlobals.h
UtilExceptions.h
MSEdge::getMinimumTravelTime
double getMinimumTravelTime(const SUMOVehicle *const veh) const
returns the minimum travel time for the given vehicle
Definition: MSEdge.h:421
MSNet::myJunctions
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
Definition: MSNet.h:723
MSChargingStation
Definition: MSChargingStation.h:50
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
MSEdge
A road/street connecting two junctions.
Definition: MSEdge.h:78
MSNet::loadRoutes
void loadRoutes()
loads routes for the next few steps
Definition: MSNet.cpp:381
MSNet::checkWalkingarea
bool checkWalkingarea()
check all lanes for type walkingArea
Definition: MSNet.cpp:1072
MSEdgeControl::detectCollisions
void detectCollisions(SUMOTime timestep, const std::string &stage)
Detect collisions.
Definition: MSEdgeControl.cpp:296
MSQueueExport.h
MSTrigger.h
MSEdgeWeightsStorage::retrieveExistingEffort
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
Definition: MSEdgeWeightsStorage.cpp:54
MSNet::myLogStepNumber
bool myLogStepNumber
Information whether the number of the simulation step shall be logged.
Definition: MSNet.h:751
MSDevice_BTsender.h
MSCalibrator::cleanup
static void cleanup()
cleanup remaining data structures
Definition: MSCalibrator.cpp:485
MSNet::myStateDumpPeriod
SUMOTime myStateDumpPeriod
The period for writing state.
Definition: MSNet.h:774
MSParkingArea.h
MSBatteryExport::write
static void write(OutputDevice &of, SUMOTime timestep, int precision)
Writes the complete network state of the given edges into the given device.
Definition: MSBatteryExport.cpp:41
MSRoutingEngine.h
TraCIServer::cleanup
void cleanup()
clean up subscriptions
Definition: TraCIServer.cpp:649
MSFullExport.h
TraCIServer::getTargetTime
SUMOTime getTargetTime() const
Definition: TraCIServer.h:66
MSNet::STAGE_MOVEMENTS
static const std::string STAGE_MOVEMENTS
Definition: MSNet.h:844
MSContainer.h
MSVTKExport::write
static void write(OutputDevice &of, SUMOTime timestep)
Produce a VTK output to use with Tools like ParaView.
Definition: MSVTKExport.cpp:42
MSNet::myHasPedestrianNetwork
bool myHasPedestrianNetwork
Whether the network contains pedestrian network elements.
Definition: MSNet.h:795
MSDevice_BTsender::cleanup
static void cleanup()
removes remaining vehicleInformation in sVehicles
Definition: MSDevice_BTsender.cpp:63
TraCIServer::processCommandsUntilSimStep
void processCommandsUntilSimStep(SUMOTime step)
process all commands until the next SUMO simulation step. It is guaranteed that t->getTargetTime() >=...
Definition: TraCIServer.cpp:491
MSVehicleTransfer::checkInsertions
void checkInsertions(SUMOTime time)
Checks "movement" of stored vehicles.
Definition: MSVehicleTransfer.cpp:94
MSNet::SIMSTATE_CONNECTION_CLOSED
@ SIMSTATE_CONNECTION_CLOSED
The connection to a client was closed by the client.
Definition: MSNet.h:106
string2time
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:44
MSVehicleControl::getCollisionCount
int getCollisionCount() const
return the number of collisions
Definition: MSVehicleControl.h:289
MSNet::MSPedestrianRouter
PedestrianRouter< MSEdge, MSLane, MSJunction, MSVehicle > MSPedestrianRouter
Definition: MSNet.h:115
MSTransportableControl::getJammedNumber
int getJammedNumber() const
Returns the number of times a transportables was jammed.
Definition: MSTransportableControl.h:195
FareModul
Definition: FareModul.h:160
MSPerson.h
MSEdgeControl::setJunctionApproaches
void setJunctionApproaches(SUMOTime t)
Register junction approaches for all vehicles after velocities have been planned. This is a prerequis...
Definition: MSEdgeControl.cpp:147
MSNet::myVehicleStateListeners
std::vector< VehicleStateListener * > myVehicleStateListeners
Container for vehicle state listener.
Definition: MSNet.h:813
SUMOAbstractRouter< MSEdge, SUMOVehicle >
OutputDevice_File.h
libsumo::Helper::postProcessRemoteControl
static void postProcessRemoteControl()
Definition: Helper.cpp:889
MSNet::STAGE_EVENTS
static const std::string STAGE_EVENTS
string constants for simstep stages
Definition: MSNet.h:843
MSVTKExport.h
MSNet::myHasBidiEdges
bool myHasBidiEdges
Whether the network contains bidirectional rail edges.
Definition: MSNet.h:798
MSEdgeControl.h
MSNet::myRestrictions
std::map< std::string, std::map< SUMOVehicleClass, double > > myRestrictions
The vehicle class specific speed restrictions.
Definition: MSNet.h:786
OutputDevice::openTag
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
Definition: OutputDevice.cpp:239
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
MSDevice_Tripinfo::generateOutputForUnfinished
static void generateOutputForUnfinished()
generate output for vehicles which are still in the network
Definition: MSDevice_Tripinfo.cpp:285
MSNet::myRouterTT
std::map< int, SUMOAbstractRouter< MSEdge, SUMOVehicle > * > myRouterTT
Definition: MSNet.h:828
SUMO_TAG_BUS_STOP
@ SUMO_TAG_BUS_STOP
A bus stop.
Definition: SUMOXMLDefinitions.h:97
MSVehicleControl::getHaltingVehicleNo
virtual int getHaltingVehicleNo() const
Returns the number of halting vehicles.
Definition: MSVehicleControl.cpp:402
MSNet::myStateDumpSuffix
std::string myStateDumpSuffix
Definition: MSNet.h:777
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
MSNet::getPersonControl
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:810
MSGlobals::gMesoNet
static MELoop * gMesoNet
mesoscopic simulation infrastructure
Definition: MSGlobals.h:105
MSPModel::cleanup
static void cleanup()
remove state at simulation end
Definition: MSPModel.cpp:89
MSXMLRawOut.h
MSNet::SIMSTATE_RUNNING
@ SIMSTATE_RUNNING
The simulation is running.
Definition: MSNet.h:100
MSStateHandler.h
MSDevice_Tripinfo::printStatistics
static std::string printStatistics()
get statistics for printing to stdout
Definition: MSDevice_Tripinfo.cpp:356
MSVehicleControl::removePending
void removePending()
Removes a vehicle after it has ended.
Definition: MSVehicleControl.cpp:135
SUMORouteLoaderControl.h
MSTransportableControl::checkWaiting
void checkWaiting(MSNet *net, const SUMOTime time)
checks whether any transportables waiting time is over
Definition: MSTransportableControl.cpp:117
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:74
MSRoute.h
MSTransportableControl::getRunningNumber
int getRunningNumber() const
Returns the number of build and inserted, but not yet deleted transportables.
Definition: MSTransportableControl.h:188
MSNet::myLefthand
bool myLefthand
Whether the network was built for left-hand traffic.
Definition: MSNet.h:801
MSNet::myContainerControl
MSTransportableControl * myContainerControl
Controls container building and deletion;.
Definition: MSNet.h:719
MSNet::writeRailSignalBlocks
void writeRailSignalBlocks() const
write rail signal block output
Definition: MSNet.cpp:956
MSPModel.h
AStarRouter
Computes the shortest path through a network using the A* algorithm.
Definition: AStarRouter.h:77
joinToString
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
Definition: ToString.h:246
EffortCalculator
the effort calculator interface
Definition: EffortCalculator.h:32
OptionsIO::setArgs
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
Definition: OptionsIO.cpp:54
MSNet::myRouteLoaders
SUMORouteLoaderControl * myRouteLoaders
Route loader for dynamic loading of routes.
Definition: MSNet.h:698
MSDevice_Vehroutes.h
TraCIServer.h
MSEventControl::execute
virtual void execute(SUMOTime time)
Executes time-dependant commands.
Definition: MSEventControl.cpp:58
MSNet::generateStatistics
const std::string generateStatistics(SUMOTime start)
Writes performance output and running vehicle stats.
Definition: MSNet.cpp:387
MSVehicleControl::getTotalTravelTime
double getTotalTravelTime() const
Returns the total travel time.
Definition: MSVehicleControl.h:327
MSBatteryExport.h
MSFrame.h
MSVehicleControl::getVehicleMeanSpeeds
virtual std::pair< double, double > getVehicleMeanSpeeds() const
get current absolute and relative mean vehicle speed in the network
Definition: MSVehicleControl.cpp:416
MSDevice_SSM.h
MSNet::initStatic
static void initStatic()
Place for static initializations of simulation components (called after successful net build)
Definition: MSNet.cpp:175
config.h
MSVehicleControl
The class responsible for building and deletion of vehicles.
Definition: MSVehicleControl.h:71
MSEdgeControl
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:74
MSNet::myDetectorControl
MSDetectorControl * myDetectorControl
Controls detectors;.
Definition: MSNet.h:729
ShapeContainer.h
MSDevice_Tripinfo.h
MSTransportableControl::getLoadedNumber
int getLoadedNumber() const
Returns the number of build transportables.
Definition: MSTransportableControl.h:180
MSVehicleControl::getTotalDepartureDelay
double getTotalDepartureDelay() const
Returns the total departure delay.
Definition: MSVehicleControl.h:319
TraCIServer::getInstance
static TraCIServer * getInstance()
Definition: TraCIServer.h:70
DijkstraRouter.h
IntermodalNetwork::addAccess
void addAccess(const std::string &stopId, const E *stopEdge, const double pos, const double length, const SumoXMLTag category)
Adds access edges for stopping places to the intermodal network.
Definition: IntermodalNetwork.h:455
gPrecision
int gPrecision
the precision for floating point outputs
Definition: StdDefs.cpp:26
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:59
MELoop.h
MSNet::myEdgeWeights
MSEdgeWeightsStorage * myEdgeWeights
The net's knowledge about edge efforts/travel times;.
Definition: MSNet.h:739
FareModul.h
MSNet::checkBidiEdges
bool checkBidiEdges()
check wether bidirectional edges occur in the network
Definition: MSNet.cpp:1083
MSEdgeControl::executeMovements
void executeMovements(SUMOTime t)
Executes planned vehicle movements with regards to right-of-way.
Definition: MSEdgeControl.cpp:155
MSEdgeControl::planMovements
void planMovements(SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step....
Definition: MSEdgeControl.cpp:107
TraCIServer::wasClosed
static bool wasClosed()
check whether close was requested
Definition: TraCIServer.cpp:314
MSNet::addRestriction
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
Definition: MSNet.cpp:324
TraCIServer
TraCI server used to control sumo by a remote TraCI client.
Definition: TraCIServer.h:61
MSNet::myIntermodalRouter
std::map< int, MSIntermodalRouter * > myIntermodalRouter
Definition: MSNet.h:831
MSEventControl.h
MSLane.h
MSNet::closeBuilding
void closeBuilding(const OptionsCont &oc, MSEdgeControl *edges, MSJunctionControl *junctions, SUMORouteLoaderControl *routeLoaders, MSTLLogicControl *tlc, std::vector< SUMOTime > stateDumpTimes, std::vector< std::string > stateDumpFiles, bool hasInternalLinks, bool hasNeighs, bool lefthand, double version)
Closes the network's building process.
Definition: MSNet.cpp:238
MSVehicleControl::getTeleportCount
int getTeleportCount() const
return the number of teleports (including collisions)
Definition: MSVehicleControl.cpp:455
MSNet::myInsertionEvents
MSEventControl * myInsertionEvents
Controls insertion events;.
Definition: MSNet.h:735
MSNet::getStateMessage
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
Definition: MSNet.cpp:628
MSNet::SIMSTATE_INTERRUPTED
@ SIMSTATE_INTERRUPTED
An external interrupt occured.
Definition: MSNet.h:110
MSEdgeControl::patchActiveLanes
void patchActiveLanes()
Resets information whether a lane is active for all lanes.
Definition: MSEdgeControl.cpp:88
MSTLLogicControl::check2Switch
void check2Switch(SUMOTime step)
Checks whether any WAUT is trying to switch a tls into another program.
Definition: MSTLLogicControl.cpp:824
MSNet::adaptIntermodalRouter
static void adaptIntermodalRouter(MSIntermodalRouter &router)
Definition: MSNet.cpp:1033
MSNet::myHasInternalLinks
bool myHasInternalLinks
Whether the network contains internal links/lanes/edges.
Definition: MSNet.h:789
SUMORouteLoaderControl
Definition: SUMORouteLoaderControl.h:49
VERSION_STRING
#define VERSION_STRING
Definition: config.h:210
MSEdge::getAllEdges
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
Definition: MSEdge.cpp:798
MSStoppingPlace.h
MELoop::simulate
void simulate(SUMOTime tMax)
Perform simulation up to the given time.
Definition: MELoop.cpp:62
MSNet::checkElevation
bool checkElevation()
check all lanes for elevation data
Definition: MSNet.cpp:1058
MSVehicleControl.h
MSNet::SIMSTATE_TOO_MANY_TELEPORTS
@ SIMSTATE_TOO_MANY_TELEPORTS
The simulation had too many teleports.
Definition: MSNet.h:112
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
POSITION_EPS
#define POSITION_EPS
Definition: config.h:172
MSNet::getTravelTime
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:150
MSNet::getRouterEffort
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterEffort(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:986
MSVehicleTransfer.h
MSNet::myEdges
MSEdgeControl * myEdges
Controls edges, performs vehicle movement;.
Definition: MSNet.h:721
MSAmitranTrajectories::write
static void write(OutputDevice &of, const SUMOTime timestep)
Writes the complete network state into the given device.
Definition: MSAmitranTrajectories.cpp:44
OutputDevice::getDeviceByOption
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
Definition: OutputDevice.cpp:116
WRITE_MESSAGE
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:277
MSNet::getVehicleControl
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:336
MSNet::myPersonControl
MSTransportableControl * myPersonControl
Controls person building and deletion;.
Definition: MSNet.h:717
MSDevice_ToC.h
MSEdgeControl::getEdges
const MSEdgeVector & getEdges() const
Returns loaded edges.
Definition: MSEdgeControl.h:169
MSDetectorControl::updateDetectors
void updateDetectors(const SUMOTime step)
Computes detector values.
Definition: MSDetectorControl.cpp:112
OptionsIO.h
IntermodalRouter.h
MSDevice_ToC::getInstances
static const std::set< MSDevice_ToC *, ComparatorNumericalIdLess > & getInstances()
returns all currently existing ToC devices
Definition: MSDevice_ToC.h:93
MSDevice_ToC::cleanup
static void cleanup()
Closes root tags of output files.
Definition: MSDevice_ToC.cpp:1031
XMLSubSys.h
IntermodalRouter::getNetwork
Network * getNetwork() const
Definition: IntermodalRouter.h:234
MSNet::myBeginOfTimestepEvents
MSEventControl * myBeginOfTimestepEvents
Controls events executed at the begin of a time step;.
Definition: MSNet.h:731
MSVehicle
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:79
MSRailSignal.h