SUMO - Simulation of Urban MObility
MSNet Class Reference

The simulated network and simulation perfomer. More...

#include <MSNet.h>

Inheritance diagram for MSNet:
Inheritance graph
Collaboration diagram for MSNet:
Collaboration graph

Data Structures

class  VehicleStateListener
 Interface for objects listening to vehicle state changes. More...
 

Public Types

typedef IntermodalRouter< MSEdge, MSLane, MSJunction, SUMOVehicleMSIntermodalRouter
 
typedef PedestrianRouter< MSEdge, MSLane, MSJunction, MSVehicleMSPedestrianRouter
 
enum  SimulationState {
  SIMSTATE_LOADING, SIMSTATE_RUNNING, SIMSTATE_END_STEP_REACHED, SIMSTATE_NO_FURTHER_VEHICLES,
  SIMSTATE_CONNECTION_CLOSED, SIMSTATE_ERROR_IN_SIM, SIMSTATE_INTERRUPTED, SIMSTATE_TOO_MANY_TELEPORTS
}
 Possible states of a simulation - running or stopped with different reasons. More...
 

Public Member Functions

void addRestriction (const std::string &id, const SUMOVehicleClass svc, const double speed)
 Adds a restriction for an edge type. More...
 
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. More...
 
void closeSimulation (SUMOTime start)
 Closes the simulation (all files, connections, etc.) More...
 
virtual void createTLWrapper (MSTrafficLightLogic *)
 creates a wrapper for the given logic (see GUINet) More...
 
const std::string generateStatistics (SUMOTime start)
 Writes performance output and running vehicle stats. More...
 
SUMOTime getCurrentTimeStep () const
 Returns the current simulation step. More...
 
MSIntermodalRoutergetIntermodalRouter (const int routingMode=0, const MSEdgeVector &prohibited=MSEdgeVector()) const
 
const NamedRTreegetLanesRTree () const
 Returns an RTree that contains lane IDs. More...
 
double getNetworkVersion () const
 return the network version More...
 
MSPedestrianRoutergetPedestrianRouter (const MSEdgeVector &prohibited=MSEdgeVector()) const
 
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. More...
 
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterEffort (const MSEdgeVector &prohibited=MSEdgeVector()) const
 
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT (const MSEdgeVector &prohibited=MSEdgeVector()) const
 
bool hasElevation () const
 return whether the network contains elevation data More...
 
bool hasInternalLinks () const
 return whether the network contains internal links More...
 
bool hasPermissions () const
 Returns whether the network has specific vehicle class permissions. More...
 
void interrupt ()
 
bool isInterrupted () const
 
bool lefthand () const
 return whether the network was built for lefthand traffic More...
 
void loadRoutes ()
 loads routes for the next few steps More...
 
bool logSimulationDuration () const
 Returns whether duration shall be logged. More...
 
 MSNet (MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents, ShapeContainer *shapeCont=0)
 Constructor. More...
 
void setCurrentTimeStep (const SUMOTime step)
 Sets the current simulation step (used by state loading) More...
 
void setPermissionsFound ()
 Labels the network to contain vehicle class permissions. More...
 
SimulationState simulate (SUMOTime start, SUMOTime stop)
 Simulates from timestep start to stop. More...
 
SimulationState simulationState (SUMOTime stopTime) const
 Called after a simulation step, this method returns the current simulation state. More...
 
void simulationStep ()
 Performs a single simulation step. More...
 
bool warnOnce (const std::string &typeAndID)
 return whether a warning regarding the given object shall be issued More...
 
void writeChargingStationOutput () const
 write charging station output More...
 
void writeOutput ()
 Write netstate, summary and detector output. More...
 
virtual ~MSNet ()
 Destructor. More...
 
Output during the simulation
void preSimStepOutput () const
 Prints the current step number. More...
 
void postSimStepOutput () const
 Prints the statistics of the step at its end. More...
 
Retrieval of references to substructures
MSVehicleControlgetVehicleControl ()
 Returns the vehicle control. More...
 
virtual MSTransportableControlgetPersonControl ()
 Returns the person control. More...
 
bool hasPersons () const
 Returns whether persons are simulated. More...
 
virtual MSTransportableControlgetContainerControl ()
 Returns the container control. More...
 
bool hasContainers () const
 Returns whether containers are simulated. More...
 
MSEdgeControlgetEdgeControl ()
 Returns the edge control. More...
 
MSInsertionControlgetInsertionControl ()
 Returns the insertion control. More...
 
MSDetectorControlgetDetectorControl ()
 Returns the detector control. More...
 
MSTLLogicControlgetTLSControl ()
 Returns the tls logics control. More...
 
MSJunctionControlgetJunctionControl ()
 Returns the junctions control. More...
 
MSEventControlgetBeginOfTimestepEvents ()
 Returns the event control for events executed at the begin of a time step. More...
 
MSEventControlgetEndOfTimestepEvents ()
 Returns the event control for events executed at the end of a time step. More...
 
MSEventControlgetInsertionEvents ()
 Returns the event control for insertion events. More...
 
ShapeContainergetShapeContainer ()
 Returns the shapes container. More...
 
MSEdgeWeightsStoragegetWeightsStorage ()
 Returns the net's internal edge travel times/efforts container. More...
 
Insertion and retrieval of stopping places
bool addStoppingPlace (const SumoXMLTag category, MSStoppingPlace *stop)
 Adds a stopping place. More...
 
MSStoppingPlacegetStoppingPlace (const std::string &id, const SumoXMLTag category) const
 Returns the named stopping place of the given category. More...
 
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. More...
 

Static Public Member Functions

static void adaptIntermodalRouter (MSIntermodalRouter &router)
 
static void clearAll ()
 Clears all dictionaries. More...
 
static double getEffort (const MSEdge *const e, const SUMOVehicle *const v, double t)
 Returns the effort to pass an edge. More...
 
static MSNetgetInstance ()
 Returns the pointer to the unique instance of MSNet (singleton). More...
 
static std::string getStateMessage (SimulationState state)
 Returns the message to show if a certain state occurs. More...
 
static double getTravelTime (const MSEdge *const e, const SUMOVehicle *const v, double t)
 Returns the travel time to pass an edge. More...
 
static bool hasInstance ()
 Returns whether the network was already constructed. More...
 

Protected Member Functions

bool checkElevation ()
 check all lanes for elevation data More...
 

Protected Attributes

bool myAmInterrupted
 whether an interrupt occured More...
 
bool myHasElevation
 Whether the network contains elevation data. More...
 
bool myHasInternalLinks
 Whether the network contains internal links/lanes/edges. More...
 
bool myHavePermissions
 Whether the network contains edges which not all vehicles may pass. More...
 
std::map< int, MSIntermodalRouter * > myIntermodalRouter
 
std::pair< bool, NamedRTreemyLanesRTree
 An RTree structure holding lane IDs. More...
 
bool myLefthand
 Whether the network was built for left-hand traffic. More...
 
int myMaxTeleports
 Maximum number of teleports. More...
 
MSPedestrianRoutermyPedestrianRouter
 
std::map< std::string, std::map< SUMOVehicleClass, double > > myRestrictions
 The vehicle class specific speed restrictions. More...
 
SUMORouteLoaderControlmyRouteLoaders
 Route loader for dynamic loading of routes. More...
 
SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouterEffort
 
SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouterTT
 
SUMOTime myStep
 Current time step. More...
 
std::map< SumoXMLTag, NamedObjectCont< MSStoppingPlace * > > myStoppingPlaces
 Dictionary of bus / container stops. More...
 
std::vector< VehicleStateListener * > myVehicleStateListeners
 Container for vehicle state listener. More...
 
double myVersion
 the network version More...
 
std::map< std::string, bool > myWarnedOnce
 container to record warnings that shall only be issued once More...
 
Substructures
MSVehicleControlmyVehicleControl
 Controls vehicle building and deletion;. More...
 
MSTransportableControlmyPersonControl
 Controls person building and deletion;. More...
 
MSTransportableControlmyContainerControl
 Controls container building and deletion;. More...
 
MSEdgeControlmyEdges
 Controls edges, performs vehicle movement;. More...
 
MSJunctionControlmyJunctions
 Controls junctions, realizes right-of-way rules;. More...
 
MSTLLogicControlmyLogics
 Controls tls logics, realizes waiting on tls rules;. More...
 
MSInsertionControlmyInserter
 Controls vehicle insertion;. More...
 
MSDetectorControlmyDetectorControl
 Controls detectors;. More...
 
MSEventControlmyBeginOfTimestepEvents
 Controls events executed at the begin of a time step;. More...
 
MSEventControlmyEndOfTimestepEvents
 Controls events executed at the end of a time step;. More...
 
MSEventControlmyInsertionEvents
 Controls insertion events;. More...
 
ShapeContainermyShapeContainer
 A container for geometrical shapes;. More...
 
MSEdgeWeightsStoragemyEdgeWeights
 The net's knowledge about edge efforts/travel times;. More...
 
data needed for computing performance values
bool myLogExecutionTime
 Information whether the simulation duration shall be logged. More...
 
bool myLogStepNumber
 Information whether the number of the simulation step shall be logged. More...
 
long myTraCIStepDuration
 The last simulation step duration. More...
 
long mySimStepDuration
 
long mySimBeginMillis
 The overall simulation duration. More...
 
long long int myVehiclesMoved
 The overall number of vehicle movements. More...
 
State output variables
std::vector< SUMOTimemyStateDumpTimes
 Times at which a state shall be written. More...
 
std::vector< std::string > myStateDumpFiles
 The names for the state files. More...
 
SUMOTime myStateDumpPeriod
 The period for writing state. More...
 
std::string myStateDumpPrefix
 name components for periodic state More...
 
std::string myStateDumpSuffix
 

Static Protected Attributes

static MSNetmyInstance = nullptr
 Unique instance of MSNet. More...
 
static const std::string STAGE_EVENTS
 string constants for simstep stages More...
 
static const std::string STAGE_INSERTIONS
 
static const std::string STAGE_LANECHANGE
 
static const std::string STAGE_MOVEMENTS
 

Private Member Functions

 MSNet (const MSNet &)
 Invalidated copy constructor. More...
 
MSNetoperator= (const MSNet &)
 Invalidated assignment operator. More...
 

Notification about vehicle state changes

enum  VehicleState {
  VEHICLE_STATE_BUILT, VEHICLE_STATE_DEPARTED, VEHICLE_STATE_STARTING_TELEPORT, VEHICLE_STATE_ENDING_TELEPORT,
  VEHICLE_STATE_ARRIVED, VEHICLE_STATE_NEWROUTE, VEHICLE_STATE_STARTING_PARKING, VEHICLE_STATE_ENDING_PARKING,
  VEHICLE_STATE_STARTING_STOP, VEHICLE_STATE_ENDING_STOP, VEHICLE_STATE_COLLISION, VEHICLE_STATE_EMERGENCYSTOP
}
 Definition of a vehicle state. More...
 
void addVehicleStateListener (VehicleStateListener *listener)
 Adds a vehicle states listener. More...
 
void removeVehicleStateListener (VehicleStateListener *listener)
 Removes a vehicle states listener. More...
 
void informVehicleStateListener (const SUMOVehicle *const vehicle, VehicleState to, const std::string &info="")
 Informs all added listeners about a vehicle's state change. More...
 

Detailed Description

The simulated network and simulation perfomer.

Definition at line 84 of file MSNet.h.

Member Typedef Documentation

◆ MSIntermodalRouter

◆ MSPedestrianRouter

Member Enumeration Documentation

◆ SimulationState

Possible states of a simulation - running or stopped with different reasons.

Enumerator
SIMSTATE_LOADING 

The simulation is loading.

SIMSTATE_RUNNING 

The simulation is running.

SIMSTATE_END_STEP_REACHED 

The final simulation step has been performed.

SIMSTATE_NO_FURTHER_VEHICLES 

The simulation does not contain further vehicles.

SIMSTATE_CONNECTION_CLOSED 

The connection to a client was closed by the client.

SIMSTATE_ERROR_IN_SIM 

An error occurred during the simulation step.

SIMSTATE_INTERRUPTED 

An external interrupt occured.

SIMSTATE_TOO_MANY_TELEPORTS 

The simulation had too many teleports.

Definition at line 89 of file MSNet.h.

◆ VehicleState

Definition of a vehicle state.

Enumerator
VEHICLE_STATE_BUILT 

The vehicle was built, but has not yet departed.

VEHICLE_STATE_DEPARTED 

The vehicle has departed (was inserted into the network)

VEHICLE_STATE_STARTING_TELEPORT 

The vehicle started to teleport.

VEHICLE_STATE_ENDING_TELEPORT 

The vehicle ended being teleported.

VEHICLE_STATE_ARRIVED 

The vehicle arrived at his destination (is deleted)

VEHICLE_STATE_NEWROUTE 

The vehicle got a new route.

VEHICLE_STATE_STARTING_PARKING 

The vehicles starts to park.

VEHICLE_STATE_ENDING_PARKING 

The vehicle ends to park.

VEHICLE_STATE_STARTING_STOP 

The vehicles starts to stop.

VEHICLE_STATE_ENDING_STOP 

The vehicle ends to stop.

VEHICLE_STATE_COLLISION 

The vehicle is involved in a collision.

VEHICLE_STATE_EMERGENCYSTOP 

The vehicle had to brake harder than permitted.

Definition at line 494 of file MSNet.h.

Constructor & Destructor Documentation

◆ MSNet() [1/2]

MSNet::MSNet ( MSVehicleControl vc,
MSEventControl beginOfTimestepEvents,
MSEventControl endOfTimestepEvents,
MSEventControl insertionEvents,
ShapeContainer shapeCont = 0 
)

Constructor.

This constructor builds a net of which only some basic structures are initialised. It prepares the network for being filled while loading. As soon as all edge/junction/traffic lights and other containers are build, they must be initialised using "closeBuilding".

Parameters
[in]vcThe vehicle control to use
[in]beginOfTimestepEventsThe event control to use for simulation step begin events
[in]endOfTimestepEventsThe event control to use for simulation step end events
[in]insertionEventsThe event control to use for insertion events
[in]shapeContThe shape container to use
Exceptions
ProcessErrorIf a network was already constructed
See also
closeBuilding

Definition at line 173 of file MSNet.cpp.

References OptionsCont::getBool(), OptionsCont::getInt(), OptionsCont::getOptions(), OptionsCont::getString(), MSGlobals::gMesoNet, MSGlobals::gUseMesoSim, myBeginOfTimestepEvents, myContainerControl, myDetectorControl, myEdges, myEdgeWeights, myEndOfTimestepEvents, myInserter, myInsertionEvents, myInstance, myJunctions, myLanesRTree, myLogExecutionTime, myLogics, myLogStepNumber, myMaxTeleports, myPersonControl, myRouteLoaders, myShapeContainer, myStep, myVehicleControl, and string2time().

Referenced by hasInstance().

◆ ~MSNet()

◆ MSNet() [2/2]

MSNet::MSNet ( const MSNet )
private

Invalidated copy constructor.

Member Function Documentation

◆ adaptIntermodalRouter()

◆ addRestriction()

void MSNet::addRestriction ( const std::string &  id,
const SUMOVehicleClass  svc,
const double  speed 
)

Adds a restriction for an edge type.

Parameters
[in]idThe id of the type
[in]svcThe vehicle class the restriction refers to
[in]speedThe restricted speed

Definition at line 296 of file MSNet.cpp.

References myRestrictions.

Referenced by NLHandler::myStartElement(), and setPermissionsFound().

◆ addStoppingPlace()

bool MSNet::addStoppingPlace ( const SumoXMLTag  category,
MSStoppingPlace stop 
)

Adds a stopping place.

If another stop with the same id and category exists, false is returned. Otherwise, the stop is added to the internal stopping place container.

This control gets responsible for deletion of the added stop.

Parameters
[in]stopThe stop to add
Returns
Whether the stop could be added

Definition at line 863 of file MSNet.cpp.

References Named::getID(), myStoppingPlaces, SUMO_TAG_BUS_STOP, and SUMO_TAG_TRAIN_STOP.

Referenced by GUITriggerBuilder::beginParkingArea(), NLTriggerBuilder::beginParkingArea(), GUITriggerBuilder::buildChargingStation(), NLTriggerBuilder::buildChargingStation(), GUITriggerBuilder::buildStoppingPlace(), NLTriggerBuilder::buildStoppingPlace(), and getShapeContainer().

◆ addVehicleStateListener()

void MSNet::addVehicleStateListener ( VehicleStateListener listener)

Adds a vehicle states listener.

Parameters
[in]listenerThe listener to add

Definition at line 838 of file MSNet.cpp.

References myVehicleStateListeners.

Referenced by MSDevice_Vehroutes::init(), TraCIServer::openSocket(), libsumo::Helper::registerVehicleStateListener(), and MSNet::VehicleStateListener::~VehicleStateListener().

◆ checkElevation()

bool MSNet::checkElevation ( )
protected

check all lanes for elevation data

Definition at line 1000 of file MSNet.cpp.

References MSEdgeControl::getEdges(), and myEdges.

Referenced by closeBuilding(), and isInterrupted().

◆ clearAll()

◆ closeBuilding()

void MSNet::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.

Assigns the structures built while loading to this network.

Parameters
[in]ocThe options to use
[in]edgesThe control of edges which belong to this network
[in]junctionsThe control of junctions which belong to this network
[in]routeLoadersThe route loaders used
[in]tlcThe control of traffic lights which belong to this network
[in]stateDumpTimesList of time steps at which state shall be written
[in]stateDumpFilesFilenames for states
[in]hasInternalLinksWhether the network actually contains internal links
[in]lefthandWhether the network was built for left-hand traffic
[in]versionThe network version
Todo:
Try to move all this to the constructor?

Definition at line 219 of file MSNet.cpp.

References checkElevation(), SysUtils::getCurrentMillis(), OptionsCont::getString(), MSGlobals::gLateralResolution, hasInternalLinks(), lefthand(), myEdges, myHasElevation, myHasInternalLinks, myJunctions, myLefthand, myLogics, myRouteLoaders, mySimBeginMillis, myStateDumpFiles, myStateDumpPeriod, myStateDumpPrefix, myStateDumpSuffix, myStateDumpTimes, myVersion, MSJunctionControl::postloadInitContainer(), string2time(), and WRITE_WARNING.

Referenced by NLBuilder::buildNet(), and hasInstance().

◆ closeSimulation()

void MSNet::closeSimulation ( SUMOTime  start)

Closes the simulation (all files, connections, etc.)

Writes also performance output

Parameters
[in]startThe step the simulation was started with

Definition at line 423 of file MSNet.cpp.

References MSDetectorControl::close(), MSDevice_Tripinfo::generateOutputForUnfinished(), MSDevice_Vehroutes::generateOutputForUnfinished(), generateStatistics(), OptionsCont::getOptions(), myDetectorControl, myLogExecutionTime, myStep, WRITE_MESSAGE, and writeChargingStationOutput().

Referenced by libsumo::Simulation::close(), GUIRunThread::deleteSim(), setPermissionsFound(), and simulate().

◆ createTLWrapper()

virtual void MSNet::createTLWrapper ( MSTrafficLightLogic )
inlinevirtual

creates a wrapper for the given logic (see GUINet)

Reimplemented in GUINet.

Definition at line 488 of file MSNet.h.

Referenced by MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline().

◆ generateStatistics()

◆ getBeginOfTimestepEvents()

◆ getContainerControl()

◆ getCurrentTimeStep()

SUMOTime MSNet::getCurrentTimeStep ( ) const
inline

Returns the current simulation step.

Returns
the current simulation step

Definition at line 263 of file MSNet.h.

References myStep.

Referenced by MSCFModel_ACC::_v(), MSCFModel_CACC::_v(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), libsumo::Person::add(), libsumo::Vehicle::add(), MSBaseVehicle::addContainer(), MSBaseVehicle::addPerson(), GUIEdge::addRerouter(), MSDevice_Vehroutes::addRoute(), MSTLLogicControl::addWAUTJunction(), MSTransportableControl::boardAnyWaiting(), NLDetectorBuilder::buildE2Detector(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSTLLogicControl::closeWAUT(), TraCIServerAPI_Simulation::commandDistanceRequest(), MSDevice_Tripinfo::computeLengthAndDuration(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), TraCIServer::dispatchCommand(), MSActuatedTrafficLightLogic::duration(), MSVehicle::enterLaneAtInsertion(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSVehicle::executeMove(), libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), MSActuatedTrafficLightLogic::gapControl(), MSDevice_Tripinfo::generateOutputForUnfinished(), MSTransportable::getAngle(), MSLane::getCriticalLeader(), MSInductLoop::getCurrentOccupancy(), MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), GUIApplicationWindow::getCurrentSimTime(), MSLaneSpeedTrigger::getCurrentSpeed(), libsumo::Simulation::getCurrentTime(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), libsumo::Simulation::getDistance2D(), libsumo::Simulation::getDistanceRoad(), MSTransportable::getEdgePos(), MSLane::getFirstVehicleInformation(), MSLane::getLastVehicleInformation(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), libsumo::Lane::getLinks(), MESegment::getMeanSpeed(), MSInsertionControl::getPendingEmits(), MSTransportable::getPosition(), MSVehicle::getPosition(), MSTrafficLightLogic::getSpentDuration(), MSTransportable::getWaitingSeconds(), MSLink::getZipperSpeed(), GUIApplicationWindow::handleEvent_SimulationStep(), MSSwarmTrafficLightLogic::init(), MSLaneSpeedTrigger::init(), MSRoutingEngine::initEdgeWeights(), TraCIServer::initialiseSubscription(), MSTLLogicControl::initWautSwitch(), MSLane::isInsertionSuccess(), MSPerson::Influencer::isRemoteControlled(), MSVehicle::Influencer::isRemoteControlled(), MSTransportableControl::loadAnyWaiting(), GUIRunThread::makeStep(), MSPModel_Remote::MSPModel_Remote(), MSPModel_Striping::MSPModel_Striping(), MSDevice_Vehroutes::notifyEnter(), MSDevice_Routing::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Transportable::notifyMove(), GUIApplicationWindow::onCmdSaveState(), GUIApplicationWindow::onCmdTimeToggle(), MSBaseVehicle::onDepart(), TraCIServer::postProcessSimulationStep(), MESegment::prepareDetectorForWriting(), MSVehicle::processLaneAdvances(), MSVehicle::processNextStop(), MSTriggeredRerouter::rerouteParkingArea(), MSVehicle::resetActionOffset(), MSSOTLTrafficLightLogic::resetCTS(), MSTrafficLightLogic::resetLinkStates(), GUIRunThread::run(), TraCIServer::sendOutputToAll(), libsumo::TrafficLight::setPhase(), libsumo::TrafficLight::setPhaseDuration(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSPhasedTrafficLightLogic::setStep(), MSSOTLTrafficLightLogic::setupCTS(), simulate(), MSSimpleTrafficLightLogic::trySwitch(), MSDelayBasedTrafficLightLogic::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::trySwitch(), MSVehicle::updateActionOffset(), MSSOTLTrafficLightLogic::updateCTS(), MSRailCrossing::updateCurrentPhase(), MSSwarmTrafficLightLogic::updateSensitivities(), and MSVehicle::wasRemoteControlled().

◆ getDetectorControl()

◆ getEdgeControl()

◆ getEffort()

double MSNet::getEffort ( const MSEdge *const  e,
const SUMOVehicle *const  v,
double  t 
)
static

Returns the effort to pass an edge.

Parameters
[in]eThe edge for which the effort to be passed shall be returned
[in]vThe vehicle that is rerouted
[in]tThe time for which the effort shall be returned [s]
Returns
The effort (abstract) for an edge
See also
DijkstraRouter_ByProxi

Definition at line 134 of file MSNet.cpp.

References getInstance(), MSVehicle::getWeightsStorage(), getWeightsStorage(), and MSEdgeWeightsStorage::retrieveExistingEffort().

Referenced by getRouterEffort(), and MSNet::VehicleStateListener::~VehicleStateListener().

◆ getEndOfTimestepEvents()

MSEventControl* MSNet::getEndOfTimestepEvents ( )
inline

Returns the event control for events executed at the end of a time step.

Returns
The control responsible for events that are executed at the end of a time step
See also
MSEventControl
myEndOfTimestepEvents

Definition at line 419 of file MSNet.h.

References myEndOfTimestepEvents.

Referenced by MSDevice_BTreceiver::BTreceiverUpdate::BTreceiverUpdate(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), MSCalibrator::init(), MSRoutingEngine::initWeightUpdate(), and MSVTypeProbe::MSVTypeProbe().

◆ getInsertionControl()

◆ getInsertionEvents()

MSEventControl* MSNet::getInsertionEvents ( )
inline

Returns the event control for insertion events.

Returns
The control responsible for insertion events
See also
MSEventControl
myInsertionEvents

Definition at line 429 of file MSNet.h.

References myInsertionEvents.

Referenced by MSDevice_Routing::MSDevice_Routing(), MSPersonDevice_Routing::MSPersonDevice_Routing(), and MSPersonDevice_Routing::setParameter().

◆ getInstance()

MSNet * MSNet::getInstance ( void  )
static

Returns the pointer to the unique instance of MSNet (singleton).

Returns
Pointer to the unique MSNet-instance
Exceptions
ProcessErrorIf a network was not yet constructed

Definition at line 165 of file MSNet.cpp.

References myInstance.

Referenced by MSCFModel_ACC::_v(), MSCFModel_CACC::_v(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSTransportable::Stage_Waiting::abort(), MSTransportableControl::abortWaitingForVehicle(), MSRoutingEngine::adaptEdgeEfforts(), libsumo::Edge::adaptTraveltime(), libsumo::Polygon::add(), LaneStoringVisitor::add(), MSPModel_Striping::add(), libsumo::POI::add(), libsumo::Person::add(), MSVehicleTransfer::add(), libsumo::Vehicle::add(), MSChargingStation::addChargeValueForOutput(), MSBaseVehicle::addContainer(), MSTrafficLightLogic::addLink(), MSTLLogicControl::TLSLogicVariants::addLogic(), MSBaseVehicle::addPerson(), MSRouteHandler::addPersonTrip(), GUIEdge::addRerouter(), MSDevice_Vehroutes::addRoute(), MSRouteHandler::addStop(), MSVehicle::addStop(), MSVehicle::addTraciStopAtStoppingPlace(), MSTLLogicControl::addWAUTJunction(), libsumo::Person::appendDrivingStage(), libsumo::Person::appendWaitingStage(), libsumo::Person::appendWalkingStage(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSTransportableControl::boardAnyWaiting(), MSDevice_BTreceiver::BTreceiverUpdate::BTreceiverUpdate(), MSSOTLE2Sensors::buildContinueSensior(), MSSOTLE2Sensors::buildCountSensorForLane(), MSSOTLE2Sensors::buildCountSensorForOutLane(), MSSOTLE2Sensors::buildSensorForLane(), MSSOTLE2Sensors::buildSensorForOutLane(), NLTriggerBuilder::buildVaporizer(), MEVehicleControl::buildVehicle(), GUIMEVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), MSVehicleControl::buildVehicle(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), libsumo::Vehicle::changeLane(), libsumo::Vehicle::changeLaneRelative(), MSLaneChanger::changeOpposite(), MELoop::changeSegment(), MSPhasedTrafficLightLogic::changeStepAndDuration(), MSSimpleTrafficLightLogic::changeStepAndDuration(), libsumo::Vehicle::changeTarget(), MSLane::checkFailure(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), libsumo::Simulation::clearPending(), libsumo::Simulation::close(), MSRouteHandler::closeContainer(), MSRouteHandler::closeFlow(), MSRouteHandler::closePerson(), MSRouteHandler::closeRoute(), MSStateHandler::closeVehicle(), MSRouteHandler::closeVehicle(), MSRouteHandler::closeVehicleTypeDistribution(), MSTLLogicControl::closeWAUT(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), TraCIServerAPI_Simulation::commandDistanceRequest(), MSDevice_Tripinfo::computeLengthAndDuration(), libsumo::Helper::convertCartesianToRoadMap(), NLDetectorBuilder::createEdgeLaneMeanData(), MSCalibrator::currentFlow(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), MSInsertionControl::determineCandidates(), TraCIServer::dispatchCommand(), GUITrafficLightLogicWrapper::drawGL(), GUIContainerStop::drawGL(), GUIBusStop::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawGL(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawMarkings(), GUILane::drawTLSLinkNo(), MSVehicleType::duplicateType(), MSActuatedTrafficLightLogic::duration(), GUITriggerBuilder::endParkingArea(), GUITriggerBuilder::endStoppingPlace(), MSVehicle::enterLaneAtInsertion(), MSDevice::equippedByDefaultAssignmentOptions(), METriggeredCalibrator::execute(), MSCalibrator::execute(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSVTypeProbe::execute(), MSPerson::MSPersonStage_Access::ProceedCmd::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), MSActuatedTrafficLightLogic::gapControl(), MSDevice_Tripinfo::generateOutputForUnfinished(), libsumo::Edge::getAdaptedTraveltime(), MSTransportable::Stage_Waiting::getAngle(), MSTransportable::Stage_Driving::getAngle(), MSTransportable::getAngle(), MSVehicle::getBackPositionOnLane(), libsumo::Simulation::getBusStopWaiting(), GUIEdge::getColorValue(), GUILane::getColorValue(), MSLane::getCriticalLeader(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), MSLaneSpeedTrigger::getCurrentSpeed(), MSInductLoop::getCurrentSpeed(), libsumo::Simulation::getCurrentTime(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), MSInductLoop::getCurrentVehicleIDs(), libsumo::MultiEntryExit::getDetector(), libsumo::LaneArea::getDetector(), libsumo::InductionLoop::getDetector(), libsumo::Simulation::getDistance2D(), libsumo::Simulation::getDistanceRoad(), MSTransportable::getEdgePos(), libsumo::Edge::getEffort(), getEffort(), MSLane::getFirstVehicleInformation(), GUINet::getGUIInstance(), libsumo::LaneArea::getIDCount(), libsumo::MultiEntryExit::getIDCount(), libsumo::Person::getIDCount(), libsumo::InductionLoop::getIDCount(), libsumo::LaneArea::getIDList(), libsumo::Polygon::getIDList(), libsumo::MultiEntryExit::getIDList(), libsumo::Person::getIDList(), libsumo::InductionLoop::getIDList(), libsumo::POI::getIDList(), libsumo::Junction::getIDList(), libsumo::TrafficLight::getIDList(), libsumo::Vehicle::getIDList(), libsumo::VehicleType::getIDList(), libsumo::Junction::getJunction(), libsumo::Edge::getLastStepPersonIDs(), MSLane::getLastVehicleInformation(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), libsumo::Lane::getLinks(), GUILane::getLoadedEdgeWeight(), MSLane::getMaximumBrakeDist(), MESegment::getMeanSpeed(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), libsumo::Simulation::getMinExpectedNumber(), MSPModel::getModel(), MSCModel_NonInteracting::getModel(), MSPModel_Striping::getNextLane(), libsumo::Simulation::getParameter(), MSInsertionControl::getPendingEmits(), GUILane::getPendingEmits(), libsumo::Person::getPerson(), MSTLLogicControl::getPhaseDef(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), libsumo::POI::getPoI(), libsumo::Polygon::getPolygon(), MSPModel_NonInteracting::PState::getPosition(), MSTransportable::Stage_Waiting::getPosition(), MSTransportable::Stage_Driving::getPosition(), MSTransportable::getPosition(), MSVehicle::getPosition(), MSVTKExport::getPositions(), MSVehicle::Influencer::getRouterTT(), GUIEdge::getScaleValue(), GUILane::getScaleValue(), MSBaseVehicle::getSingularType(), MSVTKExport::getSpeed(), MSTrafficLightLogic::getSpentDuration(), GUILane::getStoredEdgeTravelTime(), MSEdge::getSuccessors(), libsumo::TrafficLight::getTLS(), getTravelTime(), MSEdge::getTravelTimeStatic(), libsumo::Junction::getTree(), libsumo::InductionLoop::getTree(), libsumo::Polygon::getTree(), libsumo::POI::getTree(), libsumo::Vehicle::getVehicle(), libsumo::InductionLoop::getVehicleData(), MSEdge::getViaSuccessors(), libsumo::VehicleType::getVType(), MSTransportable::getWaitingSeconds(), MSLink::getZipperSpeed(), GUIBusStop::GUIBusStop(), GUIContainerStop::GUIContainerStop(), GUIParkingArea::GUIParkingArea(), MSLane::handleCollisionBetween(), MSPModel_Striping::PState::ignoreRed(), MSVehicle::ignoreRed(), MSLane::incorporateVehicle(), MSVehicle::influenceChangeDecision(), MSRailCrossing::init(), MSDevice_Vehroutes::init(), MSRailSignal::init(), MSDelayBasedTrafficLightLogic::init(), MSActuatedTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), MSLaneSpeedTrigger::init(), MSCalibrator::init(), MSMeanData::init(), MSDevice_ToC::initColorScheme(), MSRoutingEngine::initEdgeWeights(), TraCIServer::initialiseSubscription(), MSLane::initRestrictions(), MSTLLogicControl::initWautSwitch(), MSRoutingEngine::initWeightUpdate(), MSEdge::insertVehicle(), MSLane::isInsertionSuccess(), libsumo::Vehicle::isOnInit(), MSPerson::Influencer::isRemoteControlled(), MSVehicle::Influencer::isRemoteControlled(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSAbstractLaneChangeModel::laneChangeOutput(), MSVehicle::leaveLane(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), MSTransportableControl::loadAnyWaiting(), MSVehicleTransfer::loadState(), libsumo::Vehicle::moveTo(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), MSContainer::MSContainerStage_Tranship::moveToNextEdge(), libsumo::Person::moveToXY(), libsumo::Vehicle::moveToXY(), MSDevice_DriverState::MSDevice_DriverState(), MSDevice_Routing::MSDevice_Routing(), MSDevice_ToC::MSDevice_ToC(), MSParkingArea::MSParkingArea(), MSPersonDevice_Routing::MSPersonDevice_Routing(), MSTrafficLightLogic::MSTrafficLightLogic(), MSVTypeProbe::MSVTypeProbe(), GUITriggeredRerouter::myEndElement(), MSRouteHandler::myEndElement(), MSTriggeredRerouter::myEndElement(), MSStateHandler::myStartElement(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), MSTriggeredRerouter::myStartElement(), MSDevice_Transportable::notifyEnter(), MSDevice_Vehroutes::notifyEnter(), MSDevice_Routing::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Transportable::notifyMove(), MSDevice_Battery::notifyMove(), MSDevice_Bluelight::notifyMove(), MSE3Collector::MSE3EntryReminder::notifyMove(), GUISUMOViewParent::onCmdLocate(), GUIApplicationWindow::onCmdSaveState(), MSBaseVehicle::onDepart(), GUIViewTraffic::onGamingClick(), TraCIServer::openSocket(), MSRouteHandler::openVehicleTypeDistribution(), MSRouteHandler::parseWalkPositions(), MSVehicle::planMoveInternal(), libsumo::Helper::postProcessRemoteControl(), MSPerson::Influencer::postProcessRemoteControl(), TraCIServer::postProcessSimulationStep(), MESegment::prepareDetectorForWriting(), MSPerson::MSPersonStage_Walking::proceed(), TraCIServer::processCommandsUntilSimStep(), MSDevice_SSM::processEncounters(), TraCIServerAPI_TrafficLight::processGet(), MSVehicle::processLaneAdvances(), MSVehicle::processNextStop(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_Person::processSet(), MEVehicle::processStop(), MSVehicle::processTraCISpeedControl(), MSPModel_Striping::PState::PState(), MESegment::receive(), libsumo::Helper::registerVehicleStateListener(), METriggeredCalibrator::remainingVehicleCapacity(), MSCalibrator::remainingVehicleCapacity(), libsumo::Polygon::remove(), libsumo::POI::remove(), libsumo::Vehicle::remove(), MSCalibrator::removePending(), MSTransportable::removeStage(), MSVehicle::replaceRoute(), MEVehicle::replaceRoute(), MSBaseVehicle::replaceVehicleType(), MSTransportable::replaceVehicleType(), MSDevice_ToC::requestToC(), MSRoutingEngine::reroute(), MSBaseVehicle::reroute(), libsumo::Vehicle::rerouteEffort(), MSTriggeredRerouter::rerouteParkingArea(), MSVehicle::rerouteParkingArea(), libsumo::Person::rerouteTraveltime(), libsumo::Vehicle::rerouteTraveltime(), MSVehicle::resetActionOffset(), MSSOTLTrafficLightLogic::resetCTS(), MSTrafficLightLogic::resetLinkStates(), MSVehicle::resumeFromStopping(), MSContainer::routeOutput(), MSPerson::routeOutput(), MSStateHandler::saveRNGs(), MSStateHandler::saveState(), libsumo::Simulation::saveState(), MSVehicleControl::scheduleVehicleRemoval(), TraCIServer::sendOutputToAll(), MSVehicleType::setActionStepLength(), MSTransportable::Stage_Trip::setArrived(), MSVehicle::setBlinkerInformation(), libsumo::TrafficLight::setCompleteRedYellowGreenDefinition(), libsumo::Edge::setEffort(), GUIBaseVehicle::setFunctionalColor(), MSLaneSpeedTrigger::setOverriding(), MSLaneSpeedTrigger::setOverridingValue(), MSPersonDevice_Routing::setParameter(), MSDevice_ToC::setParameter(), MSTriggeredRerouter::setPermissions(), libsumo::TrafficLight::setPhase(), libsumo::TrafficLight::setPhaseDuration(), libsumo::POI::setPosition(), libsumo::TrafficLight::setProgram(), libsumo::TrafficLight::setRedYellowGreenState(), libsumo::Polygon::setShape(), libsumo::Vehicle::setSpeed(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSPhasedTrafficLightLogic::setStep(), libsumo::Person::setType(), libsumo::Vehicle::setType(), MSSOTLTrafficLightLogic::setupCTS(), signalHandler(), libsumo::Vehicle::slowDown(), libsumo::Simulation::step(), MSStopOut::stopEnded(), MSStopOut::stopStarted(), MSLane::succLinkSec(), MSDevice_ToC::switchHolderType(), MSTLLogicControl::TLSLogicVariants::switchTo(), MELoop::teleportVehicle(), MSDevice_ToC::triggerDownwardToC(), MSDevice_ToC::triggerMRM(), METriggeredCalibrator::tryEmit(), MSInsertionControl::tryInsert(), MSSimpleTrafficLightLogic::trySwitch(), MSDelayBasedTrafficLightLogic::trySwitch(), MSRailCrossing::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSRailSignal::trySwitch(), MSSOTLTrafficLightLogic::trySwitch(), MSVehicle::updateActionOffset(), MSSOTLTrafficLightLogic::updateCTS(), MSRailCrossing::updateCurrentPhase(), MSSOTLTrafficLightLogic::updateDecayThreshold(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSAbstractLaneChangeModel::updateShadowLane(), MSVehicle::updateState(), MSPModel_Remote::usingInternalLanes(), MSPModel_Striping::usingInternalLanesStatic(), MSDetectorFileOutput::vehicleApplies(), MSTriggeredRerouter::vehicleApplies(), MSVehicleControl::vehicleDeparted(), MSPModel_Striping::PState::walk(), MSVehicle::wasRemoteControlled(), MSBatteryExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSAmitranTrajectories::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSQueueExport::writeEdge(), MSFullExport::writeEdge(), MSDevice_Vehroutes::writeOutput(), writeOutput(), MSFullExport::writeTLS(), MSFullExport::writeVehicles(), MSDevice_BTreceiver::BTreceiverUpdate::~BTreceiverUpdate(), MSTransportable::~MSTransportable(), and MSVehicle::~MSVehicle().

◆ getIntermodalRouter()

◆ getJunctionControl()

MSJunctionControl& MSNet::getJunctionControl ( )
inline

Returns the junctions control.

Returns
The junctions control
See also
MSJunctionControl
myJunctions

Definition at line 399 of file MSNet.h.

References myJunctions.

Referenced by libsumo::Junction::getIDList(), and libsumo::Junction::getJunction().

◆ getLanesRTree()

const NamedRTree & MSNet::getLanesRTree ( ) const

Returns an RTree that contains lane IDs.

Returns
An Rtree containing lane IDs

Definition at line 990 of file MSNet.cpp.

References MSLane::fill(), and myLanesRTree.

Referenced by MSNet::VehicleStateListener::~VehicleStateListener().

◆ getNetworkVersion()

double MSNet::getNetworkVersion ( ) const
inline

return the network version

Definition at line 620 of file MSNet.h.

References myVersion, and warnOnce().

◆ getPedestrianRouter()

◆ getPersonControl()

◆ getRestrictions()

const std::map< SUMOVehicleClass, double > * MSNet::getRestrictions ( const std::string &  id) const

Returns the restrictions for an edge type If no restrictions are present, 0 is returned.

Parameters
[in]idThe id of the type
Returns
The mapping of vehicle classes to maximum speeds

Definition at line 302 of file MSNet.cpp.

References myRestrictions.

Referenced by MSLane::initRestrictions(), and setPermissionsFound().

◆ getRouterEffort()

SUMOAbstractRouter< MSEdge, SUMOVehicle > & MSNet::getRouterEffort ( const MSEdgeVector prohibited = MSEdgeVector()) const

◆ getRouterTT()

◆ getShapeContainer()

◆ getStateMessage()

std::string MSNet::getStateMessage ( MSNet::SimulationState  state)
static

◆ getStoppingPlace()

◆ getStoppingPlaceID()

std::string MSNet::getStoppingPlaceID ( const MSLane lane,
const double  pos,
const SumoXMLTag  category 
) const

Returns the stop of the given category close to the given position.

Parameters
[in]lanethe lane of the stop to return.
[in]posthe position of the stop to return.
[in]categoryThe type of stop
Returns
The stop id on the location, or "" if no such stop exists

Definition at line 878 of file MSNet.cpp.

References MSStoppingPlace::getBeginLanePosition(), MSStoppingPlace::getEndLanePosition(), Named::getID(), MSStoppingPlace::getLane(), myStoppingPlaces, and POSITION_EPS.

Referenced by getShapeContainer(), and MSDevice_Battery::notifyMove().

◆ getTLSControl()

◆ getTravelTime()

double MSNet::getTravelTime ( const MSEdge *const  e,
const SUMOVehicle *const  v,
double  t 
)
static

Returns the travel time to pass an edge.

Parameters
[in]eThe edge for which the travel time to be passed shall be returned
[in]vThe vehicle that is rerouted
[in]tThe time for which the travel time shall be returned [s]
Returns
The travel time for an edge
See also
DijkstraRouter_ByProxi

Definition at line 148 of file MSNet.cpp.

References getInstance(), MSEdge::getMinimumTravelTime(), MSVehicle::getWeightsStorage(), getWeightsStorage(), and MSEdgeWeightsStorage::retrieveExistingTravelTime().

Referenced by getRouterEffort(), getRouterTT(), MSEdge::getTravelTimeStatic(), MSRoutingEngine::initEdgeWeights(), MSRoutingEngine::reroute(), and MSNet::VehicleStateListener::~VehicleStateListener().

◆ getVehicleControl()

MSVehicleControl& MSNet::getVehicleControl ( )
inline

Returns the vehicle control.

Returns
The vehicle control
See also
MSVehicleControl
myVehicleControl

Definition at line 316 of file MSNet.h.

References getPersonControl(), and myVehicleControl.

Referenced by adaptIntermodalRouter(), libsumo::Person::add(), MSVehicleTransfer::add(), libsumo::Vehicle::add(), MSRouteHandler::addPersonTrip(), MELoop::changeSegment(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), MSRouteHandler::closeContainer(), MSRouteHandler::closePerson(), MSStateHandler::closeVehicle(), MSRouteHandler::closeVehicle(), MSLane::detectCollisions(), MSLane::detectPedestrianJunctionCollision(), MSInsertionControl::determineCandidates(), MSDevice::equippedByDefaultAssignmentOptions(), METriggeredCalibrator::execute(), MSCalibrator::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), libsumo::Simulation::findIntermodalRoute(), libsumo::Simulation::findRoute(), libsumo::Vehicle::getIDList(), libsumo::VehicleType::getIDList(), MSLane::getMaximumBrakeDist(), libsumo::Simulation::getMinExpectedNumber(), GUINet::getParameterWindow(), MSVTKExport::getPositions(), MSVTKExport::getSpeed(), libsumo::Vehicle::getVehicle(), libsumo::VehicleType::getVType(), MSLane::handleCollisionBetween(), GUIApplicationWindow::handleEvent_SimulationStep(), MSDevice_ToC::initColorScheme(), libsumo::Vehicle::isOnInit(), libsumo::Vehicle::moveTo(), MSDevice_ToC::MSDevice_ToC(), MSStateHandler::myStartElement(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), MSDevice_Bluelight::notifyMove(), GUIApplicationWindow::onCmdDemandScale(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), MSRouteHandler::openVehicleTypeDistribution(), MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSDevice_SSM::processEncounters(), MSVehicle::processNextStop(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_Vehicle::processSet(), MEVehicle::processStop(), MESegment::receive(), METriggeredCalibrator::remainingVehicleCapacity(), MSCalibrator::remainingVehicleCapacity(), libsumo::Vehicle::remove(), MSCalibrator::removePending(), MSBaseVehicle::replaceVehicleType(), MSTransportable::replaceVehicleType(), MSVehicle::resumeFromStopping(), MSStateHandler::saveState(), MSVehicleType::setActionStepLength(), MSTransportable::Stage_Trip::setArrived(), MSDevice_ToC::setParameter(), GUINet::setSimDuration(), libsumo::Person::setType(), libsumo::Vehicle::setType(), MSDevice_ToC::switchHolderType(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSDetectorFileOutput::vehicleApplies(), MSTriggeredRerouter::vehicleApplies(), MSBatteryExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSAmitranTrajectories::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), writeOutput(), MSFullExport::writeVehicles(), MSTransportable::~MSTransportable(), and MSVehicle::~MSVehicle().

◆ getWeightsStorage()

MSEdgeWeightsStorage & MSNet::getWeightsStorage ( )

Returns the net's internal edge travel times/efforts container.

If the net does not have such a container, it is built.

Returns
The net's knowledge about edge weights

Definition at line 793 of file MSNet.cpp.

References myEdgeWeights.

Referenced by libsumo::Edge::adaptTraveltime(), NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight(), NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight(), GUILane::getColorValue(), getEffort(), GUILane::getLoadedEdgeWeight(), GUILane::getScaleValue(), getShapeContainer(), GUILane::getStoredEdgeTravelTime(), getTravelTime(), and libsumo::Edge::setEffort().

◆ hasContainers()

bool MSNet::hasContainers ( ) const
inline

◆ hasElevation()

bool MSNet::hasElevation ( ) const
inline

return whether the network contains elevation data

Definition at line 610 of file MSNet.h.

References myHasElevation.

Referenced by MSVTypeProbe::execute().

◆ hasInstance()

static bool MSNet::hasInstance ( )
inlinestatic

Returns whether the network was already constructed.

Returns
whether the network was already constructed

Definition at line 123 of file MSNet.h.

References closeBuilding(), hasInternalLinks(), lefthand(), MSNet(), myInstance, and ~MSNet().

Referenced by libsumo::Simulation::close(), libsumo::Simulation::isLoaded(), and signalHandler().

◆ hasInternalLinks()

bool MSNet::hasInternalLinks ( ) const
inline

◆ hasPermissions()

bool MSNet::hasPermissions ( ) const
inline

Returns whether the network has specific vehicle class permissions.

Returns
whether permissions are present

Definition at line 177 of file MSNet.h.

References myHavePermissions.

Referenced by MSRoutingEngine::reroute().

◆ hasPersons()

bool MSNet::hasPersons ( ) const
inline

◆ informVehicleStateListener()

void MSNet::informVehicleStateListener ( const SUMOVehicle *const  vehicle,
VehicleState  to,
const std::string &  info = "" 
)

◆ interrupt()

void MSNet::interrupt ( )
inline

Definition at line 627 of file MSNet.h.

References myAmInterrupted.

Referenced by signalHandler().

◆ isInterrupted()

bool MSNet::isInterrupted ( ) const
inline

Definition at line 631 of file MSNet.h.

References checkElevation(), and myAmInterrupted.

◆ lefthand()

◆ loadRoutes()

void MSNet::loadRoutes ( )

loads routes for the next few steps

Definition at line 362 of file MSNet.cpp.

References SUMORouteLoaderControl::loadNext(), myRouteLoaders, and myStep.

Referenced by GUIRunThread::init(), NLBuilder::init(), setPermissionsFound(), and simulationStep().

◆ logSimulationDuration()

bool MSNet::logSimulationDuration ( ) const

Returns whether duration shall be logged.

Returns
Whether duration shall be logged

Definition at line 770 of file MSNet.cpp.

References myLogExecutionTime.

Referenced by GUINet::getParameterWindow(), and setCurrentTimeStep().

◆ operator=()

MSNet& MSNet::operator= ( const MSNet )
private

Invalidated assignment operator.

◆ postSimStepOutput()

void MSNet::postSimStepOutput ( ) const

◆ preSimStepOutput()

void MSNet::preSimStepOutput ( ) const

Prints the current step number.

Called on the begin of a simulation step

Definition at line 802 of file MSNet.cpp.

References myStep, and time2string().

Referenced by setCurrentTimeStep(), and simulate().

◆ removeVehicleStateListener()

void MSNet::removeVehicleStateListener ( VehicleStateListener listener)

Removes a vehicle states listener.

Parameters
[in]listenerThe listener to remove

Definition at line 846 of file MSNet.cpp.

References myVehicleStateListeners.

Referenced by MSNet::VehicleStateListener::~VehicleStateListener().

◆ setCurrentTimeStep()

void MSNet::setCurrentTimeStep ( const SUMOTime  step)
inline

Sets the current simulation step (used by state loading)

Parameters
stepthe current simulation step

Definition at line 271 of file MSNet.h.

References logSimulationDuration(), myStep, postSimStepOutput(), preSimStepOutput(), and writeOutput().

Referenced by GUIRunThread::init().

◆ setPermissionsFound()

void MSNet::setPermissionsFound ( )
inline

Labels the network to contain vehicle class permissions.

Definition at line 183 of file MSNet.h.

References addRestriction(), clearAll(), closeSimulation(), generateStatistics(), getRestrictions(), getStateMessage(), loadRoutes(), myHavePermissions, simulate(), simulationState(), and simulationStep().

Referenced by NLHandler::addLane().

◆ simulate()

MSNet::SimulationState MSNet::simulate ( SUMOTime  start,
SUMOTime  stop 
)

Simulates from timestep start to stop.

Parameters
[in]startThe begin time step of the simulation
[in]stopThe end time step of the simulation
Returns
Returns always 0
Todo:

Recheck return value

What exceptions may occure?

Definition at line 312 of file MSNet.cpp.

References closeSimulation(), getCurrentTimeStep(), TraCIServer::getInstance(), TraCIServer::getLoadArgs(), OptionsCont::getOptions(), getStateMessage(), myLogStepNumber, myStep, postSimStepOutput(), preSimStepOutput(), OptionsIO::setArgs(), SIMSTATE_LOADING, SIMSTATE_RUNNING, SIMTIME, simulationState(), simulationStep(), time2string(), VERSION_STRING, TraCIServer::wasClosed(), and WRITE_MESSAGE.

Referenced by main(), and setPermissionsFound().

◆ simulationState()

◆ simulationStep()

void MSNet::simulationStep ( )

Performs a single simulation step.

Todo:
Which exceptions may occur?

Definition at line 441 of file MSNet.cpp.

References MSEdgeControl::changeLanes(), MSTLLogicControl::check2Switch(), MSVehicleTransfer::checkInsertions(), MSTransportableControl::checkWaiting(), DELTA_T, MSEdgeControl::detectCollisions(), MSInsertionControl::determineCandidates(), MSInsertionControl::emitVehicles(), MSEventControl::execute(), MSEdgeControl::executeMovements(), MSGlobals::gCheck4Accidents, SysUtils::getCurrentMillis(), TraCIServer::getInstance(), MSVehicleTransfer::getInstance(), MSVehicleControl::getRunningVehicleNo(), TraCIServer::getTargetTime(), MSGlobals::gMesoNet, MSGlobals::gUseMesoSim, MSTransportableControl::hasTransportables(), TraCIServer::isEmbedded(), loadRoutes(), myBeginOfTimestepEvents, myContainerControl, myEdges, myEndOfTimestepEvents, myInserter, myInsertionEvents, myLogExecutionTime, myLogics, myPersonControl, mySimStepDuration, myStateDumpFiles, myStateDumpPeriod, myStateDumpPrefix, myStateDumpSuffix, myStateDumpTimes, myStep, myTraCIStepDuration, myVehicleControl, myVehiclesMoved, MSEdgeControl::patchActiveLanes(), MSEdgeControl::planMovements(), libsumo::Helper::postProcessRemoteControl(), TraCIServer::processCommandsUntilSimStep(), MSStateHandler::saveState(), MSEdgeControl::setJunctionApproaches(), SIMTIME, MELoop::simulate(), STAGE_EVENTS, STAGE_INSERTIONS, STAGE_LANECHANGE, STAGE_MOVEMENTS, time2string(), TraCIServer::wasClosed(), and writeOutput().

Referenced by TraCIServer::dispatchCommand(), setPermissionsFound(), simulate(), GUINet::simulationStep(), and libsumo::Simulation::step().

◆ warnOnce()

bool MSNet::warnOnce ( const std::string &  typeAndID)

return whether a warning regarding the given object shall be issued

Definition at line 1014 of file MSNet.cpp.

References myWarnedOnce.

Referenced by MSVehicle::addStop(), and getNetworkVersion().

◆ writeChargingStationOutput()

void MSNet::writeChargingStationOutput ( ) const

write charging station output

Definition at line 892 of file MSNet.cpp.

References OutputDevice::getDeviceByOption(), myStoppingPlaces, and SUMO_TAG_CHARGING_STATION.

Referenced by closeSimulation(), and getShapeContainer().

◆ writeOutput()

Field Documentation

◆ myAmInterrupted

bool MSNet::myAmInterrupted
protected

whether an interrupt occured

Definition at line 654 of file MSNet.h.

Referenced by interrupt(), isInterrupted(), and simulationState().

◆ myBeginOfTimestepEvents

MSEventControl* MSNet::myBeginOfTimestepEvents
protected

Controls events executed at the begin of a time step;.

See also
MSEventControl

Definition at line 678 of file MSNet.h.

Referenced by getBeginOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().

◆ myContainerControl

MSTransportableControl* MSNet::myContainerControl
protected

Controls container building and deletion;.

See also
MSTransportableControl

Definition at line 666 of file MSNet.h.

Referenced by GUINet::getContainerControl(), getContainerControl(), hasContainers(), MSNet(), simulationState(), simulationStep(), and ~MSNet().

◆ myDetectorControl

MSDetectorControl* MSNet::myDetectorControl
protected

Controls detectors;.

See also
MSDetectorControl

Definition at line 676 of file MSNet.h.

Referenced by closeSimulation(), getDetectorControl(), GUINet::initGUIStructures(), MSNet(), writeOutput(), and ~MSNet().

◆ myEdges

MSEdgeControl* MSNet::myEdges
protected

Controls edges, performs vehicle movement;.

See also
MSEdgeControl

Definition at line 668 of file MSNet.h.

Referenced by checkElevation(), closeBuilding(), getEdgeControl(), MSNet(), simulationStep(), writeOutput(), and ~MSNet().

◆ myEdgeWeights

MSEdgeWeightsStorage* MSNet::myEdgeWeights
protected

The net's knowledge about edge efforts/travel times;.

See also
MSEdgeWeightsStorage

Definition at line 686 of file MSNet.h.

Referenced by getWeightsStorage(), MSNet(), and ~MSNet().

◆ myEndOfTimestepEvents

MSEventControl* MSNet::myEndOfTimestepEvents
protected

Controls events executed at the end of a time step;.

See also
MSEventControl

Definition at line 680 of file MSNet.h.

Referenced by getEndOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().

◆ myHasElevation

bool MSNet::myHasElevation
protected

Whether the network contains elevation data.

Definition at line 738 of file MSNet.h.

Referenced by closeBuilding(), hasElevation(), and writeOutput().

◆ myHasInternalLinks

bool MSNet::myHasInternalLinks
protected

Whether the network contains internal links/lanes/edges.

Definition at line 735 of file MSNet.h.

Referenced by closeBuilding(), and hasInternalLinks().

◆ myHavePermissions

bool MSNet::myHavePermissions
protected

Whether the network contains edges which not all vehicles may pass.

Definition at line 729 of file MSNet.h.

Referenced by hasPermissions(), and setPermissionsFound().

◆ myInserter

MSInsertionControl* MSNet::myInserter
protected

Controls vehicle insertion;.

See also
MSInsertionControl

Definition at line 674 of file MSNet.h.

Referenced by generateStatistics(), getInsertionControl(), MSNet(), postSimStepOutput(), simulationState(), simulationStep(), writeOutput(), and ~MSNet().

◆ myInsertionEvents

MSEventControl* MSNet::myInsertionEvents
protected

Controls insertion events;.

See also
MSEventControl

Definition at line 682 of file MSNet.h.

Referenced by getInsertionEvents(), MSNet(), simulationStep(), and ~MSNet().

◆ myInstance

MSNet * MSNet::myInstance = nullptr
staticprotected

Unique instance of MSNet.

Definition at line 642 of file MSNet.h.

Referenced by adaptIntermodalRouter(), getInstance(), hasInstance(), MSNet(), and ~MSNet().

◆ myIntermodalRouter

std::map<int, MSIntermodalRouter*> MSNet::myIntermodalRouter
mutableprotected

Definition at line 762 of file MSNet.h.

Referenced by getIntermodalRouter(), and ~MSNet().

◆ myJunctions

MSJunctionControl* MSNet::myJunctions
protected

Controls junctions, realizes right-of-way rules;.

See also
MSJunctionControl

Definition at line 670 of file MSNet.h.

Referenced by closeBuilding(), getJunctionControl(), GUINet::getJunctionPosition(), GUINet::initGUIStructures(), MSNet(), and ~MSNet().

◆ myLanesRTree

std::pair<bool, NamedRTree> MSNet::myLanesRTree
mutableprotected

An RTree structure holding lane IDs.

Definition at line 766 of file MSNet.h.

Referenced by getLanesRTree(), MSNet(), and ~MSNet().

◆ myLefthand

bool MSNet::myLefthand
protected

Whether the network was built for left-hand traffic.

Definition at line 741 of file MSNet.h.

Referenced by closeBuilding(), and lefthand().

◆ myLogExecutionTime

bool MSNet::myLogExecutionTime
protected

Information whether the simulation duration shall be logged.

Definition at line 695 of file MSNet.h.

Referenced by closeSimulation(), logSimulationDuration(), MSNet(), postSimStepOutput(), simulationStep(), and writeOutput().

◆ myLogics

MSTLLogicControl* MSNet::myLogics
protected

Controls tls logics, realizes waiting on tls rules;.

See also
MSJunctionControl

Definition at line 672 of file MSNet.h.

Referenced by closeBuilding(), GUINet::createTLWrapper(), GUINet::getLinkTLID(), GUINet::getLinkTLIndex(), getTLSControl(), MSNet(), simulationStep(), and ~MSNet().

◆ myLogStepNumber

bool MSNet::myLogStepNumber
protected

Information whether the number of the simulation step shall be logged.

Definition at line 698 of file MSNet.h.

Referenced by MSNet(), and simulate().

◆ myMaxTeleports

int MSNet::myMaxTeleports
protected

Maximum number of teleports.

Definition at line 651 of file MSNet.h.

Referenced by MSNet(), and simulationState().

◆ myPedestrianRouter

MSPedestrianRouter* MSNet::myPedestrianRouter
mutableprotected

Definition at line 761 of file MSNet.h.

Referenced by getPedestrianRouter(), and ~MSNet().

◆ myPersonControl

MSTransportableControl* MSNet::myPersonControl
protected

◆ myRestrictions

std::map<std::string, std::map<SUMOVehicleClass, double> > MSNet::myRestrictions
protected

The vehicle class specific speed restrictions.

Definition at line 732 of file MSNet.h.

Referenced by addRestriction(), and getRestrictions().

◆ myRouteLoaders

SUMORouteLoaderControl* MSNet::myRouteLoaders
protected

Route loader for dynamic loading of routes.

Definition at line 645 of file MSNet.h.

Referenced by closeBuilding(), loadRoutes(), MSNet(), and ~MSNet().

◆ myRouterEffort

SUMOAbstractRouter<MSEdge, SUMOVehicle>* MSNet::myRouterEffort
mutableprotected

Definition at line 760 of file MSNet.h.

Referenced by getRouterEffort(), and ~MSNet().

◆ myRouterTT

SUMOAbstractRouter<MSEdge, SUMOVehicle>* MSNet::myRouterTT
mutableprotected

Definition at line 759 of file MSNet.h.

Referenced by getRouterTT(), and ~MSNet().

◆ myShapeContainer

ShapeContainer* MSNet::myShapeContainer
protected

A container for geometrical shapes;.

See also
ShapeContainer

Definition at line 684 of file MSNet.h.

Referenced by getShapeContainer(), MSNet(), and ~MSNet().

◆ mySimBeginMillis

long MSNet::mySimBeginMillis
protected

The overall simulation duration.

Definition at line 704 of file MSNet.h.

Referenced by closeBuilding(), and generateStatistics().

◆ mySimStepDuration

long MSNet::mySimStepDuration
protected

Definition at line 701 of file MSNet.h.

Referenced by postSimStepOutput(), simulationStep(), and writeOutput().

◆ myStateDumpFiles

std::vector<std::string> MSNet::myStateDumpFiles
protected

The names for the state files.

Definition at line 718 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

◆ myStateDumpPeriod

SUMOTime MSNet::myStateDumpPeriod
protected

The period for writing state.

Definition at line 720 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

◆ myStateDumpPrefix

std::string MSNet::myStateDumpPrefix
protected

name components for periodic state

Definition at line 722 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

◆ myStateDumpSuffix

std::string MSNet::myStateDumpSuffix
protected

Definition at line 723 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

◆ myStateDumpTimes

std::vector<SUMOTime> MSNet::myStateDumpTimes
protected

Times at which a state shall be written.

Definition at line 716 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

◆ myStep

◆ myStoppingPlaces

std::map<SumoXMLTag, NamedObjectCont<MSStoppingPlace*> > MSNet::myStoppingPlaces
protected

Dictionary of bus / container stops.

Definition at line 747 of file MSNet.h.

Referenced by adaptIntermodalRouter(), addStoppingPlace(), getStoppingPlace(), getStoppingPlaceID(), and writeChargingStationOutput().

◆ myTraCIStepDuration

long MSNet::myTraCIStepDuration
protected

The last simulation step duration.

Definition at line 701 of file MSNet.h.

Referenced by postSimStepOutput(), and simulationStep().

◆ myVehicleControl

◆ myVehiclesMoved

long long int MSNet::myVehiclesMoved
protected

The overall number of vehicle movements.

Definition at line 707 of file MSNet.h.

Referenced by generateStatistics(), GUINet::getMeanUPS(), and simulationStep().

◆ myVehicleStateListeners

std::vector<VehicleStateListener*> MSNet::myVehicleStateListeners
protected

Container for vehicle state listener.

Definition at line 750 of file MSNet.h.

Referenced by addVehicleStateListener(), informVehicleStateListener(), and removeVehicleStateListener().

◆ myVersion

double MSNet::myVersion
protected

the network version

Definition at line 744 of file MSNet.h.

Referenced by closeBuilding(), getNetworkVersion(), and GUINet::getParameterWindow().

◆ myWarnedOnce

std::map<std::string, bool> MSNet::myWarnedOnce
protected

container to record warnings that shall only be issued once

Definition at line 753 of file MSNet.h.

Referenced by warnOnce().

◆ STAGE_EVENTS

const std::string MSNet::STAGE_EVENTS
staticprotected

string constants for simstep stages

Definition at line 770 of file MSNet.h.

Referenced by simulationStep().

◆ STAGE_INSERTIONS

const std::string MSNet::STAGE_INSERTIONS
staticprotected

Definition at line 773 of file MSNet.h.

Referenced by simulationStep().

◆ STAGE_LANECHANGE

const std::string MSNet::STAGE_LANECHANGE
staticprotected

Definition at line 772 of file MSNet.h.

Referenced by simulationStep().

◆ STAGE_MOVEMENTS

const std::string MSNet::STAGE_MOVEMENTS
staticprotected

Definition at line 771 of file MSNet.h.

Referenced by simulationStep().


The documentation for this class was generated from the following files: