Eclipse SUMO - Simulation of Urban MObility
MSNet.h
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 /****************************************************************************/
21 // The simulated network and simulation performer
22 /****************************************************************************/
23 #ifndef MSNet_h
24 #define MSNet_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #include <config.h>
31 
32 #include <typeinfo>
33 #include <vector>
34 #include <map>
35 #include <string>
36 #include <fstream>
37 #include <iostream>
38 #include <cmath>
39 #include <iomanip>
40 #include <memory>
41 #include <utils/common/SUMOTime.h>
47 #include "MSJunction.h"
48 
49 #ifdef HAVE_FOX
51 #endif
52 
53 
54 // ===========================================================================
55 // class declarations
56 // ===========================================================================
57 class MSEdge;
58 class MSEdgeControl;
59 class MSEventControl;
60 class MSVehicleControl;
61 class MSJunctionControl;
62 class MSInsertionControl;
65 class MSVehicle;
66 class MSRoute;
67 class MSLane;
68 class MSTLLogicControl;
70 class MSDetectorControl;
71 class ShapeContainer;
73 class PolygonDynamics;
74 class BinaryInputDevice;
76 class SUMOVehicle;
77 class MSStoppingPlace;
78 template<class E, class L, class N, class V>
80 template<class E, class L, class N, class V>
82 
83 
84 // ===========================================================================
85 // class definitions
86 // ===========================================================================
91 class MSNet {
92 public:
113  };
114 
117 
118 
119 public:
124  static MSNet* getInstance();
125 
129  virtual bool isGUINet() const {
130  return false;
131  }
132 
134  static void initStatic();
135 
137  static void cleanupStatic();
138 
139 
143  static bool hasInstance() {
144  return myInstance != nullptr;
145  }
146 
147 
162  MSNet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents,
163  MSEventControl* endOfTimestepEvents,
164  MSEventControl* insertionEvents,
165  ShapeContainer* shapeCont = 0);
166 
167 
169  virtual ~MSNet();
170 
171 
187  void closeBuilding(const OptionsCont& oc, MSEdgeControl* edges, MSJunctionControl* junctions,
188  SUMORouteLoaderControl* routeLoaders, MSTLLogicControl* tlc,
189  std::vector<SUMOTime> stateDumpTimes, std::vector<std::string> stateDumpFiles,
190  bool hasInternalLinks, bool hasNeighs, bool lefthand,
191  double version);
192 
193 
197  bool hasPermissions() const {
198  return myHavePermissions;
199  }
200 
201 
204  myHavePermissions = true;
205  }
206 
207 
213  void addRestriction(const std::string& id, const SUMOVehicleClass svc, const double speed);
214 
215 
221  const std::map<SUMOVehicleClass, double>* getRestrictions(const std::string& id) const;
222 
223 
227  static void clearAll();
228 
229 
238 
239 
243  void simulationStep();
244 
245 
247  void loadRoutes();
248 
249 
254  const std::string generateStatistics(SUMOTime start);
255 
256 
263  void closeSimulation(SUMOTime start);
264 
265 
271  SimulationState simulationState(SUMOTime stopTime) const;
272 
273 
277  static std::string getStateMessage(SimulationState state);
278 
279 
283  inline SUMOTime getCurrentTimeStep() const {
284  return myStep;
285  }
286 
287 
291  inline void setCurrentTimeStep(const SUMOTime step) {
292  myStep = step;
293  }
294 
295 
299  void writeOutput();
300 
301 
305  bool logSimulationDuration() const;
306 
307 
308 
310 
311 
316  void preSimStepOutput() const;
317 
318 
323  void postSimStepOutput() const;
324  //}
325 
326 
327 
330 
337  return *myVehicleControl;
338  }
339 
340 
350 
353  bool hasPersons() const {
354  return myPersonControl != 0;
355  }
356 
366 
369  bool hasContainers() const {
370  return myContainerControl != 0;
371  }
372 
373 
380  return *myEdges;
381  }
382 
383 
390  return *myInserter;
391  }
392 
393 
400  return *myDetectorControl;
401  }
402 
403 
410  return *myLogics;
411  }
412 
413 
420  return *myJunctions;
421  }
422 
423 
431  }
432 
433 
440  return myEndOfTimestepEvents;
441  }
442 
443 
450  return myInsertionEvents;
451  }
452 
453 
460  return *myShapeContainer;
461  }
462 
467  return myDynamicShapeUpdater.get();
468  }
469 
474 
482 
485 
496  bool addStoppingPlace(const SumoXMLTag category, MSStoppingPlace* stop);
497 
498 
504  MSStoppingPlace* getStoppingPlace(const std::string& id, const SumoXMLTag category) const;
505 
512  std::string getStoppingPlaceID(const MSLane* lane, const double pos, const SumoXMLTag category) const;
514 
516 
518  void writeChargingStationOutput() const;
519 
521  void writeRailSignalBlocks() const;
522 
525 
527  virtual bool isSelected(const MSTrafficLightLogic*) const {
528  return false;
529  }
530 
533 
562  };
563 
564 
569  public:
572 
574  virtual ~VehicleStateListener() { }
575 
581  virtual void vehicleStateChanged(const SUMOVehicle* const vehicle, VehicleState to, const std::string& info = "") = 0;
582 
583  };
584 
585 
589  void addVehicleStateListener(VehicleStateListener* listener);
590 
591 
595  void removeVehicleStateListener(VehicleStateListener* listener);
596 
597 
604  void informVehicleStateListener(const SUMOVehicle* const vehicle, VehicleState to, const std::string& info = "");
606 
607 
608 
616  static double getTravelTime(const MSEdge* const e, const SUMOVehicle* const v, double t);
617 
618 
626  static double getEffort(const MSEdge* const e, const SUMOVehicle* const v, double t);
627 
628 
629  /* @brief get the router, initialize on first use
630  * @param[in] prohibited The vector of forbidden edges (optional)
631  */
633  const MSEdgeVector& prohibited = MSEdgeVector()) const;
635  const MSEdgeVector& prohibited = MSEdgeVector()) const;
636  MSPedestrianRouter& getPedestrianRouter(const int rngIndex, const MSEdgeVector& prohibited = MSEdgeVector()) const;
637  MSIntermodalRouter& getIntermodalRouter(const int rngIndex, const int routingMode = 0, const MSEdgeVector& prohibited = MSEdgeVector()) const;
638 
639  static void adaptIntermodalRouter(MSIntermodalRouter& router);
640 
641 
643  bool hasInternalLinks() const {
644  return myHasInternalLinks;
645  }
646 
648  bool hasElevation() const {
649  return myHasElevation;
650  }
651 
653  bool hasPedestrianNetwork() const {
654  return myHasPedestrianNetwork;
655 
656  }
658  bool hasBidiEdges() const {
659  return myHasBidiEdges;
660  }
661 
663  bool lefthand() const {
664  return myLefthand;
665  }
666 
668  double getNetworkVersion() const {
669  return myVersion;
670  }
671 
673  bool warnOnce(const std::string& typeAndID);
674 
675  void interrupt() {
676  myAmInterrupted = true;
677  }
678 
679  bool isInterrupted() const {
680  return myAmInterrupted;
681  }
682 
683 protected:
685  bool checkElevation();
686 
688  bool checkWalkingarea();
689 
691  bool checkBidiEdges();
692 
693 protected:
695  static MSNet* myInstance;
696 
699 
702 
705 
708 
709 
710 
713 
741 
742 
743 
746 
749 
752 
755 
758 
760  long long int myVehiclesMoved;
761  long long int myPersonsMoved;
762  //}
763 
764 
765 
768 
770  std::vector<SUMOTime> myStateDumpTimes;
772  std::vector<std::string> myStateDumpFiles;
776  std::string myStateDumpPrefix;
777  std::string myStateDumpSuffix;
779 
780 
781 
784 
786  std::map<std::string, std::map<SUMOVehicleClass, double> > myRestrictions;
787 
790 
793 
796 
799 
802 
804  double myVersion;
805 
808 
810  std::map<SumoXMLTag, NamedObjectCont<MSStoppingPlace*> > myStoppingPlaces;
811 
813  std::vector<VehicleStateListener*> myVehicleStateListeners;
814 
815 #ifdef HAVE_FOX
816  FXMutex myStateListenerMutex;
818 #endif
819 
821  std::map<std::string, bool> myWarnedOnce;
822 
823  /* @brief The router instance for routing by trigger and by traci
824  * @note MSDevice_Routing has its own instance since it uses a different weight function
825  * @note we provide one member for every switchable router type
826  * because the class structure makes it inconvenient to use a superclass
827  */
828  mutable std::map<int, SUMOAbstractRouter<MSEdge, SUMOVehicle>*> myRouterTT;
829  mutable std::map<int, SUMOAbstractRouter<MSEdge, SUMOVehicle>*> myRouterEffort;
830  mutable std::map<int, MSPedestrianRouter*> myPedestrianRouter;
831  mutable std::map<int, MSIntermodalRouter*> myIntermodalRouter;
832 
834  mutable std::pair<bool, NamedRTree> myLanesRTree;
835 
839  std::unique_ptr<MSDynamicShapeUpdater> myDynamicShapeUpdater;
840 
841 
843  static const std::string STAGE_EVENTS;
844  static const std::string STAGE_MOVEMENTS;
845  static const std::string STAGE_LANECHANGE;
846  static const std::string STAGE_INSERTIONS;
847 
848 private:
850  MSNet(const MSNet&);
851 
853  MSNet& operator=(const MSNet&);
854 
855 
856 };
857 
858 
859 #endif
860 
861 /****************************************************************************/
862 
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
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::createTLWrapper
virtual void createTLWrapper(MSTrafficLightLogic *)
creates a wrapper for the given logic (see GUINet)
Definition: MSNet.h:524
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::VehicleStateListener::VehicleStateListener
VehicleStateListener()
Constructor.
Definition: MSNet.h:571
MSNet::getRouterTT
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:968
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
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
MSNet::hasPermissions
bool hasPermissions() const
Returns whether the network has specific vehicle class permissions.
Definition: MSNet.h:197
MSNet::hasBidiEdges
bool hasBidiEdges() const
return whether the network contains bidirectional rail edges
Definition: MSNet.h:658
MSNet::VEHICLE_STATE_DEPARTED
@ VEHICLE_STATE_DEPARTED
The vehicle has departed (was inserted into the network)
Definition: MSNet.h:539
PedestrianRouter
Definition: MSNet.h:81
MSNet::getDetectorControl
MSDetectorControl & getDetectorControl()
Returns the detector control.
Definition: MSNet.h:399
MSNet::hasContainers
bool hasContainers() const
Returns whether containers are simulated.
Definition: MSNet.h:369
MSNet::preSimStepOutput
void preSimStepOutput() const
Prints the current step number.
Definition: MSNet.cpp:841
SUMOTime.h
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
MSNet::STAGE_INSERTIONS
static const std::string STAGE_INSERTIONS
Definition: MSNet.h:846
MSNet::simulationStep
void simulationStep()
Performs a single simulation step.
Definition: MSNet.cpp:466
MSNet::myVehicleControl
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
Definition: MSNet.h:715
MSNet::getDynamicShapeUpdater
MSDynamicShapeUpdater * getDynamicShapeUpdater()
Returns the dynamic shapes updater.
Definition: MSNet.h:466
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
FXConditionalLock.h
MSNet::myPersonsMoved
long long int myPersonsMoved
Definition: MSNet.h:761
MSNet::getShapeContainer
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:459
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
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
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
MSNet::VehicleStateListener
Interface for objects listening to vehicle state changes.
Definition: MSNet.h:568
MSNet::getBeginOfTimestepEvents
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
Definition: MSNet.h:429
MSDetectorControl
Detectors container; responsible for string and output generation.
Definition: MSDetectorControl.h:52
MSNet
The simulated network and simulation perfomer.
Definition: MSNet.h:91
MSNet::myEndOfTimestepEvents
MSEventControl * myEndOfTimestepEvents
Controls events executed at the end of a time step;.
Definition: MSNet.h:733
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
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
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
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
MSNet::MSIntermodalRouter
IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle > MSIntermodalRouter
Definition: MSNet.h:116
ShapeContainer
Storage for geometrical objects.
Definition: ShapeContainer.h:49
MSNet::myVersion
double myVersion
the network version
Definition: MSNet.h:804
MSNet::myStateDumpTimes
std::vector< SUMOTime > myStateDumpTimes
Times at which a state shall be written.
Definition: MSNet.h:770
MSNet::hasPersons
bool hasPersons() const
Returns whether persons are simulated.
Definition: MSNet.h:353
MSNet::clearAll
static void clearAll()
Clears all dictionaries.
Definition: MSNet.cpp:653
MSChargingStation.h
MSNet::logSimulationDuration
bool logSimulationDuration() const
Returns whether duration shall be logged.
Definition: MSNet.cpp:804
MSNet::myPedestrianRouter
std::map< int, MSPedestrianRouter * > myPedestrianRouter
Definition: MSNet.h:830
NamedRTree.h
MSNet::simulate
SimulationState simulate(SUMOTime start, SUMOTime stop)
Simulates from timestep start to stop.
Definition: MSNet.cpp:340
MSNet::makeDynamicShapeUpdater
MSDynamicShapeUpdater * makeDynamicShapeUpdater()
Creates and returns a dynamic shapes updater.
Definition: MSNet.cpp:826
MSNet::VEHICLE_STATE_ARRIVED
@ VEHICLE_STATE_ARRIVED
The vehicle arrived at his destination (is deleted)
Definition: MSNet.h:545
MSNet::setCurrentTimeStep
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
Definition: MSNet.h:291
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
MSNet::VEHICLE_STATE_NEWROUTE
@ VEHICLE_STATE_NEWROUTE
The vehicle got a new route.
Definition: MSNet.h:547
MSNet::isGUINet
virtual bool isGUINet() const
Returns whether this is a GUI Net.
Definition: MSNet.h:129
MSDynamicShapeUpdater
Definition: MSDynamicShapeUpdater.h:25
MSNet::closeSimulation
void closeSimulation(SUMOTime start)
Closes the simulation (all files, connections, etc.)
Definition: MSNet.cpp:445
MSRoute
Definition: MSRoute.h:66
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
MSNet::myStateDumpFiles
std::vector< std::string > myStateDumpFiles
The names for the state files.
Definition: MSNet.h:772
MSEdgeWeightsStorage
A storage for edge travel times and efforts.
Definition: MSEdgeWeightsStorage.h:43
MSNet::VEHICLE_STATE_EMERGENCYSTOP
@ VEHICLE_STATE_EMERGENCYSTOP
The vehicle had to brake harder than permitted.
Definition: MSNet.h:559
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
MSNet::myVehiclesMoved
long long int myVehiclesMoved
The overall number of vehicle movements.
Definition: MSNet.h:760
MSTransportableControl
Definition: MSTransportableControl.h:51
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
MSNet::SIMSTATE_NO_FURTHER_VEHICLES
@ SIMSTATE_NO_FURTHER_VEHICLES
The simulation does not contain further vehicles.
Definition: MSNet.h:104
MSJunctionControl
Container for junctions; performs operations on all stored junctions.
Definition: MSJunctionControl.h:44
MSNet::mySimBeginMillis
long mySimBeginMillis
The overall simulation duration.
Definition: MSNet.h:757
MSNet::myAmInterrupted
bool myAmInterrupted
whether an interrupt occured
Definition: MSNet.h:707
MSNet::myStoppingPlaces
std::map< SumoXMLTag, NamedObjectCont< MSStoppingPlace * > > myStoppingPlaces
Dictionary of bus / container stops.
Definition: MSNet.h:810
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
MSNet::getStoppingPlaces
const NamedObjectCont< MSStoppingPlace * > & getStoppingPlaces(SumoXMLTag category) const
Definition: MSNet.cpp:934
MSNet::VEHICLE_STATE_STARTING_PARKING
@ VEHICLE_STATE_STARTING_PARKING
The vehicles starts to park.
Definition: MSNet.h:549
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
MSNet::myStep
SUMOTime myStep
Current time step.
Definition: MSNet.h:701
MSNet::getWeightsStorage
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
Definition: MSNet.cpp:832
MSNet::setPermissionsFound
void setPermissionsFound()
Labels the network to contain vehicle class permissions.
Definition: MSNet.h:203
MSNet::VehicleState
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:535
MSJunction.h
MSNet::getEndOfTimestepEvents
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a time step.
Definition: MSNet.h:439
MSNet::lefthand
bool lefthand() const
return whether the network was built for lefthand traffic
Definition: MSNet.h:663
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
MSNet::~MSNet
virtual ~MSNet()
Destructor.
Definition: MSNet.cpp:272
MSNet::operator=
MSNet & operator=(const MSNet &)
Invalidated assignment operator.
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
MSNet::getPedestrianRouter
MSPedestrianRouter & getPedestrianRouter(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:996
MSNet::myInserter
MSInsertionControl * myInserter
Controls vehicle insertion;.
Definition: MSNet.h:727
MSNet::myLogics
MSTLLogicControl * myLogics
Controls tls logics, realizes waiting on tls rules;.
Definition: MSNet.h:725
MSNet::addVehicleStateListener
void addVehicleStateListener(VehicleStateListener *listener)
Adds a vehicle states listener.
Definition: MSNet.cpp:877
MSNet::VehicleStateListener::~VehicleStateListener
virtual ~VehicleStateListener()
Destructor.
Definition: MSNet.h:574
MSNet::myWarnedOnce
std::map< std::string, bool > myWarnedOnce
container to record warnings that shall only be issued once
Definition: MSNet.h:821
MSNet::VEHICLE_STATE_COLLISION
@ VEHICLE_STATE_COLLISION
The vehicle is involved in a collision.
Definition: MSNet.h:557
MSNet::addStoppingPlace
bool addStoppingPlace(const SumoXMLTag category, MSStoppingPlace *stop)
Adds a stopping place.
Definition: MSNet.cpp:905
MSNet::VEHICLE_STATE_STARTING_TELEPORT
@ VEHICLE_STATE_STARTING_TELEPORT
The vehicle started to teleport.
Definition: MSNet.h:541
MSNet::VEHICLE_STATE_BUILT
@ VEHICLE_STATE_BUILT
The vehicle was built, but has not yet departed.
Definition: MSNet.h:537
MSNet::VEHICLE_STATE_STARTING_STOP
@ VEHICLE_STATE_STARTING_STOP
The vehicles starts to stop.
Definition: MSNet.h:553
MSNet::SIMSTATE_LOADING
@ SIMSTATE_LOADING
The simulation is loading.
Definition: MSNet.h:98
UtilExceptions.h
MSNet::myJunctions
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
Definition: MSNet.h:723
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
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:55
MSNet::myLogStepNumber
bool myLogStepNumber
Information whether the number of the simulation step shall be logged.
Definition: MSNet.h:751
MSNet::myStateDumpPeriod
SUMOTime myStateDumpPeriod
The period for writing state.
Definition: MSNet.h:774
MSNet::hasElevation
bool hasElevation() const
return whether the network contains elevation data
Definition: MSNet.h:648
MSNet::STAGE_MOVEMENTS
static const std::string STAGE_MOVEMENTS
Definition: MSNet.h:844
MSNet::myHasPedestrianNetwork
bool myHasPedestrianNetwork
Whether the network contains pedestrian network elements.
Definition: MSNet.h:795
MSNet::SIMSTATE_CONNECTION_CLOSED
@ SIMSTATE_CONNECTION_CLOSED
The connection to a client was closed by the client.
Definition: MSNet.h:106
MSNet::MSPedestrianRouter
PedestrianRouter< MSEdge, MSLane, MSJunction, MSVehicle > MSPedestrianRouter
Definition: MSNet.h:115
MSNet::myVehicleStateListeners
std::vector< VehicleStateListener * > myVehicleStateListeners
Container for vehicle state listener.
Definition: MSNet.h:813
SUMOAbstractRouter< MSEdge, SUMOVehicle >
MSNet::STAGE_EVENTS
static const std::string STAGE_EVENTS
string constants for simstep stages
Definition: MSNet.h:843
NamedObjectCont.h
MSNet::myHasBidiEdges
bool myHasBidiEdges
Whether the network contains bidirectional rail edges.
Definition: MSNet.h:798
MSNet::myRestrictions
std::map< std::string, std::map< SUMOVehicleClass, double > > myRestrictions
The vehicle class specific speed restrictions.
Definition: MSNet.h:786
MSNet::getTLSControl
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:409
MSNet::VEHICLE_STATE_MANEUVERING
@ VEHICLE_STATE_MANEUVERING
Vehicle maneuvering either entering or exiting a parking space.
Definition: MSNet.h:561
MSNet::myRouterTT
std::map< int, SUMOAbstractRouter< MSEdge, SUMOVehicle > * > myRouterTT
Definition: MSNet.h:828
MSNet::isSelected
virtual bool isSelected(const MSTrafficLightLogic *) const
return wheter the given logic (or rather it's wrapper) is selected in the GUI
Definition: MSNet.h:527
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
MSNet::SIMSTATE_RUNNING
@ SIMSTATE_RUNNING
The simulation is running.
Definition: MSNet.h:100
MSNet::VehicleStateListener::vehicleStateChanged
virtual void vehicleStateChanged(const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")=0
Called if a vehicle changes its state.
MSNet::isInterrupted
bool isInterrupted() const
Definition: MSNet.h:679
MSEdgeVector
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:74
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::getInsertionEvents
MSEventControl * getInsertionEvents()
Returns the event control for insertion events.
Definition: MSNet.h:449
MSNet::VEHICLE_STATE_ENDING_PARKING
@ VEHICLE_STATE_ENDING_PARKING
The vehicle ends to park.
Definition: MSNet.h:551
MSNet::writeRailSignalBlocks
void writeRailSignalBlocks() const
write rail signal block output
Definition: MSNet.cpp:956
MSNet::myRouteLoaders
SUMORouteLoaderControl * myRouteLoaders
Route loader for dynamic loading of routes.
Definition: MSNet.h:698
MSNet::VEHICLE_STATE_ENDING_TELEPORT
@ VEHICLE_STATE_ENDING_TELEPORT
The vehicle ended being teleported.
Definition: MSNet.h:543
MSNet::generateStatistics
const std::string generateStatistics(SUMOTime start)
Writes performance output and running vehicle stats.
Definition: MSNet.cpp:387
PolygonDynamics
Definition: PolygonDynamics.h:29
MSNet::hasInstance
static bool hasInstance()
Returns whether the network was already constructed.
Definition: MSNet.h:143
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
MSTLLogicControl
A class that stores and controls tls and switching of their programs.
Definition: MSTLLogicControl.h:59
MSNet::myEdgeWeights
MSEdgeWeightsStorage * myEdgeWeights
The net's knowledge about edge efforts/travel times;.
Definition: MSNet.h:739
MSNet::checkBidiEdges
bool checkBidiEdges()
check wether bidirectional edges occur in the network
Definition: MSNet.cpp:1083
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
MSNet::myIntermodalRouter
std::map< int, MSIntermodalRouter * > myIntermodalRouter
Definition: MSNet.h:831
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
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::interrupt
void interrupt()
Definition: MSNet.h:675
MSNet::getNetworkVersion
double getNetworkVersion() const
return the network version
Definition: MSNet.h:668
MSNet::SIMSTATE_INTERRUPTED
@ SIMSTATE_INTERRUPTED
An external interrupt occured.
Definition: MSNet.h:110
MSNet::getEdgeControl
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:379
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
SUMOAbstractRouter.h
MSNet::hasPedestrianNetwork
bool hasPedestrianNetwork() const
return whether the network contains walkingareas and crossings
Definition: MSNet.h:653
MSNet::checkElevation
bool checkElevation()
check all lanes for elevation data
Definition: MSNet.cpp:1058
MSNet::SIMSTATE_TOO_MANY_TELEPORTS
@ SIMSTATE_TOO_MANY_TELEPORTS
The simulation had too many teleports.
Definition: MSNet.h:112
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::myHavePermissions
bool myHavePermissions
Whether the network contains edges which not all vehicles may pass.
Definition: MSNet.h:783
MSNet::getRouterEffort
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterEffort(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:986
MSNet::myEdges
MSEdgeControl * myEdges
Controls edges, performs vehicle movement;.
Definition: MSNet.h:721
MSNet::VEHICLE_STATE_ENDING_STOP
@ VEHICLE_STATE_ENDING_STOP
The vehicle ends to stop.
Definition: MSNet.h:555
MSNet::getJunctionControl
MSJunctionControl & getJunctionControl()
Returns the junctions control.
Definition: MSNet.h:419
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
BinaryInputDevice
Encapsulates binary reading operations on a file.
Definition: BinaryInputDevice.h:57
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