|
SUMO - Simulation of Urban MObility
|
The simulated network and simulation perfomer. More...
#include <MSNet.h>
Data Structures | |
| class | EdgeWeightsProxi |
| A proxi for edge weights known by a vehicle/known globally. More... | |
| 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, MSRouteLoaderControl *routeLoaders, MSTLLogicControl *tlc, std::vector< SUMOTime > stateDumpTimes, std::vector< std::string > stateDumpFiles) throw () |
| 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) | |
| bool | logSimulationDuration () const throw () |
| Returns whether duration shall be logged. | |
| MSNet (MSVehicleControl *vc, MSEventControl *beginOfTimestepEvents, MSEventControl *endOfTimestepEvents, MSEventControl *insertionEvents, ShapeContainer *shapeCont=0) throw (ProcessError) | |
| Constructor. | |
| int | simulate (SUMOTime start, SUMOTime stop) |
| Simulates from timestep start to stop. | |
| SimulationState | simulationState (SUMOTime stopTime) const throw () |
| Called after a simulation step, this method returns the current simulation state. | |
| void | simulationStep () |
| Performs a single simulation step. | |
| void | writeOutput () |
| Write netstate, emission and detector output. | |
| virtual | ~MSNet () throw () |
| Destructor. | |
Output during the simulation | |
| void | preSimStepOutput () const throw () |
| Prints the current step number. | |
| void | postSimStepOutput () const throw () |
| Prints the statistics of the step at its end. | |
Retrieval of references to substructures | |
| MSVehicleControl & | getVehicleControl () throw () |
| Returns the vehicle control. | |
| MSPersonControl & | getPersonControl () throw () |
| Returns the person control. | |
| MSEdgeControl & | getEdgeControl () throw () |
| Returns the edge control. | |
| MSInsertionControl & | getInsertionControl () throw () |
| Returns the insertion control. | |
| MSDetectorControl & | getDetectorControl () throw () |
| Returns the detector control. | |
| MSTLLogicControl & | getTLSControl () throw () |
| Returns the tls logics control. | |
| MSJunctionControl & | getJunctionControl () throw () |
| Returns the junctions control. | |
| MSEventControl & | getBeginOfTimestepEvents () throw () |
| Returns the event control for events executed at the begin of a time step. | |
| MSEventControl & | getEndOfTimestepEvents () throw () |
| Returns the event control for events executed at the end of a time step. | |
| MSEventControl & | getInsertionEvents () throw () |
| Returns the event control for insertion events. | |
| ShapeContainer & | getShapeContainer () throw () |
| Returns the shapes container. | |
| MSEdgeWeightsStorage & | getWeightsStorage () throw () |
| 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 MSNet * | getInstance () throw (ProcessError) |
| Returns the pointer to the unique instance of MSNet (singleton). | |
| static std::string | getStateMessage (SimulationState state) throw () |
| Returns the message to show if a certain state occurs. | |
Protected Attributes | |
| NamedObjectCont< MSBusStop * > | myBusStopDict |
| Dictionary of bus stops. | |
| MSRouteLoaderControl * | myRouteLoaders |
| Route loader for dynamic loading of routes. | |
| 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. | |
| long | 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) throw () |
| Adds a vehicle states listener. | |
| void | removeVehicleStateListener (VehicleStateListener *listener) throw () |
| Removes a vehicle states listener. | |
| void | informVehicleStateListener (const SUMOVehicle *const vehicle, VehicleState to) throw () |
| 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 |
||
| ) | throw (ProcessError) |
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 150 of file MSNet.cpp.
References OptionsCont::getBool(), OptionsCont::getInt(), OptionsCont::getOptions(), OptionsCont::getString(), myBeginOfTimestepEvents, myDetectorControl, myEdges, myEdgeWeights, myEndOfTimestepEvents, myInserter, myInsertionEvents, myInstance, myJunctions, myLogExecutionTime, myLogics, myLogStepNumber, myPersonControl, myRouteLoaders, myShapeContainer, myStep, myTooManyVehicles, myVehicleControl, and string2time().
| MSNet::~MSNet | ( | ) | throw () [virtual] |
Destructor.
Definition at line 211 of file MSNet.cpp.
References clearAll(), myBeginOfTimestepEvents, myDetectorControl, myEdges, myEdgeWeights, myEndOfTimestepEvents, myInserter, myInsertionEvents, myInstance, myJunctions, myLogics, myPersonControl, myRouteLoaders, myShapeContainer, and myVehicleControl.
| MSNet::MSNet | ( | const MSNet & | ) | [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 629 of file MSNet.cpp.
References NamedObjectCont< T >::add(), Named::getID(), and myBusStopDict.
| void MSNet::addVehicleStateListener | ( | VehicleStateListener * | listener | ) | throw () |
Adds a vehicle states listener.
| [in] | listener | The listener to add |
Definition at line 602 of file MSNet.cpp.
References myVehicleStateListeners.
Referenced by MSDevice_Vehroutes::init(), and traci::TraCIServer::openSocket().
| void MSNet::clearAll | ( | ) | [static] |
Clears all dictionaries.
Definition at line 447 of file MSNet.cpp.
References MSRoute::clear(), MSLane::clear(), MSEdge::clear(), and getInstance().
Referenced by GUILoadThread::run(), and ~MSNet().
| void MSNet::closeBuilding | ( | MSEdgeControl * | edges, |
| MSJunctionControl * | junctions, | ||
| MSRouteLoaderControl * | routeLoaders, | ||
| MSTLLogicControl * | tlc, | ||
| std::vector< SUMOTime > | stateDumpTimes, | ||
| std::vector< std::string > | stateDumpFiles | ||
| ) | throw () |
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 188 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 283 of file MSNet.cpp.
References traci::TraCIServer::close(), MSDetectorControl::close(), SysUtils::getCurrentMillis(), MSVehicleControl::getDepartedVehicleNo(), MSVehicleControl::getRunningVehicleNo(), MSInsertionControl::getWaitingVehicleNo(), myDetectorControl, myInserter, myLogExecutionTime, mySimBeginMillis, myStep, myVehicleControl, myVehiclesMoved, SUMOReal, and WRITE_MESSAGE.
Referenced by GUIRunThread::deleteSim(), and simulate().
| MSEventControl& MSNet::getBeginOfTimestepEvents | ( | ) | throw () [inline] |
Returns the event control for events executed at the begin of a time step.
Definition at line 329 of file MSNet.h.
References myBeginOfTimestepEvents.
Referenced by NLTriggerBuilder::buildVaporizer(), MSSimpleTrafficLightLogic::changeStepAndDuration(), MSTLLogicControl::closeWAUT(), MSLaneSpeedTrigger::init(), MSTrafficLightLogic::MSTrafficLightLogic(), and MSDevice_Routing::notifyEnter().
| 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 635 of file MSNet.cpp.
References NamedObjectCont< T >::get(), and myBusStopDict.
Referenced by MSVehicle::addStop(), and MSRouteHandler::addStop().
| std::string MSNet::getBusStopID | ( | const MSLane * | lane, |
| const SUMOReal | pos | ||
| ) | const |
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 641 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 457 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(), MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), MSPersonControl::erase(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSUnboundActuatedTrafficLightLogic::gapControl(), MSActuatedTrafficLightLogic::gapControl(), MSInductLoop::getCurrentOccupancy(), GUIApplicationWindow::getCurrentSimTime(), MSLaneSpeedTrigger::getCurrentSpeed(), MSEventControl::getCurrentTimeStep(), GUIViewTraffic::getCurrentTimeStep(), MSLane::getLeaderOnConsecutive(), GUIApplicationWindow::handleEvent_SimulationLoaded(), GUIApplicationWindow::handleEvent_SimulationStep(), MSLaneSpeedTrigger::init(), MSTLLogicControl::initWautSwitch(), MSLane::isInsertionSuccess(), main(), GUIRunThread::makeStep(), MSVehicle::moveChecked(), MSVehicle::moveRegardingCritical(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSTriggeredXMLReader::myInit(), MSTriggeredRerouter::notifyEnter(), MSDevice_Vehroutes::notifyEnter(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSBaseVehicle::onDepart(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_TLS::processSet(), MSTrafficLightLogic::resetLinkStates(), GUIRunThread::run(), MSUnboundActuatedTrafficLightLogic::trySwitch(), MSSimpleTrafficLightLogic::trySwitch(), and MSActuatedTrafficLightLogic::trySwitch().
| MSDetectorControl& MSNet::getDetectorControl | ( | ) | throw () [inline] |
Returns the detector control.
Definition at line 299 of file MSNet.h.
References myDetectorControl.
Referenced by NLDetectorBuilder::buildE2Detector(), NLDetectorBuilder::buildInductLoop(), NLDetectorBuilder::buildInstantInductLoop(), NLDetectorBuilder::buildRouteProbe(), NLDetectorBuilder::createEdgeLaneMeanData(), NLDetectorBuilder::endE3Detector(), TraCIServerAPI_MeMeDetector::processGet(), and TraCIServerAPI_InductionLoop::processGet().
| MSEdgeControl& MSNet::getEdgeControl | ( | ) | throw () [inline] |
Returns the edge control.
Definition at line 279 of file MSNet.h.
References myEdges.
Referenced by MSDevice_Routing::adaptEdgeEfforts(), MSDevice_Routing::buildVehicleDevices(), TraCIServerAPI_Simulation::convertCartesianToRoadMap(), MSLane::incorporateVehicle(), and MSMeanData::init().
| MSEventControl& MSNet::getEndOfTimestepEvents | ( | ) | throw () [inline] |
Returns the event control for events executed at the end of a time step.
Definition at line 339 of file MSNet.h.
References myEndOfTimestepEvents.
Referenced by MSDevice_Routing::buildVehicleDevices(), Command_SaveTLSState::Command_SaveTLSState(), Command_SaveTLSSwitches::Command_SaveTLSSwitches(), Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates(), and MSVTypeProbe::MSVTypeProbe().
| MSInsertionControl& MSNet::getInsertionControl | ( | ) | throw () [inline] |
Returns the insertion control.
Definition at line 289 of file MSNet.h.
References myInserter.
Referenced by MSRouteHandler::closeFlow(), MSRouteHandler::closeVehicle(), GUINet::getParameterWindow(), MSPerson::MSPersonStage_Driving::proceed(), and TraCIServerAPI_Vehicle::processSet().
| MSEventControl& MSNet::getInsertionEvents | ( | ) | throw () [inline] |
Returns the event control for insertion events.
Definition at line 349 of file MSNet.h.
References myInsertionEvents.
Referenced by MSDevice_Routing::MSDevice_Routing(), and MSTriggeredXMLReader::MSTriggeredXMLReader().
| MSNet * MSNet::getInstance | ( | void | ) | throw (ProcessError) [static] |
Returns the pointer to the unique instance of MSNet (singleton).
| ProcessError | If a network was not yet constructed |
Definition at line 142 of file MSNet.cpp.
References myInstance.
Referenced by MSDevice_Routing::adaptEdgeEfforts(), MSInsertionControl::add(), MSTrafficLightLogic::addLink(), MSTLLogicControl::TLSLogicVariants::addLogic(), MSDevice_Vehroutes::addRoute(), MSVehicle::addStop(), MSRouteHandler::addStop(), MSVehicle::addTraciStop(), MSVehicleTransfer::addVeh(), MSTLLogicControl::addWAUTJunction(), GUITrafficLightLogicWrapper::begin2TrackPhases(), NLTriggerBuilder::buildVaporizer(), MSVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), MSDevice_Routing::buildVehicleDevices(), MSDevice_HBEFA::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(), TraCIServerAPI_Simulation::commandDistanceRequest(), TraCIServerAPI_Simulation::convertCartesianToRoadMap(), NLDetectorBuilder::createEdgeLaneMeanData(), MSLane::detectCollisions(), GUITriggeredRerouter::drawGL(), GUITrafficLightLogicWrapper::drawGL(), GUILaneWrapper::drawGL(), MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), MSPersonControl::erase(), MSVTypeProbe::execute(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSUnboundActuatedTrafficLightLogic::gapControl(), MSActuatedTrafficLightLogic::gapControl(), MSDevice_Vehroutes::generateOutput(), GUILaneWrapper::getColorValue(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSLaneSpeedTrigger::getCurrentSpeed(), MSInductLoop::getCurrentSpeed(), MSEventControl::getCurrentTimeStep(), GUIViewTraffic::getCurrentTimeStep(), MSInductLoop::getCurrentVehicleIDs(), TraCIDijkstraRouter< E >::getEffort(), GUINet::getGUIInstance(), MSLane::getLeaderOnConsecutive(), MSTLLogicControl::getPhaseDef(), MSInductLoop::getTimestepsSinceLastDetection(), MSLane::incorporateVehicle(), MSMeanData::init(), MSLaneSpeedTrigger::init(), MSDevice_Vehroutes::init(), MSTLLogicControl::initWautSwitch(), MSLane::isInsertionSuccess(), MSVehicle::moveChecked(), MSLane::moveCritical(), MSVehicle::moveRegardingCritical(), MSDevice_Routing::MSDevice_Routing(), MSInductLoop::MSInductLoop(), MSTrafficLightLogic::MSTrafficLightLogic(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSVehicle::MSVehicle(), MSVTypeProbe::MSVTypeProbe(), MSRouteHandler::myEndElement(), MSTriggeredXMLReader::myInit(), MSTriggeredRerouter::notifyEnter(), MSDevice_Vehroutes::notifyEnter(), MSDevice_Routing::notifyEnter(), MSDevice_Person::notifyEnter(), MSInstantInductLoop::notifyLeave(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), MSInstantInductLoop::notifyMove(), MSInductLoop::notifyMove(), MSE3Collector::MSE3LeaveReminder::notifyMove(), MSE3Collector::MSE3EntryReminder::notifyMove(), MSDevice_Person::notifyMove(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), GUIViewTraffic::onGamingClick(), traci::TraCIServer::openSocket(), MSRouteHandler::openVehicleTypeDistribution(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Simulation::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Edge::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_VehicleType::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_Edge::processSet(), MSVehicle::replaceRoute(), MSTrafficLightLogic::resetLinkStates(), MSVehicleControl::scheduleVehicleRemoval(), MSLane::setCritical(), GUIVehicle::setFunctionalColor(), MSLaneSpeedTrigger::setOverriding(), MSLaneSpeedTrigger::setOverridingValue(), simulationStep(), MSUnboundActuatedTrafficLightLogic::trySwitch(), MSSimpleTrafficLightLogic::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSVehicleControl::vehicleDeparted(), and MSVehicle::vsafeCriticalCont().
| MSJunctionControl& MSNet::getJunctionControl | ( | ) | throw () [inline] |
Returns the junctions control.
Definition at line 319 of file MSNet.h.
References myJunctions.
Referenced by TraCIServerAPI_Junction::processGet().
| MSPersonControl & MSNet::getPersonControl | ( | ) | throw () |
Returns the person control.
If the person control does not exist, yet, it is created.
Definition at line 549 of file MSNet.cpp.
References myPersonControl.
Referenced by MSRouteHandler::closePerson(), MSPerson::proceed(), MSPerson::MSPersonStage_Waiting::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSPerson::MSPersonStage_Walking::proceed(), and MSVehicle::processNextStop().
| ShapeContainer& MSNet::getShapeContainer | ( | ) | throw () [inline] |
Returns the shapes container.
Definition at line 359 of file MSNet.h.
References myShapeContainer.
Referenced by NLHandler::addPOI(), NLHandler::addPoly(), GUISUMOViewParent::onCmdLocate(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Polygon::processSet(), and TraCIServerAPI_POI::processSet().
| std::string MSNet::getStateMessage | ( | MSNet::SimulationState | state | ) | throw () [static] |
Returns the message to show if a certain state occurs.
Definition at line 426 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(), and simulate().
| MSTLLogicControl& MSNet::getTLSControl | ( | ) | throw () [inline] |
Returns the tls logics control.
Definition at line 309 of file MSNet.h.
References myLogics.
Referenced by NLDiscreteEventBuilder::buildSaveTLStateCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchesCommand(), NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand(), NLJunctionControlBuilder::getTLLogicControlToUse(), GUINet::initTLMap(), GUIViewTraffic::onGamingClick(), TraCIServerAPI_TLS::processGet(), and TraCIServerAPI_TLS::processSet().
| MSVehicleControl& MSNet::getVehicleControl | ( | ) | throw () [inline] |
Returns the vehicle control.
Definition at line 258 of file MSNet.h.
References myVehicleControl.
Referenced by MSInsertionControl::add(), MSVehicleTransfer::addVeh(), MSDevice_Routing::buildVehicleDevices(), MSDevice_HBEFA::buildVehicleDevices(), MSInsertionControl::checkFlows(), MSVehicleTransfer::checkInsertions(), MSRouteHandler::closeVehicle(), MSVTypeProbe::execute(), GUINet::getParameterWindow(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), MSRouteHandler::openVehicleTypeDistribution(), MSPerson::MSPersonStage_Driving::proceed(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_VehicleType::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), MSLane::setCritical(), and GUINet::setSimDuration().
| MSEdgeWeightsStorage & MSNet::getWeightsStorage | ( | ) | throw () |
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 558 of file MSNet.cpp.
References myEdgeWeights.
Referenced by GUILaneWrapper::getColorValue(), and TraCIServerAPI_Edge::processSet().
| void MSNet::informVehicleStateListener | ( | const SUMOVehicle *const | vehicle, |
| VehicleState | to | ||
| ) | throw () |
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 619 of file MSNet.cpp.
References myVehicleStateListeners.
Referenced by MSVehicleTransfer::addVeh(), MSVehicleControl::buildVehicle(), GUIVehicleControl::buildVehicle(), MSVehicleTransfer::checkInsertions(), MSVehicle::replaceRoute(), MSVehicleControl::scheduleVehicleRemoval(), and MSVehicleControl::vehicleDeparted().
| bool MSNet::logSimulationDuration | ( | ) | const throw () |
Returns whether duration shall be logged.
Definition at line 495 of file MSNet.cpp.
References myLogExecutionTime.
Referenced by GUINet::getParameterWindow().
| void MSNet::postSimStepOutput | ( | ) | const throw () |
Prints the statistics of the step at its end.
Called on the end of a simulation step
Definition at line 574 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 throw () |
Prints the current step number.
Called on the begin of a simulation step
Definition at line 567 of file MSNet.cpp.
References myStep, OUTPUT_ACCURACY, and time2string().
Referenced by simulate().
| void MSNet::removeVehicleStateListener | ( | VehicleStateListener * | listener | ) | throw () |
Removes a vehicle states listener.
| [in] | listener | The listener to remove |
Definition at line 610 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 244 of file MSNet.cpp.
References closeSimulation(), OptionsCont::getOptions(), getStateMessage(), myLogStepNumber, myStep, postSimStepOutput(), preSimStepOutput(), SIMSTATE_RUNNING, simulationState(), simulationStep(), traci::TraCIServer::wasClosed(), and WRITE_MESSAGE.
Referenced by main().
| MSNet::SimulationState MSNet::simulationState | ( | SUMOTime | stopTime | ) | const throw () |
Called after a simulation step, this method returns the current simulation state.
| [in] | stopTime | The time the simulation shall stop at |
Definition at line 395 of file MSNet.cpp.
References MSVehicleControl::abortWaiting(), MSPersonControl::abortWaiting(), MSVehicleControl::getActiveVehicleCount(), OptionsCont::getInt(), OptionsCont::getOptions(), MSInsertionControl::getPendingFlowCount(), MSVehicleControl::getRunningVehicleNo(), MSPersonControl::hasPedestrians(), 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.
Definition at line 308 of file MSNet.cpp.
References MSEdgeControl::changeLanes(), MSTLLogicControl::check2Switch(), MSPersonControl::checkArrivedPersons(), DELTA_T, MSEdgeControl::detectCollisions(), MSInsertionControl::emitVehicles(), MSEventControl::execute(), MSGlobals::gCheck4Accidents, SysUtils::getCurrentMillis(), getInstance(), MSVehicleControl::getRunningVehicleNo(), MSRouteLoaderControl::loadNext(), MSEdgeControl::moveCritical(), MSEdgeControl::moveFirst(), myBeginOfTimestepEvents, myEdges, myEndOfTimestepEvents, myInserter, myInsertionEvents, myLogExecutionTime, myLogics, myPersonControl, myRouteLoaders, mySimStepBegin, mySimStepDuration, mySimStepEnd, myStateDumpFiles, myStateDumpTimes, myStep, myVehicleControl, myVehiclesMoved, MSEdgeControl::patchActiveLanes(), traci::TraCIServer::processCommandsUntilSimStep(), MSTLLogicControl::setTrafficLightSignals(), and writeOutput().
Referenced by GUIRunThread::makeStep(), and simulate().
| void MSNet::writeOutput | ( | ) |
Write netstate, emission and detector output.
Definition at line 463 of file MSNet.cpp.
References DELTA_T, MSVehicleControl::getDepartedVehicleNo(), OutputDevice::getDeviceByOption(), MSVehicleControl::getEndedVehicleNo(), MSVehicleControl::getLoadedVehicleNo(), OptionsCont::getOptions(), MSVehicleControl::getRunningVehicleNo(), MSInsertionControl::getWaitingVehicleNo(), myDetectorControl, myEdges, myInserter, myLogExecutionTime, mySimStepDuration, myStep, myVehicleControl, MSVehicleControl::printMeanTravelTime(), MSVehicleControl::printMeanWaitingTime(), time2string(), MSDetectorControl::updateDetectors(), MSXMLRawOut::write(), and MSDetectorControl::writeOutput().
Referenced by simulationStep().
MSEventControl* MSNet::myBeginOfTimestepEvents [protected] |
Controls events executed at the begin of a time step;.
Definition at line 585 of file MSNet.h.
Referenced by getBeginOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().
NamedObjectCont<MSBusStop*> MSNet::myBusStopDict [protected] |
Dictionary of bus stops.
Definition at line 634 of file MSNet.h.
Referenced by addBusStop(), getBusStop(), and getBusStopID().
MSDetectorControl* MSNet::myDetectorControl [protected] |
Controls detectors;.
Definition at line 583 of file MSNet.h.
Referenced by closeSimulation(), getDetectorControl(), GUINet::initGUIStructures(), MSNet(), writeOutput(), and ~MSNet().
MSEdgeControl* MSNet::myEdges [protected] |
Controls edges, performs vehicle movement;.
Definition at line 575 of file MSNet.h.
Referenced by closeBuilding(), getEdgeControl(), MSNet(), simulationStep(), writeOutput(), and ~MSNet().
MSEdgeWeightsStorage* MSNet::myEdgeWeights [protected] |
The net's knowledge about edge efforts/travel times;.
Definition at line 593 of file MSNet.h.
Referenced by getWeightsStorage(), MSNet(), and ~MSNet().
MSEventControl* MSNet::myEndOfTimestepEvents [protected] |
Controls events executed at the end of a time step;.
Definition at line 587 of file MSNet.h.
Referenced by getEndOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().
MSInsertionControl* MSNet::myInserter [protected] |
Controls vehicle insertion;.
Definition at line 581 of file MSNet.h.
Referenced by closeSimulation(), getInsertionControl(), MSNet(), simulationState(), simulationStep(), writeOutput(), and ~MSNet().
MSEventControl* MSNet::myInsertionEvents [protected] |
Controls insertion events;.
Definition at line 589 of file MSNet.h.
Referenced by getInsertionEvents(), MSNet(), simulationState(), simulationStep(), and ~MSNet().
MSNet * MSNet::myInstance = 0 [static, protected] |
MSJunctionControl* MSNet::myJunctions [protected] |
Controls junctions, realizes right-of-way rules;.
Definition at line 577 of file MSNet.h.
Referenced by closeBuilding(), getJunctionControl(), GUINet::getJunctionPosition(), GUINet::initGUIStructures(), MSNet(), and ~MSNet().
bool MSNet::myLogExecutionTime [protected] |
Information whether the simulation duration shall be logged.
Definition at line 602 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;.
Definition at line 579 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 605 of file MSNet.h.
Referenced by MSNet(), and simulate().
MSPersonControl* MSNet::myPersonControl [protected] |
Controls person building and deletion;.
Definition at line 573 of file MSNet.h.
Referenced by getPersonControl(), MSNet(), simulationState(), simulationStep(), and ~MSNet().
MSRouteLoaderControl* MSNet::myRouteLoaders [protected] |
Route loader for dynamic loading of routes.
Definition at line 560 of file MSNet.h.
Referenced by closeBuilding(), MSNet(), simulationStep(), and ~MSNet().
ShapeContainer* MSNet::myShapeContainer [protected] |
A container for geometrical shapes;.
Definition at line 591 of file MSNet.h.
Referenced by getShapeContainer(), MSNet(), and ~MSNet().
long MSNet::mySimBeginMillis [protected] |
The overall simulation duration.
Definition at line 611 of file MSNet.h.
Referenced by closeBuilding(), and closeSimulation().
long MSNet::mySimStepBegin [protected] |
The last simulation step begin, end and duration.
Definition at line 608 of file MSNet.h.
Referenced by simulationStep().
long MSNet::mySimStepDuration [protected] |
Definition at line 608 of file MSNet.h.
Referenced by postSimStepOutput(), simulationStep(), and writeOutput().
long MSNet::mySimStepEnd [protected] |
Definition at line 608 of file MSNet.h.
Referenced by simulationStep().
std::vector<std::string> MSNet::myStateDumpFiles [protected] |
The names for the state files.
Definition at line 625 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 623 of file MSNet.h.
Referenced by closeBuilding(), and simulationStep().
SUMOTime MSNet::myStep [protected] |
Current time step.
Definition at line 563 of file MSNet.h.
Referenced by closeSimulation(), getCurrentTimeStep(), MSNet(), postSimStepOutput(), preSimStepOutput(), simulate(), simulationState(), simulationStep(), and writeOutput().
int MSNet::myTooManyVehicles [protected] |
Storage for maximum vehicle number.
Definition at line 630 of file MSNet.h.
Referenced by MSNet(), and simulationState().
MSVehicleControl* MSNet::myVehicleControl [protected] |
Controls vehicle building and deletion;.
Definition at line 571 of file MSNet.h.
Referenced by closeSimulation(), getVehicleControl(), MSNet(), postSimStepOutput(), simulationState(), simulationStep(), GUINet::vehicleExists(), writeOutput(), and ~MSNet().
long MSNet::myVehiclesMoved [protected] |
The overall number of vehicle movements.
Definition at line 614 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 637 of file MSNet.h.
Referenced by addVehicleStateListener(), informVehicleStateListener(), and removeVehicleStateListener().