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 PedestrianRouterDijkstra< MSEdge, MSLane, MSJunction, MSVehicleMSPedestrianRouterDijkstra
 
enum  SimulationState {
  SIMSTATE_RUNNING, SIMSTATE_END_STEP_REACHED, SIMSTATE_NO_FURTHER_VEHICLES, SIMSTATE_CONNECTION_CLOSED,
  SIMSTATE_ERROR_IN_SIM, SIMSTATE_TOO_MANY_VEHICLES
}
 Possible states of a simulation - running or stopped with different reasons. More...
 

Public Member Functions

bool addChargingStation (MSChargingStation *chargingStation)
 Adds a chargingg station. More...
 
void addRestriction (const std::string &id, const SUMOVehicleClass svc, const SUMOReal 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, SUMOReal version)
 Closes the network's building process. More...
 
void closeSimulation (SUMOTime start)
 Closes the simulation (all files, connections, etc.) More...
 
MSChargingStationgetChargingStation (const std::string &id) const
 Returns the named charging station. More...
 
std::string getChargingStationID (const MSLane *lane, const SUMOReal pos) const
 Returns the charging station close to the given position. More...
 
SUMOTime getCurrentTimeStep () const
 Returns the current simulation step. More...
 
const NamedRTreegetLanesRTree () const
 Returns an RTree that contains lane IDs. More...
 
MSPedestrianRouterDijkstragetPedestrianRouter (const MSEdgeVector &prohibited=MSEdgeVector()) const
 
const std::map< SUMOVehicleClass, SUMOReal > * 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 hasNeighs () const
 return whether the network contains explicit neighbor lanes More...
 
bool hasPermissions () const
 Returns whether the network has specific vehicle class permissions. More...
 
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...
 
int 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...
 
SUMOReal version () const
 return the network version 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 bus stops
bool addBusStop (MSStoppingPlace *busStop)
 Adds a bus stop. More...
 
MSStoppingPlacegetBusStop (const std::string &id) const
 Returns the named bus stop. More...
 
std::string getBusStopID (const MSLane *lane, const SUMOReal pos) const
 Returns the bus stop close to the given position. More...
 
Insertion and retrieval of container stops
bool addContainerStop (MSStoppingPlace *containerStop)
 Adds a container stop. More...
 
MSStoppingPlacegetContainerStop (const std::string &id) const
 Returns the named container stop. More...
 
std::string getContainerStopID (const MSLane *lane, const SUMOReal pos) const
 Returns the container stop close to the given position. More...
 

Static Public Member Functions

static void clearAll ()
 Clears all dictionaries. More...
 
static SUMOReal getEffort (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal 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 SUMOReal getTravelTime (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
 Returns the travel time to pass an edge. More...
 

Protected Member Functions

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

Protected Attributes

NamedObjectCont< MSStoppingPlace * > myBusStopDict
 Dictionary of bus stops. More...
 
NamedObjectCont< MSChargingStation * > myChargingStationDict
 Dictionary of charging Stations. More...
 
NamedObjectCont< MSStoppingPlace * > myContainerStopDict
 Dictionary of container stops. More...
 
bool myHasElevation
 Whether the network contains elevation data. More...
 
bool myHasInternalLinks
 Whether the network contains internal links/lanes/edges. More...
 
bool myHasNeighs
 Whether the network contains explicit neighbor lanes. More...
 
bool myHavePermissions
 Whether the network contains edges which not all vehicles may pass. More...
 
std::pair< bool, NamedRTreemyLanesRTree
 An RTree structure holding lane IDs. More...
 
bool myLefthand
 Whether the network was built for left-hand traffic. More...
 
MSPedestrianRouterDijkstramyPedestrianRouter
 
std::map< std::string, std::map< SUMOVehicleClass, SUMOReal > > myRestrictions
 The vehicle class specific speed restrictions. More...
 
SUMORouteLoaderControlmyRouteLoaders
 Route loader for dynamic loading of routes. More...
 
DijkstraRouterEffort< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > > * myRouterEffort
 
AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > > * myRouterTTAStar
 
DijkstraRouterTT< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > > * myRouterTTDijkstra
 
bool myRouterTTInitialized
 
SUMOTime myStep
 Current time step. More...
 
std::vector< VehicleStateListener * > myVehicleStateListeners
 Container for vehicle state listener. More...
 
SUMOReal myVersion
 the network version 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 mySimStepBegin
 The last simulation step begin, end and duration. More...
 
long mySimStepEnd
 
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 = 0
 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
}
 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)
 Informs all added listeners about a vehicle's state change. More...
 

Detailed Description

The simulated network and simulation perfomer.

Definition at line 93 of file MSNet.h.

Member Typedef Documentation

Member Enumeration Documentation

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

Enumerator
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 occured during the simulation step.

SIMSTATE_TOO_MANY_VEHICLES 

The simulation contains too many vehicles (.

Deprecated:
)

Definition at line 98 of file MSNet.h.

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.

Definition at line 537 of file MSNet.h.

Constructor & Destructor Documentation

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 167 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, myPersonControl, myRouteLoaders, myShapeContainer, myStep, myVehicleControl, and string2time().

MSNet::MSNet ( const MSNet )
private

Invalidated copy constructor.

Member Function Documentation

bool MSNet::addBusStop ( MSStoppingPlace busStop)

Adds a bus stop.

If another bus stop with the same id exists, false is returned. Otherwise, the bus stop is added to the internal bus stop container "myBusStopDict".

This control gets responsible for deletion of the added bus stop.

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

Definition at line 783 of file MSNet.cpp.

References NamedObjectCont< T >::add(), Named::getID(), and myBusStopDict.

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

bool MSNet::addChargingStation ( MSChargingStation chargingStation)

Adds a chargingg station.

If another charging station with the same id exists, false is returned. Otherwise, the charging station is added to the internal bus stop container "myChargingStationDict".

This control gets responsible for deletion of the added charging station.

Parameters
[in]chargingStationThe charging station add
Returns
Whether the charging station could be added

Definition at line 831 of file MSNet.cpp.

References NamedObjectCont< T >::add(), Named::getID(), and myChargingStationDict.

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

bool MSNet::addContainerStop ( MSStoppingPlace containerStop)

Adds a container stop.

If another container stop with the same id exists, false is returned. Otherwise, the container stop is added to the internal container stop container "myContainerStopDict".

This control gets responsible for deletion of the added container stop.

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

Definition at line 808 of file MSNet.cpp.

References NamedObjectCont< T >::add(), Named::getID(), and myContainerStopDict.

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

void MSNet::addRestriction ( const std::string &  id,
const SUMOVehicleClass  svc,
const SUMOReal  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 290 of file MSNet.cpp.

References myRestrictions.

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

void MSNet::addVehicleStateListener ( VehicleStateListener listener)

Adds a vehicle states listener.

Parameters
[in]listenerThe listener to add

Definition at line 756 of file MSNet.cpp.

References myVehicleStateListeners.

Referenced by MSDevice_Vehroutes::init(), TraCIServer::TraCIServer(), and MSNet::VehicleStateListener::~VehicleStateListener().

bool MSNet::checkElevation ( )
protected

check all lanes for elevation data

Definition at line 914 of file MSNet.cpp.

References MSEdgeControl::getEdges(), and myEdges.

Referenced by closeBuilding(), and version().

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,
SUMOReal  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 213 of file MSNet.cpp.

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

Referenced by NLBuilder::buildNet().

MSStoppingPlace * MSNet::getBusStop ( const std::string &  id) const

Returns the named bus stop.

Parameters
[in]idThe id of the bus stop to return.
Returns
The named bus stop, or 0 if no such stop exists

Definition at line 789 of file MSNet.cpp.

References NamedObjectCont< T >::get(), and myBusStopDict.

Referenced by MSRouteHandler::addStop(), MSVehicle::addStop(), MSVehicle::addTraciBusOrContainerStop(), getShapeContainer(), MSRouteHandler::myStartElement(), MSRouteHandler::parseWalkPositions(), and TraCIServerAPI_Simulation::processGet().

std::string MSNet::getBusStopID ( const MSLane lane,
const SUMOReal  pos 
) const

Returns the bus stop close to the given position.

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

Definition at line 795 of file MSNet.cpp.

References MSStoppingPlace::getEndLanePosition(), Named::getID(), MSStoppingPlace::getLane(), NamedObjectCont< T >::getMyMap(), myBusStopDict, and POSITION_EPS.

Referenced by getShapeContainer().

MSChargingStation * MSNet::getChargingStation ( const std::string &  id) const

Returns the named charging station.

Parameters
[in]idThe id of the charging station to return.
Returns
The named charging station, or 0 if no such stop exists

Definition at line 837 of file MSNet.cpp.

References NamedObjectCont< T >::get(), and myChargingStationDict.

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

std::string MSNet::getChargingStationID ( const MSLane lane,
const SUMOReal  pos 
) const

Returns the charging station close to the given position.

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

Definition at line 843 of file MSNet.cpp.

References MSStoppingPlace::getBeginLanePosition(), MSStoppingPlace::getEndLanePosition(), Named::getID(), MSStoppingPlace::getLane(), NamedObjectCont< T >::getMyMap(), and myChargingStationDict.

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

MSTransportableControl & MSNet::getContainerControl ( )
virtual

Returns the container control.

If the container control does not exist, yet, it is created.

Returns
The container control
See also
MSContainerControl
myContainerControl

Reimplemented in GUINet.

Definition at line 707 of file MSNet.cpp.

References myContainerControl.

Referenced by MSRouteHandler::closeContainer(), hasPersons(), MSContainer::MSContainerStage_Tranship::moveToNextEdge(), MSDevice_Transportable::notifyLeave(), MSDevice_Transportable::notifyMove(), MSContainer::MSContainerStage_Driving::proceed(), MSTransportable::Stage_Waiting::proceed(), and MSVehicle::processNextStop().

MSStoppingPlace * MSNet::getContainerStop ( const std::string &  id) const

Returns the named container stop.

Parameters
[in]idThe id of the container stop to return.
Returns
The named container stop, or 0 if no such stop exists

Definition at line 813 of file MSNet.cpp.

References NamedObjectCont< T >::get(), and myContainerStopDict.

Referenced by MSRouteHandler::addStop(), MSVehicle::addStop(), MSVehicle::addTraciBusOrContainerStop(), getShapeContainer(), and MSRouteHandler::myStartElement().

std::string MSNet::getContainerStopID ( const MSLane lane,
const SUMOReal  pos 
) const

Returns the container stop close to the given position.

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

Definition at line 818 of file MSNet.cpp.

References MSStoppingPlace::getEndLanePosition(), Named::getID(), MSStoppingPlace::getLane(), NamedObjectCont< T >::getMyMap(), myContainerStopDict, and POSITION_EPS.

Referenced by getShapeContainer().

SUMOTime MSNet::getCurrentTimeStep ( ) const
inline

Returns the current simulation step.

Returns
the current simulation step

Definition at line 254 of file MSNet.h.

References myStep.

Referenced by MSLCM_JE2013::_wantsChange(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), GUIEdge::addRerouter(), MSDevice_Vehroutes::addRoute(), MSTLLogicControl::addWAUTJunction(), MSTransportableControl::boardAnyWaiting(), NLDetectorBuilder::buildE2Detector(), MSDevice_Routing::buildVehicleDevices(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSTLLogicControl::closeWAUT(), TraCIServerAPI_Simulation::commandDistanceRequest(), MSDevice_Tripinfo::computeLengthAndDuration(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), MSActuatedTrafficLightLogic::duration(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSActuatedTrafficLightLogic::gapControl(), MSTransportable::getAngle(), MSLane::getCriticalLeader(), MSInductLoop::getCurrentOccupancy(), MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), GUIApplicationWindow::getCurrentSimTime(), MSLaneSpeedTrigger::getCurrentSpeed(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), MSTransportable::getEdgePos(), MSLane::getFirstVehicleInformation(), MSLane::getLastVehicleInformation(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), MESegment::getMeanSpeed(), MSInsertionControl::getPendingEmits(), MSTransportable::getPosition(), MSTransportable::getWaitingSeconds(), MSLink::getZipperSpeed(), GUIApplicationWindow::handleEvent_SimulationStep(), MSSwarmTrafficLightLogic::init(), MSLaneSpeedTrigger::init(), TraCIServer::initialiseSubscription(), MSTLLogicControl::initWautSwitch(), MSLane::isInsertionSuccess(), MSVehicle::Influencer::isVTDControlled(), MSTransportableControl::loadAnyWaiting(), GUIRunThread::makeStep(), MSPModel_Striping::MSPModel_Striping(), MSDevice_Vehroutes::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Transportable::notifyMove(), GUIApplicationWindow::onCmdTimeToggle(), MSBaseVehicle::onDepart(), TraCIServer::postProcessSimulationStep2(), MESegment::prepareDetectorForWriting(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Vehicle::processSet(), MSSOTLTrafficLightLogic::resetCTS(), MSTrafficLightLogic::resetLinkStates(), GUIRunThread::run(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSPhasedTrafficLightLogic::setStep(), MSSOTLTrafficLightLogic::setupCTS(), simulate(), MSSimpleTrafficLightLogic::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::updateCTS(), MSRailCrossing::updateCurrentPhase(), and MSSwarmTrafficLightLogic::updateSensitivities().

SUMOReal MSNet::getEffort ( const MSEdge *const  e,
const SUMOVehicle *const  v,
SUMOReal  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
DijkstraRouterTT_ByProxi

Definition at line 127 of file MSNet.cpp.

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

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

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 410 of file MSNet.h.

References myEndOfTimestepEvents.

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

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 420 of file MSNet.h.

References myInsertionEvents.

Referenced by MSDevice_Routing::MSDevice_Routing().

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 159 of file MSNet.cpp.

References myInstance.

Referenced by MSLCM_SL2015::_patchSpeed(), MSLCM_JE2013::_wantsChange(), MSLCM_LC2013::_wantsChange(), MSLCM_SL2015::_wantsChangeSublane(), MSDevice_Routing::adaptEdgeEfforts(), MSVehicleTransfer::add(), MSInsertionControl::add(), MSTrafficLightLogic::addLink(), MSTLLogicControl::TLSLogicVariants::addLogic(), GUIEdge::addRerouter(), MSDevice_Vehroutes::addRoute(), MSRouteHandler::addStop(), MSVehicle::addStop(), MSBaseVehicle::addStops(), MSVehicle::addTraciBusOrContainerStop(), MSTLLogicControl::addWAUTJunction(), 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(), MSDevice_Routing::buildVehicleDevices(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MELoop::changeSegment(), MSPhasedTrafficLightLogic::changeStepAndDuration(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSLane::checkFailure(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), MSRouteHandler::closeContainer(), MSRouteHandler::closeFlow(), MSRouteHandler::closePerson(), MSRouteHandler::closeRoute(), MSRouteHandler::closeVehicle(), MSRouteHandler::closeVehicleTypeDistribution(), MSTLLogicControl::closeWAUT(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), TraCIServerAPI_Simulation::commandDistanceRequest(), MSDevice_Tripinfo::computeLengthAndDuration(), TraCIServerAPI_Simulation::convertCartesianToRoadMap(), NLDetectorBuilder::createEdgeLaneMeanData(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), MSLane::detectCollisions(), MSInsertionControl::determineCandidates(), TraCIServer::dispatchCommand(), GUITrafficLightLogicWrapper::drawGL(), GUIBusStop::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), GUILane::drawGL(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawMarkings(), GUILane::drawTLSLinkNo(), MSActuatedTrafficLightLogic::duration(), MSDevice::equippedByDefaultAssignmentOptions(), METriggeredCalibrator::execute(), MSCalibrator::execute(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSActuatedTrafficLightLogic::gapControl(), MSDevice_Vehroutes::generateOutput(), MSTransportable::getAngle(), GUIEdge::getColorValue(), GUILane::getColorValue(), MSLane::getCriticalLeader(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSSOTLTrafficLightLogic::getCurrentPhaseElapsed(), MSLaneSpeedTrigger::getCurrentSpeed(), MSInductLoop::getCurrentSpeed(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), MSInductLoop::getCurrentVehicleIDs(), MSTransportable::getEdgePos(), getEffort(), MSE2Collector::getEstimateQueueLength(), MSLane::getFirstVehicleInformation(), GUINet::getGUIInstance(), MSLane::getLastVehicleInformation(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), GUILane::getLoadedEdgeWeight(), MSLane::getMaximumBrakeDist(), MESegment::getMeanSpeed(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), MSPModel::getModel(), MSCModel_NonInteracting::getModel(), MSPModel_Striping::getNextLane(), TraCIServerAPI_Vehicle::getOrBuildVTDMap(), MSInsertionControl::getPendingEmits(), MSTLLogicControl::getPhaseDef(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), TraCIServerAPI_POI::getPoI(), TraCIServerAPI_Polygon::getPolygon(), TraCIServerAPI_InductionLoop::getPosition(), TraCIServerAPI_Junction::getPosition(), TraCIServerAPI_Vehicle::getPosition(), TraCIServerAPI_Person::getPosition(), MSTransportable::getPosition(), MSVTKExport::getPositions(), GUIEdge::getScaleValue(), GUILane::getScaleValue(), MSVTKExport::getSpeed(), GUILane::getStoredEdgeTravelTime(), MSEdge::getSuccessors(), MSInductLoop::getTimestepsSinceLastDetection(), getTravelTime(), MSEdge::getTravelTimeStatic(), TraCIServerAPI_InductionLoop::getTree(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_POI::getTree(), TraCIServerAPI_Polygon::getTree(), MSTransportable::getWaitingSeconds(), MSLink::getZipperSpeed(), GUIBusStop::GUIBusStop(), MSLane::handleCollisionBetween(), MSLane::incorporateVehicle(), MSVehicle::influenceChangeDecision(), MSLCM_JE2013::inform(), MSLCM_SL2015::inform(), MSLCM_LC2013::inform(), MSLCM_JE2013::informFollower(), MSLCM_LC2013::informFollower(), MSLCM_SL2015::informFollower(), MSLCM_JE2013::informLeader(), MSLCM_LC2013::informLeader(), MSLCM_SL2015::informLeader(), MSDevice_Vehroutes::init(), MSRailCrossing::init(), MSRailSignal::init(), MSActuatedTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), MSLaneSpeedTrigger::init(), MSCalibrator::init(), MSMeanData::init(), TraCIServer::initialiseSubscription(), MSTLLogicControl::initWautSwitch(), MSEdge::insertVehicle(), MSLane::isInsertionSuccess(), MSSOTLTrafficLightLogic::isThresholdPassed(), MSVehicle::Influencer::isVTDControlled(), MSVehicle::leaveLane(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), MSTransportableControl::loadAnyWaiting(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), MSContainer::MSContainerStage_Tranship::moveToNextEdge(), MSDevice_Routing::MSDevice_Routing(), MSLane::MSLane(), MSTrafficLightLogic::MSTrafficLightLogic(), MSVTypeProbe::MSVTypeProbe(), GUITriggeredRerouter::myEndElement(), MSStateHandler::myEndElement(), MSRouteHandler::myEndElement(), MSTriggeredRerouter::myEndElement(), MSStateHandler::myStartElement(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), MSDevice_Transportable::notifyEnter(), MSDevice_Vehroutes::notifyEnter(), MSInductLoop::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Routing::notifyEnter(), MSE2Collector::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Transportable::notifyMove(), MSDevice_Battery::notifyMove(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSInductLoop::notifyMove(), MSE2Collector::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), GUIViewTraffic::onGamingClick(), MSRouteHandler::openVehicleTypeDistribution(), MSRouteHandler::parseWalkPositions(), MSLCM_JE2013::patchSpeed(), MSLCM_SL2015::patchSpeed(), MSLCM_LC2013::patchSpeed(), MSVehicle::planMoveInternal(), TraCIServer::postProcessSimulationStep2(), TraCIServer::postProcessVTD(), MESegment::prepareDetectorForWriting(), MSAbstractLaneChangeModel::primaryLaneChanged(), MSPerson::MSPersonStage_Walking::proceed(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_ArealDetector::processGet(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_Simulation::processSet(), TraCIServerAPI_Person::processSet(), TraCIServerAPI_VehicleType::processSet(), MSPModel_Striping::PState::PState(), MESegment::receive(), METriggeredCalibrator::remainingVehicleCapacity(), MSCalibrator::remainingVehicleCapacity(), MSCalibrator::removePending(), MSVehicle::replaceRoute(), MEVehicle::replaceRoute(), MSDevice_Routing::reroute(), MSSOTLTrafficLightLogic::resetCTS(), MSTrafficLightLogic::resetLinkStates(), MSVehicle::resumeFromStopping(), MSContainer::routeOutput(), MSPerson::routeOutput(), MSLCM_JE2013::saveBlockerLength(), MSLCM_LC2013::saveBlockerLength(), MSLCM_SL2015::saveBlockerLength(), MSStateHandler::saveState(), MSVehicleControl::scheduleVehicleRemoval(), GUIBaseVehicle::setFunctionalColor(), MSLaneSpeedTrigger::setOverriding(), MSLaneSpeedTrigger::setOverridingValue(), MSTriggeredRerouter::setPermissions(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), MSPhasedTrafficLightLogic::setStep(), MSSOTLTrafficLightLogic::setupCTS(), MSLCM_JE2013::slowDownForBlocked(), MSLCM_LC2013::slowDownForBlocked(), MSLCM_SL2015::slowDownForBlocked(), MSLane::succLinkSec(), MSTLLogicControl::TLSLogicVariants::switchTo(), MELoop::teleportVehicle(), TraCIServer::TraCIServer(), METriggeredCalibrator::tryEmit(), MSInsertionControl::tryInsert(), MSSimpleTrafficLightLogic::trySwitch(), MSRailCrossing::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSRailSignal::trySwitch(), MSSOTLTrafficLightLogic::trySwitch(), MSSOTLTrafficLightLogic::updateCTS(), MSRailCrossing::updateCurrentPhase(), MSSOTLTrafficLightLogic::updateDecayThreshold(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSAbstractLaneChangeModel::updateShadowLane(), MSVehicleControl::vehicleDeparted(), MSPModel_Striping::PState::walk(), MSLCM_JE2013::wantsChange(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSEmissionExport::write(), MSBatteryExport::write(), MSFCDExport::write(), MSAmitranTrajectories::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), MSQueueExport::writeEdge(), MSFullExport::writeEdge(), writeOutput(), MSFullExport::writeTLS(), MSFullExport::writeVehicles(), MSDevice_BTreceiver::BTreceiverUpdate::~BTreceiverUpdate(), MSDevice_Routing::~MSDevice_Routing(), and TraCIServer::~TraCIServer().

MSJunctionControl& MSNet::getJunctionControl ( )
inline

Returns the junctions control.

Returns
The junctions control
See also
MSJunctionControl
myJunctions

Definition at line 390 of file MSNet.h.

References myJunctions.

Referenced by TraCIServerAPI_Junction::getPosition(), TraCIServerAPI_Junction::getTree(), and TraCIServerAPI_Junction::processGet().

const NamedRTree & MSNet::getLanesRTree ( ) const

Returns an RTree that contains lane IDs.

Returns
An Rtree containing lane IDs

Definition at line 904 of file MSNet.cpp.

References MSLane::fill(), and myLanesRTree.

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

const std::map< SUMOVehicleClass, SUMOReal > * 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 296 of file MSNet.cpp.

References myRestrictions.

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

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

Returns the message to show if a certain state occurs.

Returns
Readable description of the state

Definition at line 554 of file MSNet.cpp.

References SIMSTATE_CONNECTION_CLOSED, SIMSTATE_END_STEP_REACHED, SIMSTATE_ERROR_IN_SIM, SIMSTATE_NO_FURTHER_VEHICLES, SIMSTATE_RUNNING, and SIMSTATE_TOO_MANY_VEHICLES.

Referenced by GUIApplicationWindow::handleEvent_SimulationEnded(), GUIRunThread::makeStep(), setPermissionsFound(), and simulate().

SUMOReal MSNet::getTravelTime ( const MSEdge *const  e,
const SUMOVehicle *const  v,
SUMOReal  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
DijkstraRouterTT_ByProxi

Definition at line 141 of file MSNet.cpp.

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

Referenced by MSDevice_Routing::buildVehicleDevices(), getRouterEffort(), getRouterTT(), MSEdge::getTravelTimeStatic(), and MSNet::VehicleStateListener::~VehicleStateListener().

MSVehicleControl& MSNet::getVehicleControl ( )
inline

Returns the vehicle control.

Returns
The vehicle control
See also
MSVehicleControl
myVehicleControl

Definition at line 307 of file MSNet.h.

References getPersonControl(), and myVehicleControl.

Referenced by MSVehicleTransfer::add(), MSInsertionControl::add(), MELoop::changeSegment(), GUIApplicationWindow::checkGamingEvents(), MSVehicleTransfer::checkInsertions(), MSRouteHandler::closeContainer(), MSRouteHandler::closePerson(), MSRouteHandler::closeVehicle(), MSLane::detectCollisions(), MSInsertionControl::determineCandidates(), MSDevice::equippedByDefaultAssignmentOptions(), METriggeredCalibrator::execute(), MSCalibrator::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSLane::getMaximumBrakeDist(), GUINet::getParameterWindow(), TraCIServerAPI_Vehicle::getPosition(), MSVTKExport::getPositions(), MSVTKExport::getSpeed(), MSLane::handleCollisionBetween(), GUIApplicationWindow::handleEvent_SimulationStep(), MSStateHandler::myEndElement(), MSStateHandler::myStartElement(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), MSRouteHandler::openVehicleTypeDistribution(), TraCIServer::postProcessVTD(), MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_VehicleType::processSet(), MESegment::receive(), METriggeredCalibrator::remainingVehicleCapacity(), MSCalibrator::remainingVehicleCapacity(), MSCalibrator::removePending(), MSVehicle::resumeFromStopping(), MSStateHandler::saveState(), GUINet::setSimDuration(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSEmissionExport::write(), MSBatteryExport::write(), MSFCDExport::write(), MSAmitranTrajectories::write(), MSMeanData_Emissions::MSLaneMeanDataValues::write(), writeOutput(), and MSFullExport::writeVehicles().

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 716 of file MSNet.cpp.

References myEdgeWeights.

Referenced by NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight(), NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight(), GUILane::getColorValue(), getEffort(), GUILane::getLoadedEdgeWeight(), GUILane::getScaleValue(), getShapeContainer(), GUILane::getStoredEdgeTravelTime(), getTravelTime(), and TraCIServerAPI_Edge::processSet().

bool MSNet::hasContainers ( ) const
inline

Returns whether containers are simulated.

Definition at line 340 of file MSNet.h.

References myContainerControl.

Referenced by GUIApplicationWindow::handleEvent_SimulationStep(), and MSVehicle::processNextStop().

bool MSNet::hasElevation ( ) const
inline

return whether the network contains elevation data

Definition at line 649 of file MSNet.h.

References myHasElevation.

Referenced by MSVTypeProbe::execute().

bool MSNet::hasInternalLinks ( ) const
inline

return whether the network contains internal links

Definition at line 639 of file MSNet.h.

References myHasInternalLinks.

Referenced by closeBuilding(), MSDevice_Tripinfo::computeLengthAndDuration(), and MSDevice_Vehroutes::generateOutput().

bool MSNet::hasNeighs ( ) const
inline

return whether the network contains explicit neighbor lanes

Definition at line 644 of file MSNet.h.

References myHasNeighs.

Referenced by closeBuilding().

bool MSNet::hasPermissions ( ) const
inline

Returns whether the network has specific vehicle class permissions.

Returns
whether permissions are present

Definition at line 174 of file MSNet.h.

References myHavePermissions.

Referenced by MSDevice_Routing::reroute().

bool MSNet::hasPersons ( ) const
inline

Returns whether persons are simulated.

Definition at line 324 of file MSNet.h.

References getContainerControl(), and myPersonControl.

Referenced by GUIApplicationWindow::handleEvent_SimulationStep(), and MSVehicle::processNextStop().

void MSNet::informVehicleStateListener ( const SUMOVehicle *const  vehicle,
VehicleState  to 
)
bool MSNet::lefthand ( ) const
inline

return whether the network was built for lefthand traffic

Definition at line 654 of file MSNet.h.

References myLefthand.

Referenced by closeBuilding(), GUIBusStop::drawGL(), GUILane::drawLinkNo(), GUILane::drawLinkRules(), GUILane::drawMarkings(), GUILane::drawTLSLinkNo(), and GUIBusStop::GUIBusStop().

void MSNet::loadRoutes ( )

loads routes for the next few steps

Definition at line 351 of file MSNet.cpp.

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

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

bool MSNet::logSimulationDuration ( ) const

Returns whether duration shall be logged.

Returns
Whether duration shall be logged

Definition at line 693 of file MSNet.cpp.

References myLogExecutionTime.

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

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

Invalidated assignment operator.

void MSNet::postSimStepOutput ( ) const

Prints the statistics of the step at its end.

Called on the end of a simulation step

Definition at line 731 of file MSNet.cpp.

References DELTA_T, MSVehicleControl::getDepartedVehicleNo(), MSVehicleControl::getRunningVehicleNo(), myLogExecutionTime, mySimStepDuration, myStep, myVehicleControl, OUTPUT_ACCURACY, SUMOReal, and time2string().

Referenced by setCurrentTimeStep(), and simulate().

void MSNet::preSimStepOutput ( ) const

Prints the current step number.

Called on the begin of a simulation step

Definition at line 725 of file MSNet.cpp.

References myStep, and time2string().

Referenced by setCurrentTimeStep(), and simulate().

void MSNet::removeVehicleStateListener ( VehicleStateListener listener)

Removes a vehicle states listener.

Parameters
[in]listenerThe listener to remove

Definition at line 764 of file MSNet.cpp.

References myVehicleStateListeners.

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

void MSNet::setCurrentTimeStep ( const SUMOTime  step)
inline

Sets the current simulation step (used by state loading)

Parameters
stepthe current simulation step

Definition at line 262 of file MSNet.h.

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

Referenced by GUIRunThread::init().

void MSNet::setPermissionsFound ( )
inline

Labels the network to contain vehicle class permissions.

Definition at line 180 of file MSNet.h.

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

Referenced by NLHandler::addLane().

int 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 306 of file MSNet.cpp.

References closeSimulation(), getCurrentTimeStep(), OptionsCont::getOptions(), getStateMessage(), loadRoutes(), myLogStepNumber, myStep, postSimStepOutput(), preSimStepOutput(), SIMSTATE_RUNNING, simulationState(), simulationStep(), time2string(), TraCIServer::wasClosed(), and WRITE_MESSAGE.

Referenced by main(), and setPermissionsFound().

void MSNet::simulationStep ( )
SUMOReal MSNet::version ( ) const
inline

return the network version

Definition at line 659 of file MSNet.h.

References checkElevation(), and myVersion.

Referenced by closeBuilding().

Field Documentation

MSEventControl* MSNet::myBeginOfTimestepEvents
protected

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

See also
MSEventControl

Definition at line 699 of file MSNet.h.

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

NamedObjectCont<MSStoppingPlace*> MSNet::myBusStopDict
protected

Dictionary of bus stops.

Definition at line 771 of file MSNet.h.

Referenced by addBusStop(), getBusStop(), and getBusStopID().

NamedObjectCont<MSChargingStation*> MSNet::myChargingStationDict
protected

Dictionary of charging Stations.

Definition at line 777 of file MSNet.h.

Referenced by addChargingStation(), getChargingStation(), and getChargingStationID().

MSTransportableControl* MSNet::myContainerControl
protected

Controls container building and deletion;.

See also
MSTransportableControl

Definition at line 687 of file MSNet.h.

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

NamedObjectCont<MSStoppingPlace*> MSNet::myContainerStopDict
protected

Dictionary of container stops.

Definition at line 774 of file MSNet.h.

Referenced by addContainerStop(), getContainerStop(), and getContainerStopID().

MSDetectorControl* MSNet::myDetectorControl
protected

Controls detectors;.

See also
MSDetectorControl

Definition at line 697 of file MSNet.h.

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

MSEdgeControl* MSNet::myEdges
protected

Controls edges, performs vehicle movement;.

See also
MSEdgeControl

Definition at line 689 of file MSNet.h.

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

MSEdgeWeightsStorage* MSNet::myEdgeWeights
protected

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

See also
MSEdgeWeightsStorage

Definition at line 707 of file MSNet.h.

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

MSEventControl* MSNet::myEndOfTimestepEvents
protected

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

See also
MSEventControl

Definition at line 701 of file MSNet.h.

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

bool MSNet::myHasElevation
protected

Whether the network contains elevation data.

Definition at line 762 of file MSNet.h.

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

bool MSNet::myHasInternalLinks
protected

Whether the network contains internal links/lanes/edges.

Definition at line 756 of file MSNet.h.

Referenced by closeBuilding(), and hasInternalLinks().

bool MSNet::myHasNeighs
protected

Whether the network contains explicit neighbor lanes.

Definition at line 759 of file MSNet.h.

Referenced by closeBuilding(), and hasNeighs().

bool MSNet::myHavePermissions
protected

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

Definition at line 750 of file MSNet.h.

Referenced by hasPermissions(), and setPermissionsFound().

MSInsertionControl* MSNet::myInserter
protected

Controls vehicle insertion;.

See also
MSInsertionControl

Definition at line 695 of file MSNet.h.

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

MSEventControl* MSNet::myInsertionEvents
protected

Controls insertion events;.

See also
MSEventControl

Definition at line 703 of file MSNet.h.

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

MSNet * MSNet::myInstance = 0
staticprotected

Unique instance of MSNet.

Definition at line 669 of file MSNet.h.

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

MSJunctionControl* MSNet::myJunctions
protected

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

See also
MSJunctionControl

Definition at line 691 of file MSNet.h.

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

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

An RTree structure holding lane IDs.

Definition at line 795 of file MSNet.h.

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

bool MSNet::myLefthand
protected

Whether the network was built for left-hand traffic.

Definition at line 765 of file MSNet.h.

Referenced by closeBuilding(), and lefthand().

bool MSNet::myLogExecutionTime
protected

Information whether the simulation duration shall be logged.

Definition at line 716 of file MSNet.h.

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

MSTLLogicControl* MSNet::myLogics
protected

Controls tls logics, realizes waiting on tls rules;.

See also
MSJunctionControl

Definition at line 693 of file MSNet.h.

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

bool MSNet::myLogStepNumber
protected

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

Definition at line 719 of file MSNet.h.

Referenced by MSNet(), and simulate().

MSPedestrianRouterDijkstra* MSNet::myPedestrianRouter
mutableprotected

Definition at line 791 of file MSNet.h.

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

MSTransportableControl* MSNet::myPersonControl
protected
std::map<std::string, std::map<SUMOVehicleClass, SUMOReal> > MSNet::myRestrictions
protected

The vehicle class specific speed restrictions.

Definition at line 753 of file MSNet.h.

Referenced by addRestriction(), and getRestrictions().

SUMORouteLoaderControl* MSNet::myRouteLoaders
protected

Route loader for dynamic loading of routes.

Definition at line 672 of file MSNet.h.

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

Definition at line 790 of file MSNet.h.

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

AStarRouter<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >* MSNet::myRouterTTAStar
mutableprotected

Definition at line 789 of file MSNet.h.

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

DijkstraRouterTT<MSEdge, SUMOVehicle, prohibited_withPermissions<MSEdge, SUMOVehicle> >* MSNet::myRouterTTDijkstra
mutableprotected

Definition at line 788 of file MSNet.h.

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

bool MSNet::myRouterTTInitialized
mutableprotected

Definition at line 787 of file MSNet.h.

Referenced by getRouterTT().

ShapeContainer* MSNet::myShapeContainer
protected

A container for geometrical shapes;.

See also
ShapeContainer

Definition at line 705 of file MSNet.h.

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

long MSNet::mySimBeginMillis
protected

The overall simulation duration.

Definition at line 725 of file MSNet.h.

Referenced by closeBuilding(), and closeSimulation().

long MSNet::mySimStepBegin
protected

The last simulation step begin, end and duration.

Definition at line 722 of file MSNet.h.

Referenced by simulationStep().

long MSNet::mySimStepDuration
protected

Definition at line 722 of file MSNet.h.

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

long MSNet::mySimStepEnd
protected

Definition at line 722 of file MSNet.h.

Referenced by simulationStep().

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

The names for the state files.

Definition at line 739 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

SUMOTime MSNet::myStateDumpPeriod
protected

The period for writing state.

Definition at line 741 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

std::string MSNet::myStateDumpPrefix
protected

name components for periodic state

Definition at line 743 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

std::string MSNet::myStateDumpSuffix
protected

Definition at line 744 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

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

Times at which a state shall be written.

Definition at line 737 of file MSNet.h.

Referenced by closeBuilding(), and simulationStep().

long long int MSNet::myVehiclesMoved
protected

The overall number of vehicle movements.

Definition at line 728 of file MSNet.h.

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

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

Container for vehicle state listener.

Definition at line 780 of file MSNet.h.

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

SUMOReal MSNet::myVersion
protected

the network version

Definition at line 768 of file MSNet.h.

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

const std::string MSNet::STAGE_EVENTS
staticprotected

string constants for simstep stages

Definition at line 799 of file MSNet.h.

Referenced by simulationStep().

const std::string MSNet::STAGE_INSERTIONS
staticprotected

Definition at line 802 of file MSNet.h.

Referenced by simulationStep().

const std::string MSNet::STAGE_LANECHANGE
staticprotected

Definition at line 801 of file MSNet.h.

Referenced by simulationStep().

const std::string MSNet::STAGE_MOVEMENTS
staticprotected

Definition at line 800 of file MSNet.h.

Referenced by simulationStep().


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