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) |
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 |
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, emission 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. | |
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 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. | |
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) |
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 156 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().
MSNet::~MSNet | ( | ) | [virtual] |
Destructor.
Definition at line 217 of file MSNet.cpp.
References clearAll(), MSGlobals::gUseMesoSim, myBeginOfTimestepEvents, myDetectorControl, myEdges, myEdgeWeights, myEndOfTimestepEvents, myInserter, myInsertionEvents, myInstance, myJunctions, myLogics, myPersonControl, myRouteLoaders, myShapeContainer, and myVehicleControl.
MSNet::MSNet | ( | const MSNet & | ) | [private] |
Invalidated copy constructor.
bool MSNet::addBusStop | ( | MSBusStop * | 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.
[in] | busStop | The bus stop to add |
Definition at line 639 of file MSNet.cpp.
References NamedObjectCont< T >::add(), Named::getID(), and myBusStopDict.
void MSNet::addVehicleStateListener | ( | VehicleStateListener * | listener | ) |
Adds a vehicle states listener.
[in] | listener | The listener to add |
Definition at line 612 of file MSNet.cpp.
References myVehicleStateListeners.
Referenced by MSDevice_Vehroutes::init(), and traci::TraCIServer::TraCIServer().
void MSNet::clearAll | ( | ) | [static] |
Clears all dictionaries.
Definition at line 461 of file MSNet.cpp.
References MSRoute::clear(), MSEdge::clear(), MSLane::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 | ||
) |
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 194 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 295 of file MSNet.cpp.
References MSDetectorControl::close(), traci::TraCIServer::close(), SysUtils::getCurrentMillis(), MSVehicleControl::getDepartedVehicleNo(), MSVehicleControl::getLoadedVehicleNo(), MSVehicleControl::getRunningVehicleNo(), MSInsertionControl::getWaitingVehicleNo(), myDetectorControl, myInserter, myLogExecutionTime, mySimBeginMillis, myStep, myVehicleControl, myVehiclesMoved, STEPS2TIME, SUMOReal, toString(), and WRITE_MESSAGE.
Referenced by GUIRunThread::deleteSim(), and simulate().
MSEventControl& MSNet::getBeginOfTimestepEvents | ( | ) | [inline] |
Returns the event control for events executed at the begin of a time step.
Definition at line 336 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 645 of file MSNet.cpp.
References NamedObjectCont< T >::get(), and myBusStopDict.
Referenced by MSRouteHandler::addStop(), and MSVehicle::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 651 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 471 of file MSNet.cpp.
References myStep.
Referenced by MSDevice_Vehroutes::addRoute(), traci::TraCIServer::addSubscription(), MSTLLogicControl::addWAUTJunction(), MSVehicle::checkRewindLinkLanes(), NLJunctionControlBuilder::closeTrafficLightLogic(), MSTLLogicControl::closeWAUT(), MSInductLoop::collectVehiclesOnDet(), traci::TraCIServer::commandAddVehicle(), TraCIServerAPI_Simulation::commandDistanceRequest(), MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), MSPersonControl::erase(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSActuatedTrafficLightLogic::gapControl(), MSInductLoop::getCurrentOccupancy(), GUIApplicationWindow::getCurrentSimTime(), MSLaneSpeedTrigger::getCurrentSpeed(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), MSLane::getLeaderOnConsecutive(), GUIApplicationWindow::handleEvent_SimulationLoaded(), GUIApplicationWindow::handleEvent_SimulationStep(), MSLaneSpeedTrigger::init(), MSTLLogicControl::initWautSwitch(), MSLane::isInsertionSuccess(), GUIRunThread::makeStep(), MSVehicle::moveChecked(), MSVehicle::moveRegardingCritical(), MSTriggeredXMLReader::MSTriggeredXMLReader(), MSTriggeredXMLReader::myInit(), MSDevice_Vehroutes::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSDevice_Vehroutes::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSBaseVehicle::onDepart(), traci::TraCIServer::postProcessSimulationStep2(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_TLS::processSet(), MSTrafficLightLogic::resetLinkStates(), GUIRunThread::run(), simulate(), MSSimpleTrafficLightLogic::trySwitch(), and MSActuatedTrafficLightLogic::trySwitch().
MSDetectorControl& MSNet::getDetectorControl | ( | ) | [inline] |
Returns the detector control.
Definition at line 306 of file MSNet.h.
References myDetectorControl.
Referenced by NLDetectorBuilder::createEdgeLaneMeanData(), NLDetectorBuilder::endE3Detector(), TraCIServerAPI_InductionLoop::processGet(), and TraCIServerAPI_MeMeDetector::processGet().
MSEdgeControl& MSNet::getEdgeControl | ( | ) | [inline] |
Returns the edge control.
Definition at line 286 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 | ( | ) | [inline] |
Returns the event control for events executed at the end of a time step.
Definition at line 346 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 | ( | ) | [inline] |
Returns the insertion control.
Definition at line 296 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 | ( | ) | [inline] |
Returns the event control for insertion events.
Definition at line 356 of file MSNet.h.
References myInsertionEvents.
Referenced by MSDevice_Routing::MSDevice_Routing(), and MSTriggeredXMLReader::MSTriggeredXMLReader().
MSNet * MSNet::getInstance | ( | void | ) | [static] |
Returns the pointer to the unique instance of MSNet (singleton).
ProcessError | If a network was not yet constructed |
Definition at line 148 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(), traci::TraCIServer::addSubscription(), 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(), traci::TraCIServer::dispatchCommand(), GUITrafficLightLogicWrapper::drawGL(), GUITriggeredRerouter::drawGL(), GUILaneWrapper::drawGL(), MSVehicle::enterLaneAtLaneChange(), MSVehicle::enterLaneAtMove(), MSPersonControl::erase(), Command_SaveTLCoupledLaneDet::execute(), Command_SaveTLCoupledDet::execute(), MSVTypeProbe::execute(), MSActuatedTrafficLightLogic::gapControl(), MSDevice_Vehroutes::generateOutput(), GUILaneWrapper::getColorValue(), MSInductLoop::getCurrentLength(), MSInductLoop::getCurrentOccupancy(), MSInductLoop::getCurrentPassedNumber(), MSLaneSpeedTrigger::getCurrentSpeed(), MSInductLoop::getCurrentSpeed(), GUIViewTraffic::getCurrentTimeStep(), MSEventControl::getCurrentTimeStep(), MSInductLoop::getCurrentVehicleIDs(), TraCIDijkstraRouter< E >::getEffort(), GUINet::getGUIInstance(), MSLane::getLeaderOnConsecutive(), MSTLLogicControl::getPhaseDef(), MSInductLoop::getTimestepsSinceLastDetection(), MSLane::incorporateVehicle(), MSDevice_Vehroutes::init(), MSLaneSpeedTrigger::init(), MSMeanData::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(), MSDevice_Vehroutes::notifyEnter(), MSDevice_Person::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(), traci::TraCIServer::postProcessSimulationStep2(), TraCIServerAPI_Edge::processGet(), TraCIServerAPI_MeMeDetector::processGet(), TraCIServerAPI_Junction::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_POI::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Polygon::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Simulation::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Edge::processSet(), TraCIServerAPI_TLS::processSet(), TraCIServerAPI_POI::processSet(), TraCIServerAPI_Polygon::processSet(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_VehicleType::processSet(), MSVehicle::replaceRoute(), MSTrafficLightLogic::resetLinkStates(), MSVehicleControl::scheduleVehicleRemoval(), MSLane::setCritical(), GUIVehicle::setFunctionalColor(), MSLaneSpeedTrigger::setOverriding(), MSLaneSpeedTrigger::setOverridingValue(), simulationStep(), traci::TraCIServer::TraCIServer(), MSSimpleTrafficLightLogic::trySwitch(), MSActuatedTrafficLightLogic::trySwitch(), MSVehicleControl::vehicleDeparted(), MSVehicle::vsafeCriticalCont(), MSMeanData_HBEFA::MSLaneMeanDataValues::write(), and traci::TraCIServer::~TraCIServer().
MSJunctionControl& MSNet::getJunctionControl | ( | ) | [inline] |
Returns the junctions control.
Definition at line 326 of file MSNet.h.
References myJunctions.
Referenced by TraCIServerAPI_Junction::processGet().
Returns the person control.
If the person control does not exist, yet, it is created.
Definition at line 563 of file MSNet.cpp.
References myPersonControl.
Referenced by MSRouteHandler::closePerson(), MSPerson::MSPersonStage_Walking::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSPerson::MSPersonStage_Waiting::proceed(), MSPerson::proceed(), and MSVehicle::processNextStop().
ShapeContainer& MSNet::getShapeContainer | ( | ) | [inline] |
Returns the shapes container.
Definition at line 366 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 | ) | [static] |
Returns the message to show if a certain state occurs.
Definition at line 440 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().
MSTLLogicControl& MSNet::getTLSControl | ( | ) | [inline] |
Returns the tls logics control.
Definition at line 316 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 | ( | ) | [inline] |
Returns the vehicle control.
Definition at line 265 of file MSNet.h.
References myVehicleControl.
Referenced by MSInsertionControl::add(), MSDevice_HBEFA::buildVehicleDevices(), MSDevice_Routing::buildVehicleDevices(), MSInsertionControl::checkFlows(), MSRouteHandler::closeVehicle(), traci::TraCIServer::commandAddVehicle(), MSVTypeProbe::execute(), GUINet::getParameterWindow(), GUISUMOViewParent::onCmdLocate(), MSBaseVehicle::onDepart(), MSRouteHandler::openVehicleTypeDistribution(), MSPerson::MSPersonStage_Driving::proceed(), TraCIServerAPI_VehicleType::processGet(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), TraCIServerAPI_GUI::processSet(), TraCIServerAPI_VehicleType::processSet(), MSLane::setCritical(), GUINet::setSimDuration(), and MSMeanData_HBEFA::MSLaneMeanDataValues::write().
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 572 of file MSNet.cpp.
References myEdgeWeights.
Referenced by NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight(), NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight(), GUILaneWrapper::getColorValue(), 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 629 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 509 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 587 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 581 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 620 of file MSNet.cpp.
References myVehicleStateListeners.
Referenced by traci::TraCIServer::~TraCIServer().
int MSNet::simulate | ( | SUMOTime | start, |
SUMOTime | stop | ||
) |
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 251 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 409 of file MSNet.cpp.
References MSPersonControl::abortWaiting(), MSVehicleControl::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 322 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(), MSGlobals::gUseMesoSim, 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 traci::TraCIServer::dispatchCommand(), GUIRunThread::makeStep(), and simulate().
void MSNet::writeOutput | ( | ) |
Write netstate, emission and detector output.
Definition at line 477 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 592 of file MSNet.h.
Referenced by getBeginOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().
NamedObjectCont<MSBusStop*> MSNet::myBusStopDict [protected] |
Dictionary of bus stops.
Definition at line 641 of file MSNet.h.
Referenced by addBusStop(), getBusStop(), and getBusStopID().
MSDetectorControl* MSNet::myDetectorControl [protected] |
Controls detectors;.
Definition at line 590 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 582 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 600 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 594 of file MSNet.h.
Referenced by getEndOfTimestepEvents(), MSNet(), simulationStep(), and ~MSNet().
MSInsertionControl* MSNet::myInserter [protected] |
Controls vehicle insertion;.
Definition at line 588 of file MSNet.h.
Referenced by closeSimulation(), getInsertionControl(), MSNet(), simulationState(), simulationStep(), writeOutput(), and ~MSNet().
MSEventControl* MSNet::myInsertionEvents [protected] |
Controls insertion events;.
Definition at line 596 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 584 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 609 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 586 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 612 of file MSNet.h.
Referenced by MSNet(), and simulate().
MSPersonControl* MSNet::myPersonControl [protected] |
Controls person building and deletion;.
Definition at line 580 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 567 of file MSNet.h.
Referenced by closeBuilding(), MSNet(), simulationStep(), and ~MSNet().
ShapeContainer* MSNet::myShapeContainer [protected] |
A container for geometrical shapes;.
Definition at line 598 of file MSNet.h.
Referenced by getShapeContainer(), MSNet(), and ~MSNet().
long MSNet::mySimBeginMillis [protected] |
The overall simulation duration.
Definition at line 618 of file MSNet.h.
Referenced by closeBuilding(), and closeSimulation().
long MSNet::mySimStepBegin [protected] |
The last simulation step begin, end and duration.
Definition at line 615 of file MSNet.h.
Referenced by simulationStep().
long MSNet::mySimStepDuration [protected] |
Definition at line 615 of file MSNet.h.
Referenced by postSimStepOutput(), simulationStep(), and writeOutput().
long MSNet::mySimStepEnd [protected] |
Definition at line 615 of file MSNet.h.
Referenced by simulationStep().
std::vector<std::string> MSNet::myStateDumpFiles [protected] |
The names for the state files.
Definition at line 632 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 630 of file MSNet.h.
Referenced by closeBuilding(), and simulationStep().
SUMOTime MSNet::myStep [protected] |
Current time step.
Definition at line 570 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 637 of file MSNet.h.
Referenced by MSNet(), and simulationState().
MSVehicleControl* MSNet::myVehicleControl [protected] |
Controls vehicle building and deletion;.
Definition at line 578 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 621 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 644 of file MSNet.h.
Referenced by addVehicleStateListener(), informVehicleStateListener(), and removeVehicleStateListener().