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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
25 // The simulated network and simulation performer
26 /****************************************************************************/
27 #pragma once
28 #include <config.h>
29 
30 #include <typeinfo>
31 #include <vector>
32 #include <map>
33 #include <string>
34 #include <fstream>
35 #include <iostream>
36 #include <cmath>
37 #include <iomanip>
38 #include <memory>
39 #include <utils/common/SUMOTime.h>
44 #include "MSJunction.h"
45 
46 #ifdef HAVE_FOX
48 #endif
49 
50 
51 // ===========================================================================
52 // class declarations
53 // ===========================================================================
54 class MSEdge;
55 class MSEdgeControl;
56 class MSEventControl;
57 class MSVehicleControl;
58 class MSJunctionControl;
59 class MSInsertionControl;
62 class MSVehicle;
63 class MSRoute;
64 class MSLane;
65 class MSTLLogicControl;
67 class MSDetectorControl;
68 class ShapeContainer;
70 class PolygonDynamics;
72 class SUMOVehicle;
74 class MSStoppingPlace;
75 template<class E, class L, class N, class V>
76 class IntermodalRouter;
77 template<class E, class L, class N, class V>
78 class PedestrianRouter;
79 class OptionsCont;
80 
81 
82 // ===========================================================================
83 // class definitions
84 // ===========================================================================
89 class MSNet {
90 public:
111  };
112 
115 
117  struct MesoEdgeType {
122  double jamThreshold;
124  double tlsPenalty;
128  };
129 
130 public:
135  static MSNet* getInstance();
136 
140  virtual bool isGUINet() const {
141  return false;
142  }
143 
145  static void initStatic();
146 
148  static void cleanupStatic();
149 
150 
154  static bool hasInstance() {
155  return myInstance != nullptr;
156  }
157 
158 
173  MSNet(MSVehicleControl* vc, MSEventControl* beginOfTimestepEvents,
174  MSEventControl* endOfTimestepEvents,
175  MSEventControl* insertionEvents,
176  ShapeContainer* shapeCont = 0);
177 
178 
180  virtual ~MSNet();
181 
182 
197  void closeBuilding(const OptionsCont& oc, MSEdgeControl* edges, MSJunctionControl* junctions,
198  SUMORouteLoaderControl* routeLoaders, MSTLLogicControl* tlc,
199  std::vector<SUMOTime> stateDumpTimes, std::vector<std::string> stateDumpFiles,
200  bool hasInternalLinks, bool hasNeighs,
201  double version);
202 
203 
207  bool hasPermissions() const {
208  return myHavePermissions;
209  }
210 
211 
214  myHavePermissions = true;
215  }
216 
217 
223  void addRestriction(const std::string& id, const SUMOVehicleClass svc, const double speed);
224 
225 
231  const std::map<SUMOVehicleClass, double>* getRestrictions(const std::string& id) const;
232 
237  void addMesoType(const std::string& typeID, const MesoEdgeType& edgeType);
238 
242  const MesoEdgeType& getMesoType(const std::string& typeID);
243 
247  static void clearAll();
248 
249 
258 
259 
263  void simulationStep();
264 
265 
267  void loadRoutes();
268 
269 
274  const std::string generateStatistics(SUMOTime start);
275 
277  void writeStatistics() const;
278 
285  void closeSimulation(SUMOTime start, const std::string& reason = "");
286 
287 
293  SimulationState simulationState(SUMOTime stopTime) const;
294 
295 
301  SimulationState adaptToState(const SimulationState state) const;
302 
303 
307  static std::string getStateMessage(SimulationState state);
308 
309 
313  inline SUMOTime getCurrentTimeStep() const {
314  return myStep;
315  }
316 
317 
321  inline void setCurrentTimeStep(const SUMOTime step) {
322  myStep = step;
323  }
324 
325 
329  void clearState(const SUMOTime step);
330 
334  void writeOutput();
335 
336 
340  bool logSimulationDuration() const;
341 
342 
343 
345 
346 
351  void preSimStepOutput() const;
352 
353 
358  void postSimStepOutput() const;
359  //}
360 
361 
362 
365 
372  return *myVehicleControl;
373  }
374 
375 
385 
388  bool hasPersons() const {
389  return myPersonControl != nullptr;
390  }
391 
401 
404  bool hasContainers() const {
405  return myContainerControl != nullptr;
406  }
407 
408 
415  return *myEdges;
416  }
417 
418 
425  return *myInserter;
426  }
427 
428 
435  return *myDetectorControl;
436  }
437 
438 
445  return *myLogics;
446  }
447 
448 
455  return *myJunctions;
456  }
457 
458 
466  }
467 
468 
475  return myEndOfTimestepEvents;
476  }
477 
478 
485  return myInsertionEvents;
486  }
487 
488 
495  return *myShapeContainer;
496  }
497 
502  return myDynamicShapeUpdater.get();
503  }
504 
509 
517 
520 
531  bool addStoppingPlace(const SumoXMLTag category, MSStoppingPlace* stop);
532 
533 
543 
544 
550  MSStoppingPlace* getStoppingPlace(const std::string& id, const SumoXMLTag category) const;
551 
558  std::string getStoppingPlaceID(const MSLane* lane, const double pos, const SumoXMLTag category) const;
560 
562 
564  void writeChargingStationOutput() const;
565 
567  void writeRailSignalBlocks() const;
568 
571 
573  void writeOverheadWireSegmentOutput() const;
574 
576  void writeSubstationOutput() const;
577 
579  virtual bool isSelected(const MSTrafficLightLogic*) const {
580  return false;
581  }
582 
585 
614  };
615 
616 
621  public:
624 
626  virtual ~VehicleStateListener() { }
627 
633  virtual void vehicleStateChanged(const SUMOVehicle* const vehicle, VehicleState to, const std::string& info = "") = 0;
634 
635  };
636 
637 
642 
643 
648 
649 
656  void informVehicleStateListener(const SUMOVehicle* const vehicle, VehicleState to, const std::string& info = "");
658 
659 
660 
668  static double getTravelTime(const MSEdge* const e, const SUMOVehicle* const v, double t);
669 
670 
678  static double getEffort(const MSEdge* const e, const SUMOVehicle* const v, double t);
679 
680 
681  /* @brief get the router, initialize on first use
682  * @param[in] prohibited The vector of forbidden edges (optional)
683  */
685  const MSEdgeVector& prohibited = MSEdgeVector()) const;
687  const MSEdgeVector& prohibited = MSEdgeVector()) const;
688  MSPedestrianRouter& getPedestrianRouter(const int rngIndex, const MSEdgeVector& prohibited = MSEdgeVector()) const;
689  MSIntermodalRouter& getIntermodalRouter(const int rngIndex, const int routingMode = 0, const MSEdgeVector& prohibited = MSEdgeVector()) const;
690 
691  static void adaptIntermodalRouter(MSIntermodalRouter& router);
692 
693 
695  bool hasInternalLinks() const {
696  return myHasInternalLinks;
697  }
698 
700  bool hasElevation() const {
701  return myHasElevation;
702  }
703 
705  bool hasPedestrianNetwork() const {
706  return myHasPedestrianNetwork;
707 
708  }
710  bool hasBidiEdges() const {
711  return myHasBidiEdges;
712  }
713 
715  double getNetworkVersion() const {
716  return myVersion;
717  }
718 
720  bool warnOnce(const std::string& typeAndID);
721 
722  void interrupt() {
723  myAmInterrupted = true;
724  }
725 
726  bool isInterrupted() const {
727  return myAmInterrupted;
728  }
729 
731  MSTractionSubstation* findTractionSubstation(const std::string& substationId);
732 
734  bool existTractionSubstation(const std::string& substationId);
735 
736 protected:
738  bool checkElevation();
739 
741  bool checkWalkingarea();
742 
744  bool checkBidiEdges();
745 
746 protected:
748  static MSNet* myInstance;
749 
752 
755 
758 
761 
762 
763 
766 
794 
795 
796 
799 
802 
807 
810 
813 
815  long long int myVehiclesMoved;
816  long long int myPersonsMoved;
817  //}
818 
819 
820 
823 
825  std::vector<SUMOTime> myStateDumpTimes;
827  std::vector<std::string> myStateDumpFiles;
831  std::string myStateDumpPrefix;
832  std::string myStateDumpSuffix;
834 
835 
836 
839 
841  std::map<std::string, std::map<SUMOVehicleClass, double> > myRestrictions;
842 
844  std::map<std::string, MesoEdgeType> myMesoEdgeTypes;
845 
848 
851 
854 
857 
860 
862  double myVersion;
863 
866 
868  std::map<SumoXMLTag, NamedObjectCont<MSStoppingPlace*> > myStoppingPlaces;
869 
871  std::vector<MSTractionSubstation*> myTractionSubstations;
872 
874  std::vector<VehicleStateListener*> myVehicleStateListeners;
875 
876 #ifdef HAVE_FOX
878  FXMutex myStateListenerMutex;
879 #endif
880 
882  std::map<std::string, bool> myWarnedOnce;
883 
884  /* @brief The router instance for routing by trigger and by traci
885  * @note MSDevice_Routing has its own instance since it uses a different weight function
886  * @note we provide one member for every switchable router type
887  * because the class structure makes it inconvenient to use a superclass
888  */
889  mutable std::map<int, SUMOAbstractRouter<MSEdge, SUMOVehicle>*> myRouterTT;
890  mutable std::map<int, SUMOAbstractRouter<MSEdge, SUMOVehicle>*> myRouterEffort;
891  mutable std::map<int, MSPedestrianRouter*> myPedestrianRouter;
892  mutable std::map<int, MSIntermodalRouter*> myIntermodalRouter;
893 
895  mutable std::pair<bool, NamedRTree> myLanesRTree;
896 
900  std::unique_ptr<MSDynamicShapeUpdater> myDynamicShapeUpdater;
901 
902 
904  static const std::string STAGE_EVENTS;
905  static const std::string STAGE_MOVEMENTS;
906  static const std::string STAGE_LANECHANGE;
907  static const std::string STAGE_INSERTIONS;
908 
909 private:
911  MSNet(const MSNet&);
912 
915 
916 
917 };
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:73
long long int SUMOTime
Definition: SUMOTime.h:31
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLTag
Numbers representing SUMO-XML - element names.
Detectors container; responsible for string and output generation.
Stores edges and lanes, performs moving of vehicle.
Definition: MSEdgeControl.h:81
A road/street connecting two junctions.
Definition: MSEdge.h:77
A storage for edge travel times and efforts.
Stores time-dependant events and executes them at the proper time.
Inserts vehicles into the network when their departure time is reached.
Container for junctions; performs operations on all stored junctions.
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
Interface for objects listening to vehicle state changes.
Definition: MSNet.h:620
virtual ~VehicleStateListener()
Destructor.
Definition: MSNet.h:626
virtual void vehicleStateChanged(const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")=0
Called if a vehicle changes its state.
VehicleStateListener()
Constructor.
Definition: MSNet.h:623
The simulated network and simulation perfomer.
Definition: MSNet.h:89
std::map< SumoXMLTag, NamedObjectCont< MSStoppingPlace * > > myStoppingPlaces
Dictionary of bus / container stops.
Definition: MSNet.h:868
static double getEffort(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the effort to pass an edge.
Definition: MSNet.cpp:140
bool warnOnce(const std::string &typeAndID)
return whether a warning regarding the given object shall be issued
Definition: MSNet.cpp:1355
std::map< int, SUMOAbstractRouter< MSEdge, SUMOVehicle > * > myRouterEffort
Definition: MSNet.h:890
MSIntermodalRouter & getIntermodalRouter(const int rngIndex, const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:1237
bool myLogExecutionTime
Information whether the simulation duration shall be logged.
Definition: MSNet.h:801
MSTransportableControl * myPersonControl
Controls person building and deletion;.
Definition: MSNet.h:770
void removeVehicleStateListener(VehicleStateListener *listener)
Removes a vehicle states listener.
Definition: MSNet.cpp:1062
SUMORouteLoaderControl * myRouteLoaders
Route loader for dynamic loading of routes.
Definition: MSNet.h:751
bool addStoppingPlace(const SumoXMLTag category, MSStoppingPlace *stop)
Adds a stopping place.
Definition: MSNet.cpp:1082
SUMOTime myStateDumpPeriod
The period for writing state.
Definition: MSNet.h:829
const std::string generateStatistics(SUMOTime start)
Writes performance output and running vehicle stats.
Definition: MSNet.cpp:416
void writeOverheadWireSegmentOutput() const
write the output generated by an overhead wire segment
Definition: MSNet.cpp:1155
void writeChargingStationOutput() const
write charging station output
Definition: MSNet.cpp:1132
std::pair< bool, NamedRTree > myLanesRTree
An RTree structure holding lane IDs.
Definition: MSNet.h:895
bool checkBidiEdges()
check wether bidirectional edges occur in the network
Definition: MSNet.cpp:1345
VehicleState
Definition of a vehicle state.
Definition: MSNet.h:587
@ VEHICLE_STATE_NEWROUTE
The vehicle got a new route.
Definition: MSNet.h:599
@ VEHICLE_STATE_ENDING_TELEPORT
The vehicle ended being teleported.
Definition: MSNet.h:595
@ VEHICLE_STATE_DEPARTED
The vehicle has departed (was inserted into the network)
Definition: MSNet.h:591
@ VEHICLE_STATE_STARTING_PARKING
The vehicles starts to park.
Definition: MSNet.h:601
@ VEHICLE_STATE_MANEUVERING
Vehicle maneuvering either entering or exiting a parking space.
Definition: MSNet.h:613
@ VEHICLE_STATE_ENDING_STOP
The vehicle ends to stop.
Definition: MSNet.h:607
@ VEHICLE_STATE_ARRIVED
The vehicle arrived at his destination (is deleted)
Definition: MSNet.h:597
@ VEHICLE_STATE_COLLISION
The vehicle is involved in a collision.
Definition: MSNet.h:609
@ VEHICLE_STATE_EMERGENCYSTOP
The vehicle had to brake harder than permitted.
Definition: MSNet.h:611
@ VEHICLE_STATE_STARTING_TELEPORT
The vehicle started to teleport.
Definition: MSNet.h:593
@ VEHICLE_STATE_STARTING_STOP
The vehicles starts to stop.
Definition: MSNet.h:605
@ VEHICLE_STATE_ENDING_PARKING
The vehicle ends to park.
Definition: MSNet.h:603
@ VEHICLE_STATE_BUILT
The vehicle was built, but has not yet departed.
Definition: MSNet.h:589
int myLogStepPeriod
Period between successive step-log outputs.
Definition: MSNet.h:806
SUMOTime myStep
Current time step.
Definition: MSNet.h:754
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:171
MSDetectorControl & getDetectorControl()
Returns the detector control.
Definition: MSNet.h:434
virtual bool isSelected(const MSTrafficLightLogic *) const
return wheter the given logic (or rather it's wrapper) is selected in the GUI
Definition: MSNet.h:579
bool myHasBidiEdges
Whether the network contains bidirectional rail edges.
Definition: MSNet.h:856
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Definition: MSNet.h:444
MSEventControl * myBeginOfTimestepEvents
Controls events executed at the begin of a time step;.
Definition: MSNet.h:784
bool addTractionSubstation(MSTractionSubstation *substation)
Adds a traction substation.
Definition: MSNet.cpp:1088
const MesoEdgeType & getMesoType(const std::string &typeID)
Returns edge type specific meso parameters if no type specific parameters have been loaded,...
Definition: MSNet.cpp:347
std::map< std::string, bool > myWarnedOnce
container to record warnings that shall only be issued once
Definition: MSNet.h:882
static void initStatic()
Place for static initializations of simulation components (called after successful net build)
Definition: MSNet.cpp:179
MSJunctionControl * myJunctions
Controls junctions, realizes right-of-way rules;.
Definition: MSNet.h:776
ShapeContainer * myShapeContainer
A container for geometrical shapes;.
Definition: MSNet.h:790
bool hasBidiEdges() const
return whether the network contains bidirectional rail edges
Definition: MSNet.h:710
double myVersion
the network version
Definition: MSNet.h:862
std::string myStateDumpSuffix
Definition: MSNet.h:832
MSDynamicShapeUpdater * getDynamicShapeUpdater()
Returns the dynamic shapes updater.
Definition: MSNet.h:501
bool checkElevation()
check all lanes for elevation data
Definition: MSNet.cpp:1320
bool myHavePermissions
Whether the network contains edges which not all vehicles may pass.
Definition: MSNet.h:838
bool existTractionSubstation(const std::string &substationId)
return whether given electrical substation exists in the network
Definition: MSNet.cpp:1188
bool myLogStepNumber
Information whether the number of the simulation step shall be logged.
Definition: MSNet.h:804
MSEventControl * myInsertionEvents
Controls insertion events;.
Definition: MSNet.h:788
virtual MSTransportableControl & getContainerControl()
Returns the container control.
Definition: MSNet.cpp:995
SimulationState
Possible states of a simulation - running or stopped with different reasons.
Definition: MSNet.h:94
@ SIMSTATE_TOO_MANY_TELEPORTS
The simulation had too many teleports.
Definition: MSNet.h:110
@ SIMSTATE_NO_FURTHER_VEHICLES
The simulation does not contain further vehicles.
Definition: MSNet.h:102
@ SIMSTATE_LOADING
The simulation is loading.
Definition: MSNet.h:96
@ SIMSTATE_ERROR_IN_SIM
An error occurred during the simulation step.
Definition: MSNet.h:106
@ SIMSTATE_CONNECTION_CLOSED
The connection to a client was closed by the client.
Definition: MSNet.h:104
@ SIMSTATE_INTERRUPTED
An external interrupt occured.
Definition: MSNet.h:108
@ SIMSTATE_RUNNING
The simulation is running.
Definition: MSNet.h:98
@ SIMSTATE_END_STEP_REACHED
The final simulation step has been performed.
Definition: MSNet.h:100
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:1199
std::map< int, MSPedestrianRouter * > myPedestrianRouter
Definition: MSNet.h:891
static const std::string STAGE_MOVEMENTS
Definition: MSNet.h:905
int myMaxTeleports
Maximum number of teleports.
Definition: MSNet.h:757
long mySimStepDuration
Definition: MSNet.h:809
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:371
PedestrianRouter< MSEdge, MSLane, MSJunction, MSVehicle > MSPedestrianRouter
Definition: MSNet.h:113
MSEventControl * myEndOfTimestepEvents
Controls events executed at the end of a time step;.
Definition: MSNet.h:786
static std::string getStateMessage(SimulationState state)
Returns the message to show if a certain state occurs.
Definition: MSNet.cpp:718
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:1107
bool myHasInternalLinks
Whether the network contains internal links/lanes/edges.
Definition: MSNet.h:847
void interrupt()
Definition: MSNet.h:722
double getNetworkVersion() const
return the network version
Definition: MSNet.h:715
SimulationState adaptToState(const SimulationState state) const
Called after a simulation step, this method adapts the current simulation state if necessary.
Definition: MSNet.cpp:697
void writeSubstationOutput() const
write electrical substation output
Definition: MSNet.cpp:1166
static const std::string STAGE_INSERTIONS
Definition: MSNet.h:907
long long int myPersonsMoved
Definition: MSNet.h:816
MSVehicleControl * myVehicleControl
Controls vehicle building and deletion;.
Definition: MSNet.h:768
std::map< std::string, MesoEdgeType > myMesoEdgeTypes
The edge type specific meso parameters.
Definition: MSNet.h:844
ShapeContainer & getShapeContainer()
Returns the shapes container.
Definition: MSNet.h:494
void addMesoType(const std::string &typeID, const MesoEdgeType &edgeType)
Adds edge type specific meso parameters.
Definition: MSNet.cpp:342
static void clearAll()
Clears all dictionaries.
Definition: MSNet.cpp:743
static void cleanupStatic()
Place for static initializations of simulation components (called after successful net build)
Definition: MSNet.cpp:186
void setPermissionsFound()
Labels the network to contain vehicle class permissions.
Definition: MSNet.h:213
MSJunctionControl & getJunctionControl()
Returns the junctions control.
Definition: MSNet.h:454
IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicle > MSIntermodalRouter
Definition: MSNet.h:114
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:313
MSEdgeControl * myEdges
Controls edges, performs vehicle movement;.
Definition: MSNet.h:774
std::unique_ptr< MSDynamicShapeUpdater > myDynamicShapeUpdater
Updater for dynamic shapes that are tracking traffic objects (ensures removal of shape dynamics when ...
Definition: MSNet.h:900
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:333
static bool hasInstance()
Returns whether the network was already constructed.
Definition: MSNet.h:154
void closeSimulation(SUMOTime start, const std::string &reason="")
Closes the simulation (all files, connections, etc.)
Definition: MSNet.cpp:505
MSEventControl * getEndOfTimestepEvents()
Returns the event control for events executed at the end of a time step.
Definition: MSNet.h:474
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
Definition: MSNet.cpp:1098
void simulationStep()
Performs a single simulation step.
Definition: MSNet.cpp:540
bool myHasElevation
Whether the network contains elevation data.
Definition: MSNet.h:850
static double getTravelTime(const MSEdge *const e, const SUMOVehicle *const v, double t)
Returns the travel time to pass an edge.
Definition: MSNet.cpp:154
MSTransportableControl * myContainerControl
Controls container building and deletion;.
Definition: MSNet.h:772
void writeOutput()
Write netstate, summary and detector output.
Definition: MSNet.cpp:805
void setCurrentTimeStep(const SUMOTime step)
Sets the current simulation step (used by state loading)
Definition: MSNet.h:321
bool myAmInterrupted
whether an interrupt occured
Definition: MSNet.h:760
void addVehicleStateListener(VehicleStateListener *listener)
Adds a vehicle states listener.
Definition: MSNet.cpp:1054
void preSimStepOutput() const
Prints the current step number.
Definition: MSNet.cpp:1018
MSEdgeControl & getEdgeControl()
Returns the edge control.
Definition: MSNet.h:414
std::vector< SUMOTime > myStateDumpTimes
Times at which a state shall be written.
Definition: MSNet.h:825
bool hasContainers() const
Returns whether containers are simulated.
Definition: MSNet.h:404
std::vector< MSTractionSubstation * > myTractionSubstations
Dictionary of traction substations.
Definition: MSNet.h:871
SUMOTime myEdgeDataEndTime
end of loaded edgeData
Definition: MSNet.h:865
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
Definition: MSNet.cpp:1009
std::map< std::string, std::map< SUMOVehicleClass, double > > myRestrictions
The vehicle class specific speed restrictions.
Definition: MSNet.h:841
std::vector< std::string > myStateDumpFiles
The names for the state files.
Definition: MSNet.h:827
void writeRailSignalBlocks() const
write rail signal block output
Definition: MSNet.cpp:1143
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:424
MSEventControl * getInsertionEvents()
Returns the event control for insertion events.
Definition: MSNet.h:484
MSTLLogicControl * myLogics
Controls tls logics, realizes waiting on tls rules;.
Definition: MSNet.h:778
bool logSimulationDuration() const
Returns whether duration shall be logged.
Definition: MSNet.cpp:980
bool hasPedestrianNetwork() const
return whether the network contains walkingareas and crossings
Definition: MSNet.h:705
long long int myVehiclesMoved
The overall number of vehicle movements.
Definition: MSNet.h:815
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:1071
bool isInterrupted() const
Definition: MSNet.h:726
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
Definition: MSNet.h:464
std::vector< VehicleStateListener * > myVehicleStateListeners
Container for vehicle state listener.
Definition: MSNet.h:874
SimulationState simulationState(SUMOTime stopTime) const
This method returns the current simulation state. It should not modify status.
Definition: MSNet.cpp:667
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, double version)
Closes the network's building process.
Definition: MSNet.cpp:243
bool hasPersons() const
Returns whether persons are simulated.
Definition: MSNet.h:388
long myTraCIStepDuration
The last simulation step duration.
Definition: MSNet.h:809
MSDetectorControl * myDetectorControl
Controls detectors;.
Definition: MSNet.h:782
static const std::string STAGE_LANECHANGE
Definition: MSNet.h:906
MSNet(const MSNet &)
Invalidated copy constructor.
MSNet(MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents, ShapeContainer *shapeCont=0)
Constructor.
Definition: MSNet.cpp:193
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
Definition: MSNet.cpp:327
bool hasPermissions() const
Returns whether the network has specific vehicle class permissions.
Definition: MSNet.h:207
std::map< int, SUMOAbstractRouter< MSEdge, SUMOVehicle > * > myRouterTT
Definition: MSNet.h:889
static void adaptIntermodalRouter(MSIntermodalRouter &router)
Definition: MSNet.cpp:1286
bool myLefthand
Whether the network was built for left-hand traffic.
Definition: MSNet.h:859
MSEdgeWeightsStorage * myEdgeWeights
The net's knowledge about edge efforts/travel times;.
Definition: MSNet.h:792
MSDynamicShapeUpdater * makeDynamicShapeUpdater()
Creates and returns a dynamic shapes updater.
Definition: MSNet.cpp:1003
MSNet & operator=(const MSNet &)
Invalidated assignment operator.
std::map< int, MSIntermodalRouter * > myIntermodalRouter
Definition: MSNet.h:892
virtual ~MSNet()
Destructor.
Definition: MSNet.cpp:275
MSPedestrianRouter & getPedestrianRouter(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:1227
MSTractionSubstation * findTractionSubstation(const std::string &substationId)
find electrical substation by its id
Definition: MSNet.cpp:1177
static MSNet * myInstance
Unique instance of MSNet.
Definition: MSNet.h:748
virtual void createTLWrapper(MSTrafficLightLogic *)
creates a wrapper for the given logic (see GUINet)
Definition: MSNet.h:570
MSInsertionControl * myInserter
Controls vehicle insertion;.
Definition: MSNet.h:780
void postSimStepOutput() const
Prints the statistics of the step at its end.
Definition: MSNet.cpp:1024
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:986
static const std::string STAGE_EVENTS
string constants for simstep stages
Definition: MSNet.h:904
void loadRoutes()
loads routes for the next few steps
Definition: MSNet.cpp:410
std::string myStateDumpPrefix
name components for periodic state
Definition: MSNet.h:831
void clearState(const SUMOTime step)
Resets events when quick-loading state.
Definition: MSNet.cpp:768
long mySimBeginMillis
The overall simulation duration.
Definition: MSNet.h:812
virtual bool isGUINet() const
Returns whether this is a GUI Net.
Definition: MSNet.h:140
bool myHasPedestrianNetwork
Whether the network contains pedestrian network elements.
Definition: MSNet.h:853
void writeStatistics() const
write statistic output to (xml) file
Definition: MSNet.cpp:475
bool hasInternalLinks() const
return whether the network contains internal links
Definition: MSNet.h:695
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterEffort(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
Definition: MSNet.cpp:1217
bool checkWalkingarea()
check all lanes for type walkingArea
Definition: MSNet.cpp:1334
bool hasElevation() const
return whether the network contains elevation data
Definition: MSNet.h:700
const NamedObjectCont< MSStoppingPlace * > & getStoppingPlaces(SumoXMLTag category) const
Definition: MSNet.cpp:1121
SimulationState simulate(SUMOTime start, SUMOTime stop)
Simulates from timestep start to stop.
Definition: MSNet.cpp:368
A lane area vehicles can halt at.
A class that stores and controls tls and switching of their programs.
The parent class for traffic light logics.
The class responsible for building and deletion of vehicles.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
A map of named object pointers.
A storage for options typed value containers)
Definition: OptionsCont.h:89
Representation of a vehicle.
Definition: SUMOVehicle.h:58
Storage for geometrical objects.
edge type specific meso parameters
Definition: MSNet.h:117
bool junctionControl
Definition: MSNet.h:123
double jamThreshold
Definition: MSNet.h:122
SUMOTime taufj
Definition: MSNet.h:119
SUMOTime tauff
Definition: MSNet.h:118
SUMOTime taujj
Definition: MSNet.h:121
double tlsPenalty
Definition: MSNet.h:124
SUMOTime minorPenalty
Definition: MSNet.h:126
double tlsFlowPenalty
Definition: MSNet.h:125
SUMOTime taujf
Definition: MSNet.h:120