SUMO - Simulation of Urban MObility
|
The simulated network and simulation perfomer. More...
#include <MSNet.h>
Data Structures | |
class | VehicleStateListener |
Interface for objects listening to vehicle state changes. More... |
Public Types | |
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 | |
void | closeBuilding (MSEdgeControl *edges, MSJunctionControl *junctions, SUMORouteLoaderControl *routeLoaders, MSTLLogicControl *tlc, std::vector< SUMOTime > stateDumpTimes, std::vector< std::string > stateDumpFiles) |
Closes the network's building process. | |
void | closeSimulation (SUMOTime start) |
Closes the simulation (all files, connections, etc.) | |
SUMOTime | getCurrentTimeStep () const |
Returns the current simulation step (in s) | |
SUMOAbstractRouter< MSEdge, SUMOVehicle > & | getRouterEffort (const std::vector< MSEdge * > &prohibited=std::vector< MSEdge * >()) const |
SUMOAbstractRouter< MSEdge, SUMOVehicle > & | getRouterTT (const std::vector< MSEdge * > &prohibited=std::vector< MSEdge * >()) const |
bool | logSimulationDuration () const |
Returns whether duration shall be logged. | |
MSNet (MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents, ShapeContainer *shapeCont=0) | |
Constructor. | |
int | simulate (SUMOTime start, SUMOTime stop) |
Simulates from timestep start to stop. | |
SimulationState | simulationState (SUMOTime stopTime) const |
Called after a simulation step, this method returns the current simulation state. | |
void | simulationStep () |
Performs a single simulation step. | |
void | writeOutput () |
Write netstate, summary and detector output. | |
virtual | ~MSNet () |
Destructor. | |
Output during the simulation | |
void | preSimStepOutput () const |
Prints the current step number. | |
void | postSimStepOutput () const |
Prints the statistics of the step at its end. | |
Retrieval of references to substructures | |
MSVehicleControl & | getVehicleControl () |
Returns the vehicle control. | |
virtual MSPersonControl & | getPersonControl () |
Returns the person control. | |
MSEdgeControl & | getEdgeControl () |
Returns the edge control. | |
MSInsertionControl & | getInsertionControl () |
Returns the insertion control. | |
MSDetectorControl & | getDetectorControl () |
Returns the detector control. | |
MSTLLogicControl & | getTLSControl () |
Returns the tls logics control. | |
MSJunctionControl & | getJunctionControl () |
Returns the junctions control. | |
MSEventControl & | getBeginOfTimestepEvents () |
Returns the event control for events executed at the begin of a time step. | |
MSEventControl & | getEndOfTimestepEvents () |
Returns the event control for events executed at the end of a time step. | |
MSEventControl & | getInsertionEvents () |
Returns the event control for insertion events. | |
ShapeContainer & | getShapeContainer () |
Returns the shapes container. | |
MSEdgeWeightsStorage & | getWeightsStorage () |
Returns the net's internal edge travel times/efforts container. | |
Insertion and retrieval of bus stops | |
bool | addBusStop (MSBusStop *busStop) |
Adds a bus stop. | |
MSBusStop * | getBusStop (const std::string &id) const |
Returns the named bus stop. | |
std::string | getBusStopID (const MSLane *lane, const SUMOReal pos) const |
Returns the bus stop close to the given position. |
Static Public Member Functions | |
static void | clearAll () |
Clears all dictionaries. | |
static SUMOReal | getEffort (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t) |
Returns the effort to pass an edge. | |
static MSNet * | getInstance () |
Returns the pointer to the unique instance of MSNet (singleton). | |
static std::string | getStateMessage (SimulationState state) |
Returns the message to show if a certain state occurs. | |
static SUMOReal | getTravelTime (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t) |
Returns the travel time to pass an edge. |
Protected Attributes | |
NamedObjectCont< MSBusStop * > | myBusStopDict |
Dictionary of bus stops. | |
SUMORouteLoaderControl * | myRouteLoaders |
Route loader for dynamic loading of routes. | |
DijkstraRouterEffort_ByProxi < MSEdge, SUMOVehicle, prohibited_withRestrictions < MSEdge, SUMOVehicle > > * | myRouterEffort |
AStarRouterTT_ByProxi< MSEdge, SUMOVehicle, prohibited_withRestrictions < MSEdge, SUMOVehicle > > * | myRouterTTAStar |
DijkstraRouterTT_ByProxi < MSEdge, SUMOVehicle, prohibited_withRestrictions < MSEdge, SUMOVehicle > > * | myRouterTTDijkstra |
bool | myRouterTTInitialized |
SUMOTime | myStep |
Current time step. | |
int | myTooManyVehicles |
Storage for maximum vehicle number. | |
std::vector < VehicleStateListener * > | myVehicleStateListeners |
Container for vehicle state listener. | |
Substructures | |
MSVehicleControl * | myVehicleControl |
Controls vehicle building and deletion;. | |
MSPersonControl * | myPersonControl |
Controls person building and deletion;. | |
MSEdgeControl * | myEdges |
Controls edges, performs vehicle movement;. | |
MSJunctionControl * | myJunctions |
Controls junctions, realizes right-of-way rules;. | |
MSTLLogicControl * | myLogics |
Controls tls logics, realizes waiting on tls rules;. | |
MSInsertionControl * | myInserter |
Controls vehicle insertion;. | |
MSDetectorControl * | myDetectorControl |
Controls detectors;. | |
MSEventControl * | myBeginOfTimestepEvents |
Controls events executed at the begin of a time step;. | |
MSEventControl * | myEndOfTimestepEvents |
Controls events executed at the end of a time step;. | |
MSEventControl * | myInsertionEvents |
Controls insertion events;. | |
ShapeContainer * | myShapeContainer |
A container for geometrical shapes;. | |
MSEdgeWeightsStorage * | myEdgeWeights |
The net's knowledge about edge efforts/travel times;. | |
data needed for computing performance values | |
bool | myLogExecutionTime |
Information whether the simulation duration shall be logged. | |
bool | myLogStepNumber |
Information whether the number of the simulation step shall be logged. | |
long | mySimStepBegin |
The last simulation step begin, end and duration. | |
long | mySimStepEnd |
long | mySimStepDuration |
long | mySimBeginMillis |
The overall simulation duration. | |
SUMOLong | myVehiclesMoved |
The overall number of vehicle movements. | |
State output variables | |
std::vector< SUMOTime > | myStateDumpTimes |
Times at which a state shall be written. | |
std::vector< std::string > | myStateDumpFiles |
The names for the state files. |
Static Protected Attributes | |
static MSNet * | myInstance = 0 |
Unique instance of MSNet. |
Private Member Functions | |
MSNet (const MSNet &) | |
Invalidated copy constructor. | |
MSNet & | operator= (const MSNet &) |
Invalidated assignment operator. |
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 } |
Definition of a vehicle state. More... | |
void | addVehicleStateListener (VehicleStateListener *listener) |
Adds a vehicle states listener. | |
void | removeVehicleStateListener (VehicleStateListener *listener) |
Removes a vehicle states listener. | |
void | informVehicleStateListener (const SUMOVehicle *const vehicle, VehicleState to) |
Informs all added listeners about a vehicle's state change. |
Possible states of a simulation - running or stopped with different reasons.
enum MSNet::VehicleState |
Definition of a vehicle state.
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".
[in] | vc | The vehicle control to use |
[in] | beginOfTimestepEvents | The event control to use for simulation step begin events |
[in] | endOfTimestepEvents | The event control to use for simulation step end events |
[in] | insertionEvents | The event control to use for insertion events |
[in] | shapeCont | The shape container to use |
ProcessError | If a network was already constructed |
Definition at line 163 of file MSNet.cpp.
References OptionsCont::getBool(), OptionsCont::getInt(), OptionsCont::getOptions(), OptionsCont::getString(), MSGlobals::gUseMesoSim, myBeginOfTimestepEvents, myDetectorControl, myEdges, myEdgeWeights, myEndOfTimestepEvents, myInserter, myInsertionEvents, myInstance, myJunctions, myLogExecutionTime, myLogics, myLogStepNumber, myPersonControl, myRouteLoaders, myShapeContainer, myStep, myTooManyVehicles, myVehicleControl, and string2time().
|
virtual |
Destructor.
Definition at line 229 of file MSNet.cpp.
References clearAll(), MSGlobals::gUseMesoSim, myBeginOfTimestepEvents, myDetectorControl, myEdges, myEdgeWeights, myEndOfTimestepEvents, myInserter, myInsertionEvents, myInstance, myJunctions, myLogics, myPersonControl, myRouteLoaders, myRouterEffort, myRouterTTAStar, myRouterTTDijkstra, myShapeContainer, and myVehicleControl.
|
private |
Invalidated copy constructor.
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.
[in] | busStop | The bus stop to add |
Definition at line 665 of file MSNet.cpp.
References NamedObjectCont< T >::add(), Named::getID(), and myBusStopDict.
Referenced by NLTriggerBuilder::buildBusStop().
void MSNet::addVehicleStateListener | ( | VehicleStateListener * | listener | ) |
Adds a vehicle states listener.
[in] | listener | The listener to add |
Definition at line 638 of file MSNet.cpp.
References myVehicleStateListeners.
Referenced by MSDevice_Vehroutes::init().
|
static |
Clears all dictionaries.
Definition at line 492 of file MSNet.cpp.
References MSTrigger::cleanup(), MSCalibrator::cleanup(), MSDevice_Routing::cleanup(), MSRoute::clear(), MSLane::clear(), MSEdge::clear(), and getInstance().
Referenced by GUILoadThread::run(), and ~MSNet().
void MSNet::closeBuilding | ( | MSEdgeControl * | edges, |
MSJunctionControl * | junctions, | ||
SUMORouteLoaderControl * | routeLoaders, | ||
MSTLLogicControl * | tlc, | ||
std::vector< SUMOTime > | stateDumpTimes, | ||
std::vector< std::string > | stateDumpFiles | ||
) |
Closes the network's building process.
Assigns the structures built while loading to this network.
[in] | edges | The control of edges which belong to this network |
[in] | junctions | The control of junctions which belong to this network |
[in] | routeLoaders | The route loaders used |
[in] | tlc | The control of traffic lights which belong to this network |
[in] | stateDumpTimes | List of time steps at which state shall be written |
[in] | stateDumpFiles | Filenames for states |
Definition at line 206 of file MSNet.cpp.
References SysUtils::getCurrentMillis(), myEdges, myJunctions, myLogExecutionTime, myLogics, myRouteLoaders, mySimBeginMillis, myStateDumpFiles, myStateDumpTimes, and MSJunctionControl::postloadInitContainer().
Referenced by NLBuilder::buildNet().
void MSNet::closeSimulation | ( | SUMOTime | start | ) |
Closes the simulation (all files, connections, etc.)
Writes also performance output
[in] | start | The step the simulation was started with |
Definition at line 310 of file MSNet.cpp.
References MSDetectorControl::close(), traci::TraCIServer::close(), MSDevice_Vehroutes::generateOutputForUnfinished(), MSVehicleControl::getCollisionCount(), SysUtils::getCurrentMillis(), MSVehicleControl::getDepartedVehicleNo(), MSVehicleControl::getLoadedVehicleNo(), OptionsCont::getOptions(), MSVehicleControl::getRunningVehicleNo(), MSVehicleControl::getTeleportCount(), MSInsertionControl::getWaitingVehicleNo(), myDetectorControl, myInserter, myLogExecutionTime, mySimBeginMillis, myStep, myVehicleControl, myVehiclesMoved, STEPS2TIME, SUMOReal, toString(), and WRITE_MESSAGE.
Referenced by GUIRunThread::deleteSim(), and simulate().
|
inline |
Returns the event control for events executed at the begin of a time step.
Definition at line 319 of file MSNet.h.
References myBeginOfTimestepEvents.
Referenced by NLTriggerBuilder::buildVaporizer(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSTLLogicControl::closeWAUT(), MSLaneSpeedTrigger::init(), MSTrafficLightLogic::MSTrafficLightLogic(), MSDevice_Routing::notifyEnter(), and MSPerson::MSPersonStage_Walking::proceed().
MSBusStop * MSNet::getBusStop | ( | const std::string & | id | ) | const |
Returns the named bus stop.
[in] | id | The id of the bus stop to return. |
Definition at line 671 of file MSNet.cpp.
References NamedObjectCont< T >::get(), and myBusStopDict.
Referenced by MSRouteHandler::addStop(), MSVehicle::addStop(), MSRouteHandler::myStartElement(), and TraCIServerAPI_Simulation::processGet().
Returns the bus stop close to the given position.
[in] | lane | the lane of the bus stop to return. |
[in] | pos | the position of the bus stop to return. |
Definition at line 677 of file MSNet.cpp.
References MSBusStop::getEndLanePosition(), Named::getID(), MSBusStop::getLane(), NamedObjectCont< T >::getMyMap(), myBusStopDict, and POSITION_EPS.
Referenced by MSVehicle::addTraciStop().
SUMOTime MSNet::getCurrentTimeStep | ( | ) | const |
Returns the current simulation step (in s)
Definition at line 505 of file MSNet.cpp.
References myStep.
Referenced by MSDevice_Vehroutes::addRoute(), MSTLLogicControl::addWAUTJunction(), NLDetectorBuilder::buildE2Detector(), MSVehicle::checkRewindLinkLanes(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSTLLogicControl::closeWAUT(), MSInductLoop::collectVehiclesOnDet(), TraCIServerAPI_Simulation::commandDistanceRequest(), GUIPerson::drawAction_drawAsImage(), GUIPerson::drawAction_drawAsPoly(), GUIPerson::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), MSPersonControl::erase(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSVehicle::executeMove(), MSActuatedTrafficLightLogic::gapControl(), MSInductLoop::getCurrentOccupancy(), GUIApplicationWindow::getCurrentSimTime(), MSLaneSpeedTrigger::getCurrentSpeed(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), MSLane::getLeaderOnConsecutive(), GUIApplicationWindow::handleEvent_SimulationLoaded(), GUIApplicationWindow::handleEvent_SimulationStep(), MSLaneSpeedTrigger::init(), traci::TraCIServer::initialiseSubscription(), MSTLLogicControl::initWautSwitch(), MSLane::isInsertionSuccess(), GUIRunThread::makeStep(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSTriggeredXMLReader::myInit(), MSDevice_Vehroutes::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), MSDevice_Person::notifyMove(), MSBaseVehicle::onDepart(), MSVehicle::planMove(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_TLS::processSet(), MSTrafficLightLogic::resetLinkStates(), GUIRunThread::run(), simulate(), MSSimpleTrafficLightLogic::trySwitch(), and MSActuatedTrafficLightLogic::trySwitch().
|
inline |
Returns the detector control.
Definition at line 289 of file MSNet.h.
References myDetectorControl.
Referenced by NLDetectorBuilder::buildE2Detector(), NLDetectorBuilder::buildInductLoop(), NLDetectorBuilder::buildInstantInductLoop(), NLDetectorBuilder::buildRouteProbe(), NLDetectorBuilder::createEdgeLaneMeanData(), NLDetectorBuilder::endE3Detector(), TraCIServerAPI_InductionLoop::getPosition(), TraCIServerAPI_InductionLoop::getTree(), TraCIServerAPI_InductionLoop::processGet(), and TraCIServerAPI_MeMeDetector::processGet().
|
inline |
Returns the edge control.
Definition at line 269 of file MSNet.h.
References myEdges.
Referenced by MSDevice_Routing::adaptEdgeEfforts(), MSDevice_Routing::buildVehicleDevices(), TraCIServerAPI_Simulation::convertCartesianToRoadMap(), TraCIServerAPI_Vehicle::getOrBuildVTDMap(), TraCIServerAPI_Edge::getTree(), TraCIServerAPI_Lane::getTree(), MSLane::incorporateVehicle(), MSMeanData::init(), MSQueueExport::writeEdge(), and MSFullExport::writeEdge().
|
static |
Returns the effort to pass an edge.
[in] | e | The edge for which the effort to be passed shall be returned |
[in] | v | The vehicle that is rerouted |
[in] | t | The time for which the effort shall be returned [s] |
Definition at line 123 of file MSNet.cpp.
References getInstance(), MSVehicle::getWeightsStorage(), getWeightsStorage(), MSEdgeWeightsStorage::retrieveExistingEffort(), and SUMOReal.
Referenced by getRouterEffort().
|
inline |
Returns the event control for events executed at the end of a time step.
Definition at line 329 of file MSNet.h.
References myEndOfTimestepEvents.
Referenced by MSDevice_Routing::buildVehicleDevices(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), MSCalibrator::init(), and MSVTypeProbe::MSVTypeProbe().
|
inline |
Returns the insertion control.
Definition at line 279 of file MSNet.h.
References myInserter.
Referenced by MSRouteHandler::closeFlow(), MSRouteHandler::closeVehicle(), GUINet::getParameterWindow(), MSLane::isInsertionSuccess(), MSPerson::MSPersonStage_Driving::proceed(), and TraCIServerAPI_Vehicle::processSet().
|
inline |
Returns the event control for insertion events.
Definition at line 339 of file MSNet.h.
References myInsertionEvents.
Referenced by MSDevice_Routing::MSDevice_Routing(), and MSTriggeredXMLReader::MSTriggeredXMLReader().
|
static |
Returns the pointer to the unique instance of MSNet (singleton).
ProcessError | If a network was not yet constructed |
Definition at line 155 of file MSNet.cpp.
References myInstance.
Referenced by MSDevice_Routing::adaptEdgeEfforts(), MSInsertionControl::add(), MSTrafficLightLogic::addLink(), MSTLLogicControl::TLSLogicVariants::addLogic(), MSDevice_Vehroutes::addRoute(), MSRouteHandler::addStop(), MSVehicle::addStop(), MSVehicle::addTraciStop(), MSTLLogicControl::addWAUTJunction(), GUITrafficLightLogicWrapper::begin2TrackPhases(), NLTriggerBuilder::buildVaporizer(), GUIVehicleControl::buildVehicle(), MSVehicleControl::buildVehicle(), MSDevice_HBEFA::buildVehicleDevices(), MSDevice_Routing::buildVehicleDevices(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSInsertionControl::checkFlows(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), clearAll(), MSRouteHandler::closeFlow(), MSRouteHandler::closePerson(), MSRouteHandler::closeRoute(), MSRouteHandler::closeVehicle(), MSRouteHandler::closeVehicleTypeDistribution(), MSTLLogicControl::closeWAUT(), MSInductLoop::collectVehiclesOnDet(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), traci::TraCIServer::commandAddVehicle(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::convertCartesianToRoadMap(), NLDetectorBuilder::createEdgeLaneMeanData(), MSLane::detectCollisions(), GUIPerson::drawAction_drawAsImage(), GUIPerson::drawAction_drawAsPoly(), GUITrafficLightLogicWrapper::drawGL(), GUIPerson::drawGL(), GUILaneWrapper::drawGL(), GUITriggeredRerouter::GUITriggeredRerouterEdge::drawGL(), MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), MSPersonControl::erase(), MSCalibrator::execute(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSVTypeProbe::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), MSActuatedTrafficLightLogic::gapControl(), MSDevice_Vehroutes::generateOutput(), GUIPerson::getCenteringBoundary(), GUILaneWrapper::getColorValue(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSLaneSpeedTrigger::getCurrentSpeed(), MSInductLoop::getCurrentSpeed(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), MSInductLoop::getCurrentVehicleIDs(), getEffort(), GUINet::getGUIInstance(), MSLane::getLeaderOnConsecutive(), TraCIServerAPI_Vehicle::getOrBuildVTDMap(), MSTLLogicControl::getPhaseDef(), TraCIServerAPI_POI::getPoI(), TraCIServerAPI_Polygon::getPolygon(), TraCIServerAPI_InductionLoop::getPosition(), TraCIServerAPI_Junction::getPosition(), TraCIServerAPI_Vehicle::getPosition(), MSVTKExport::getPositions(), MSVTKExport::getSpeed(), GUILaneWrapper::getStoredEdgeTravelTime(), MSInductLoop::getTimestepsSinceLastDetection(), getTravelTime(), TraCIServerAPI_Junction::getTree(), TraCIServerAPI_InductionLoop::getTree(), TraCIServerAPI_Edge::getTree(), TraCIServerAPI_POI::getTree(), TraCIServerAPI_Lane::getTree(), TraCIServerAPI_Polygon::getTree(), MSLane::incorporateVehicle(), MSDevice_Vehroutes::init(), MSCalibrator::init(), MSLaneSpeedTrigger::init(), MSMeanData::init(), traci::TraCIServer::initialiseSubscription(), MSTLLogicControl::initWautSwitch(), MSLane::isInsertionSuccess(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), MSDevice_Routing::MSDevice_Routing(), MSTrafficLightLogic::MSTrafficLightLogic(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSVehicle::MSVehicle(), MSVTypeProbe::MSVTypeProbe(), MSRouteHandler::myEndElement(), MSTriggeredXMLReader::myInit(), MSRouteHandler::myStartElement(), MSCalibrator::myStartElement(), MSDevice_Vehroutes::notifyEnter(), MSDevice_Person::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Routing::notifyEnter(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), MSInstantInductLoop::notifyLeave(), MSDevice_Person::notifyMove(), MSInstantInductLoop::notifyMove(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSInductLoop::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), GUIViewTraffic::onGamingClick(), MSRouteHandler::openVehicleTypeDistribution(), MSVehicle::planMove(), traci::TraCIServer::postProcessVTD(), MSPerson::MSPersonStage_Walking::proceed(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_VehicleType::processSet(), MSCalibrator::remainingVehicleCapacity(), MSVehicle::replaceRoute(), MSTrafficLightLogic::resetLinkStates(), MSVehicleControl::scheduleVehicleRemoval(), GUIVehicle::setFunctionalColor(), MSLaneSpeedTrigger::setOverriding(), MSLaneSpeedTrigger::setOverridingValue(), simulationStep(), MSSimpleTrafficLightLogic::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSVehicleControl::vehicleDeparted(), MSFCDExport::write(), MSEmissionExport::write(), MSMeanData_HBEFA::MSLaneMeanDataValues::write(), MSQueueExport::writeEdge(), MSFullExport::writeEdge(), writeOutput(), MSFullExport::writeTLS(), and MSFullExport::writeVehicles().
|
inline |
Returns the junctions control.
Definition at line 309 of file MSNet.h.
References myJunctions.
Referenced by TraCIServerAPI_Junction::getPosition(), TraCIServerAPI_Junction::getTree(), and TraCIServerAPI_Junction::processGet().
|
virtual |
Returns the person control.
If the person control does not exist, yet, it is created.
Reimplemented in GUINet.
Definition at line 589 of file MSNet.cpp.
References myPersonControl.
Referenced by MSRouteHandler::closePerson(), MSPerson::MSPersonStage_Walking::moveToNextEdge(), MSDevice_Person::notifyLeave(), MSDevice_Person::notifyMove(), MSPerson::MSPersonStage_Walking::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSPerson::MSPersonStage_Waiting::proceed(), and MSVehicle::processNextStop().
SUMOAbstractRouter< MSEdge, SUMOVehicle > & MSNet::getRouterEffort | ( | const std::vector< MSEdge * > & | prohibited = std::vector<MSEdge*>() | ) | const |
Definition at line 717 of file MSNet.cpp.
References getEffort(), getTravelTime(), myRouterEffort, MSEdge::numericalDictSize(), and prohibited_withRestrictions< E, V >::prohibit().
SUMOAbstractRouter< MSEdge, SUMOVehicle > & MSNet::getRouterTT | ( | const std::vector< MSEdge * > & | prohibited = std::vector<MSEdge*>() | ) | const |
Definition at line 690 of file MSNet.cpp.
References OptionsCont::getOptions(), OptionsCont::getString(), getTravelTime(), myRouterTTAStar, myRouterTTDijkstra, myRouterTTInitialized, MSEdge::numericalDictSize(), prohibited_withRestrictions< E, V >::prohibit(), and WRITE_WARNING.
Referenced by TraCIServerAPI_Simulation::commandDistanceRequest(), MSRouteHandler::myStartElement(), MSTriggeredRerouter::notifyEnter(), and TraCIServerAPI_Vehicle::processSet().
|
inline |
Returns the shapes container.
Definition at line 349 of file MSNet.h.
References myShapeContainer.
Referenced by NLHandler::addPOI(), NLHandler::addPoly(), TraCIServerAPI_POI::getPoI(), TraCIServerAPI_Polygon::getPolygon(), TraCIServerAPI_POI::getTree(), TraCIServerAPI_Polygon::getTree(), GUISUMOViewParent::onCmdLocate(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_POI::processSet(), and TraCIServerAPI_Polygon::processSet().
|
static |
Returns the message to show if a certain state occurs.
Definition at line 471 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(), and simulate().
|
inline |
Returns the tls logics control.
Definition at line 299 of file MSNet.h.
References myLogics.
Referenced by NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), NLJunctionControlBuilder::getTLLogicControlToUse(), GUINet::initTLMap(), GUIViewTraffic::onGamingClick(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_TLS::processSet(), and MSFullExport::writeTLS().
|
static |
Returns the travel time to pass an edge.
[in] | e | The edge for which the travel time to be passed shall be returned |
[in] | v | The vehicle that is rerouted |
[in] | t | The time for which the travel time shall be returned [s] |
Definition at line 137 of file MSNet.cpp.
References getInstance(), MSEdge::getMinimumTravelTime(), MSVehicle::getWeightsStorage(), getWeightsStorage(), MSEdgeWeightsStorage::retrieveExistingTravelTime(), and SUMOReal.
Referenced by MSDevice_Routing::buildVehicleDevices(), getRouterEffort(), and getRouterTT().
|
inline |
Returns the vehicle control.
Definition at line 248 of file MSNet.h.
References myVehicleControl.
Referenced by MSInsertionControl::add(), MSDevice_HBEFA::buildVehicleDevices(), MSDevice_Routing::buildVehicleDevices(), MSInsertionControl::checkFlows(), MSRouteHandler::closePerson(), MSRouteHandler::closeVehicle(), traci::TraCIServer::commandAddVehicle(), MSLane::detectCollisions(), MSCalibrator::execute(), MSVTypeProbe::execute(), MSLane::executeMovements(), GUINet::getParameterWindow(), TraCIServerAPI_Vehicle::getPosition(), MSVTKExport::getPositions(), MSVTKExport::getSpeed(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), MSRouteHandler::openVehicleTypeDistribution(), traci::TraCIServer::postProcessVTD(), MSPerson::MSPersonStage_Driving::proceed(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_VehicleType::processSet(), MSCalibrator::remainingVehicleCapacity(), GUINet::setSimDuration(), MSEmissionExport::write(), MSFCDExport::write(), MSMeanData_HBEFA::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.
Definition at line 598 of file MSNet.cpp.
References myEdgeWeights.
Referenced by NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight(), NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight(), GUILaneWrapper::getColorValue(), getEffort(), GUILaneWrapper::getStoredEdgeTravelTime(), getTravelTime(), and TraCIServerAPI_Edge::processSet().
void MSNet::informVehicleStateListener | ( | const SUMOVehicle *const | vehicle, |
VehicleState | to | ||
) |
Informs all added listeners about a vehicle's state change.
[in] | vehicle | The vehicle which changed its state |
[in] | to | The state the vehicle has changed to |
Definition at line 655 of file MSNet.cpp.
References myVehicleStateListeners.
Referenced by GUIVehicleControl::buildVehicle(), MSVehicleControl::buildVehicle(), MSVehicle::replaceRoute(), MSVehicleControl::scheduleVehicleRemoval(), and MSVehicleControl::vehicleDeparted().
bool MSNet::logSimulationDuration | ( | ) | const |
Returns whether duration shall be logged.
Definition at line 583 of file MSNet.cpp.
References myLogExecutionTime.
Referenced by GUINet::getParameterWindow().
void MSNet::postSimStepOutput | ( | ) | const |
Prints the statistics of the step at its end.
Called on the end of a simulation step
Definition at line 613 of file MSNet.cpp.
References DELTA_T, MSVehicleControl::getDepartedVehicleNo(), MSVehicleControl::getRunningVehicleNo(), myLogExecutionTime, mySimStepDuration, myStep, myVehicleControl, OUTPUT_ACCURACY, SUMOReal, and time2string().
Referenced by simulate().
void MSNet::preSimStepOutput | ( | ) | const |
Prints the current step number.
Called on the begin of a simulation step
Definition at line 607 of file MSNet.cpp.
References myStep, and time2string().
Referenced by simulate().
void MSNet::removeVehicleStateListener | ( | VehicleStateListener * | listener | ) |
Removes a vehicle states listener.
[in] | listener | The listener to remove |
Definition at line 646 of file MSNet.cpp.
References myVehicleStateListeners.
Simulates from timestep start to stop.
[in] | start | The begin time step of the simulation |
[in] | stop | The end time step of the simulation |
Recheck return value
What exceptions may occure?
Definition at line 266 of file MSNet.cpp.
References closeSimulation(), getCurrentTimeStep(), OptionsCont::getOptions(), getStateMessage(), myLogStepNumber, myStep, postSimStepOutput(), preSimStepOutput(), SIMSTATE_RUNNING, simulationState(), simulationStep(), time2string(), traci::TraCIServer::wasClosed(), and WRITE_MESSAGE.
Referenced by main().
MSNet::SimulationState MSNet::simulationState | ( | SUMOTime | stopTime | ) | const |
Called after a simulation step, this method returns the current simulation state.
[in] | stopTime | The time the simulation shall stop at |
Definition at line 440 of file MSNet.cpp.
References MSPersonControl::abortWaiting(), MSVehicleControl::abortWaiting(), MSVehicleControl::getActiveVehicleCount(), OptionsCont::getInt(), OptionsCont::getOptions(), MSInsertionControl::getPendingFlowCount(), MSVehicleControl::getRunningVehicleNo(), MSPersonControl::hasNonWaiting(), MSEventControl::isEmpty(), myInserter, myInsertionEvents, myPersonControl, myStep, myTooManyVehicles, myVehicleControl, SIMSTATE_CONNECTION_CLOSED, SIMSTATE_END_STEP_REACHED, SIMSTATE_NO_FURTHER_VEHICLES, SIMSTATE_RUNNING, SIMSTATE_TOO_MANY_VEHICLES, and traci::TraCIServer::wasClosed().
Referenced by GUIRunThread::makeStep(), and simulate().
void MSNet::simulationStep | ( | ) |
Performs a single simulation step.
Reimplemented in GUINet.
Definition at line 349 of file MSNet.cpp.
References MSEdgeControl::changeLanes(), MSTLLogicControl::check2Switch(), MSPersonControl::checkWaitingPersons(), DELTA_T, MSEdgeControl::detectCollisions(), MSInsertionControl::emitVehicles(), MSEventControl::execute(), MSEdgeControl::executeMovements(), MSGlobals::gCheck4Accidents, SysUtils::getCurrentMillis(), traci::TraCIServer::getInstance(), getInstance(), MSVehicleControl::getRunningVehicleNo(), traci::TraCIServer::getTargetTime(), MSGlobals::gUseMesoSim, SUMORouteLoaderControl::loadNext(), myBeginOfTimestepEvents, myEdges, myEndOfTimestepEvents, myInserter, myInsertionEvents, myLogExecutionTime, myLogics, myPersonControl, myRouteLoaders, mySimStepBegin, mySimStepDuration, mySimStepEnd, myStateDumpFiles, myStateDumpTimes, myStep, myVehicleControl, myVehiclesMoved, MSEdgeControl::patchActiveLanes(), MSEdgeControl::planMovements(), traci::TraCIServer::processCommandsUntilSimStep(), and writeOutput().
Referenced by simulate().
void MSNet::writeOutput | ( | ) |
Write netstate, summary and detector output.
Definition at line 511 of file MSNet.cpp.
References DELTA_T, MSVehicleControl::getDepartedVehicleNo(), OutputDevice::getDeviceByOption(), MSVehicleControl::getEndedVehicleNo(), getInstance(), MSVehicleControl::getLoadedVehicleNo(), OptionsCont::getOptions(), MSVehicleControl::getRunningVehicleNo(), OptionsCont::getString(), getVehicleControl(), MSInsertionControl::getWaitingVehicleNo(), myDetectorControl, myEdges, myInserter, myLogExecutionTime, mySimStepDuration, myStep, myVehicleControl, MSVehicleControl::printMeanTravelTime(), MSVehicleControl::printMeanWaitingTime(), time2string(), MSDetectorControl::updateDetectors(), MSVTKExport::write(), MSQueueExport::write(), MSFCDExport::write(), MSEmissionExport::write(), MSFullExport::write(), MSXMLRawOut::write(), and MSDetectorControl::writeOutput().
Referenced by simulationStep().
|
protected |
Controls events executed at the begin of a time step;.
Definition at line 548 of file MSNet.h.
Referenced by getBeginOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().
|
protected |
Dictionary of bus stops.
Definition at line 597 of file MSNet.h.
Referenced by addBusStop(), getBusStop(), and getBusStopID().
|
protected |
Controls detectors;.
Definition at line 546 of file MSNet.h.
Referenced by closeSimulation(), getDetectorControl(), GUINet::initGUIStructures(), MSNet(), writeOutput(), and ~MSNet().
|
protected |
Controls edges, performs vehicle movement;.
Definition at line 538 of file MSNet.h.
Referenced by closeBuilding(), getEdgeControl(), MSNet(), simulationStep(), writeOutput(), and ~MSNet().
|
protected |
The net's knowledge about edge efforts/travel times;.
Definition at line 556 of file MSNet.h.
Referenced by getWeightsStorage(), MSNet(), and ~MSNet().
|
protected |
Controls events executed at the end of a time step;.
Definition at line 550 of file MSNet.h.
Referenced by getEndOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().
|
protected |
Controls vehicle insertion;.
Definition at line 544 of file MSNet.h.
Referenced by closeSimulation(), getInsertionControl(), MSNet(), simulationState(), simulationStep(), writeOutput(), and ~MSNet().
|
protected |
Controls insertion events;.
Definition at line 552 of file MSNet.h.
Referenced by getInsertionEvents(), MSNet(), simulationState(), simulationStep(), and ~MSNet().
|
staticprotected |
|
protected |
Controls junctions, realizes right-of-way rules;.
Definition at line 540 of file MSNet.h.
Referenced by closeBuilding(), getJunctionControl(), GUINet::getJunctionPosition(), GUINet::initGUIStructures(), MSNet(), and ~MSNet().
|
protected |
Information whether the simulation duration shall be logged.
Definition at line 565 of file MSNet.h.
Referenced by closeBuilding(), closeSimulation(), logSimulationDuration(), MSNet(), postSimStepOutput(), simulationStep(), and writeOutput().
|
protected |
Controls tls logics, realizes waiting on tls rules;.
Definition at line 542 of file MSNet.h.
Referenced by closeBuilding(), GUINet::createTLWrapper(), GUINet::getLinkTLID(), GUINet::getLinkTLIndex(), getTLSControl(), MSNet(), simulationStep(), and ~MSNet().
|
protected |
Information whether the number of the simulation step shall be logged.
Definition at line 568 of file MSNet.h.
Referenced by MSNet(), and simulate().
|
protected |
Controls person building and deletion;.
Definition at line 536 of file MSNet.h.
Referenced by GUINet::getPersonControl(), getPersonControl(), MSNet(), simulationState(), simulationStep(), and ~MSNet().
|
protected |
Route loader for dynamic loading of routes.
Definition at line 523 of file MSNet.h.
Referenced by closeBuilding(), MSNet(), simulationStep(), and ~MSNet().
|
mutableprotected |
Definition at line 618 of file MSNet.h.
Referenced by getRouterEffort(), and ~MSNet().
|
mutableprotected |
Definition at line 617 of file MSNet.h.
Referenced by getRouterTT(), and ~MSNet().
|
mutableprotected |
Definition at line 616 of file MSNet.h.
Referenced by getRouterTT(), and ~MSNet().
|
mutableprotected |
Definition at line 615 of file MSNet.h.
Referenced by getRouterTT().
|
protected |
A container for geometrical shapes;.
Definition at line 554 of file MSNet.h.
Referenced by getShapeContainer(), MSNet(), and ~MSNet().
|
protected |
The overall simulation duration.
Definition at line 574 of file MSNet.h.
Referenced by closeBuilding(), and closeSimulation().
|
protected |
The last simulation step begin, end and duration.
Definition at line 571 of file MSNet.h.
Referenced by simulationStep().
|
protected |
Definition at line 571 of file MSNet.h.
Referenced by postSimStepOutput(), simulationStep(), and writeOutput().
|
protected |
Definition at line 571 of file MSNet.h.
Referenced by simulationStep().
|
protected |
The names for the state files.
Definition at line 588 of file MSNet.h.
Referenced by closeBuilding(), and simulationStep().
|
protected |
Times at which a state shall be written.
Definition at line 586 of file MSNet.h.
Referenced by closeBuilding(), and simulationStep().
|
protected |
Current time step.
Definition at line 526 of file MSNet.h.
Referenced by closeSimulation(), getCurrentTimeStep(), MSNet(), postSimStepOutput(), preSimStepOutput(), simulate(), simulationState(), simulationStep(), and writeOutput().
|
protected |
Storage for maximum vehicle number.
Definition at line 593 of file MSNet.h.
Referenced by MSNet(), and simulationState().
|
protected |
Controls vehicle building and deletion;.
Definition at line 534 of file MSNet.h.
Referenced by closeSimulation(), GUINet::getGUIVehicleControl(), getVehicleControl(), MSNet(), postSimStepOutput(), simulationState(), simulationStep(), GUINet::vehicleExists(), writeOutput(), and ~MSNet().
|
protected |
The overall number of vehicle movements.
Definition at line 577 of file MSNet.h.
Referenced by closeSimulation(), GUINet::getMeanUPS(), and simulationStep().
|
protected |
Container for vehicle state listener.
Definition at line 600 of file MSNet.h.
Referenced by addVehicleStateListener(), informVehicleStateListener(), and removeVehicleStateListener().