SUMO - Simulation of Urban MObility
MSDevice_Routing Class Reference

A device that performs vehicle rerouting based on current edge speeds. More...

#include <MSDevice_Routing.h>

Inheritance diagram for MSDevice_Routing:
Inheritance graph
Collaboration diagram for MSDevice_Routing:
Collaboration graph

Public Types

enum  Notification {
  NOTIFICATION_DEPARTED, NOTIFICATION_JUNCTION, NOTIFICATION_SEGMENT, NOTIFICATION_LANE_CHANGE,
  NOTIFICATION_TELEPORT, NOTIFICATION_PARKING, NOTIFICATION_ARRIVED, NOTIFICATION_VAPORIZED,
  NOTIFICATION_TELEPORT_ARRIVED
}
 Definition of a vehicle state. More...
 

Public Member Functions

void addTo (const StoringVisitor &cont) const
 Adds this object to the given container. More...
 
virtual void generateOutput () const
 Called on writing tripinfo output. More...
 
const std::string & getDescription () const
 
SUMOVehiclegetHolder () const
 Returns the vehicle that holds this device. More...
 
const std::string & getID () const
 Returns the id. More...
 
const MSLanegetLane () const
 Returns the lane the reminder works on. More...
 
virtual void notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
 Internal notification about the vehicle moves. More...
 
void reroute (const SUMOTime currentTime, const bool onInit=false)
 initiate the rerouting, create router / thread pool on first use More...
 
void setDescription (const std::string &description)
 
void setID (const std::string &newID)
 resets the id More...
 
void skipRouting (const SUMOTime currentTime)
 Labels the current time step as "unroutable". More...
 
 ~MSDevice_Routing ()
 Destructor. More...
 
Methods called on vehicle movement / state change, overwriting MSDevice
bool notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason)
 Computes a new route on vehicle insertion. More...
 
Interface methods, to be derived by subclasses
virtual bool notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
 Checks whether the reminder still has to be notified about the vehicle moves. More...
 
virtual bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
 Called if the vehicle leaves the reminder's lane. More...
 
void updateDetector (SUMOVehicle &veh, SUMOReal entryPos, SUMOReal leavePos, SUMOTime entryTime, SUMOTime currentTime, SUMOTime leaveTime, bool cleanUp)
 

Static Public Member Functions

static void buildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into)
 Build devices for the given vehicle, if needed. More...
 
static bool checkOptions (OptionsCont &oc)
 checks MSDevice_Routing-options More...
 
static void cleanup ()
 deletes the router instance More...
 
static SUMOReal getAssumedSpeed (const MSEdge *edge)
 return current travel speed assumption More...
 
template<class T >
static std::string getIDSecure (const T *obj, const std::string &fallBack="NULL")
 get an identifier for Named-like object which may be Null More...
 
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT (const MSEdgeVector &prohibited=MSEdgeVector())
 return the router instance More...
 
static void insertOptions (OptionsCont &oc)
 Inserts MSDevice_Routing-options. More...
 
static bool isEnabled ()
 returns whether any routing actions take place More...
 

Protected Member Functions

void removeFromVehicleUpdateValues (SUMOVehicle &veh)
 

Static Protected Member Functions

Helper methods for device assignment
static void insertDefaultAssignmentOptions (const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc)
 Adds common command options that allow to assign devices to vehicles. More...
 
static bool equippedByDefaultAssignmentOptions (const OptionsCont &oc, const std::string &deviceName, SUMOVehicle &v)
 Determines whether a vehicle should get a certain device. More...
 

Protected Attributes

std::string myDescription
 a description of this moveReminder More...
 
SUMOVehiclemyHolder
 The vehicle that stores the device. More...
 
std::string myID
 The name of the object. More...
 
MSLane *const myLane
 Lane on which the reminder works. More...
 

Private Member Functions

 MSDevice_Routing (SUMOVehicle &holder, const std::string &id, SUMOTime period, SUMOTime preInsertionPeriod)
 Constructor. More...
 
 MSDevice_Routing (const MSDevice_Routing &)
 Invalidated copy constructor. More...
 
MSDevice_Routingoperator= (const MSDevice_Routing &)
 Invalidated assignment operator. More...
 
SUMOTime preInsertionReroute (const SUMOTime currentTime)
 Performs rerouting before insertion into the network. More...
 
SUMOTime wrappedRerouteCommandExecute (SUMOTime currentTime)
 Performs rerouting after a period. More...
 

Static Private Member Functions

static SUMOReal getEffort (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
 Returns the effort to pass an edge. More...
 
Network state adaptation
static SUMOTime adaptEdgeEfforts (SUMOTime currentTime)
 Adapt edge efforts by the current edge states. More...
 

Private Attributes

SUMOTime myLastRouting
 The last time a routing took place. More...
 
SUMOTime myPeriod
 The period with which a vehicle shall be rerouted. More...
 
SUMOTime myPreInsertionPeriod
 The period with which a vehicle shall be rerouted before insertion. More...
 
WrappingCommand< MSDevice_Routing > * myRerouteCommand
 The (optional) command responsible for rerouting. More...
 
SUMOTime mySkipRouting
 The time for which routing may be skipped because we cannot be inserted. More...
 

Static Private Attributes

static SUMOTime myAdaptationInterval = -1
 At which time interval the edge weights get updated. More...
 
static int myAdaptationSteps
 The number of steps for averaging edge speeds (ring-buffer) More...
 
static int myAdaptationStepsIndex = 0
 The current index in the pastEdgeSpeed ring-buffer. More...
 
static SUMOReal myAdaptationWeight
 Information which weight prior edge efforts have. More...
 
static std::map< std::pair< const MSEdge *, const MSEdge * >, const MSRoute * > myCachedRoutes
 The container of pre-calculated routes. More...
 
static std::vector< SUMORealmyEdgeSpeeds
 The container of edge speeds. More...
 
static CommandmyEdgeWeightSettingCommand = 0
 The weights adaptation/overwriting command. More...
 
static SUMOTime myLastAdaptation = -1
 Information when the last edge weight adaptation occured. More...
 
static std::vector< std::vector< SUMOReal > > myPastEdgeSpeeds
 The container of edge speeds. More...
 
static SUMOReal myRandomizeWeightsFactor = 0
 Whether to disturb edge weights dynamically. More...
 
static SUMOAbstractRouter< MSEdge, SUMOVehicle > * myRouter = 0
 The router to use. More...
 
static AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > > * myRouterWithProhibited = 0
 The router to use by rerouter elements. More...
 
static bool myWithTaz
 whether taz shall be used at initial rerouting More...
 

Detailed Description

A device that performs vehicle rerouting based on current edge speeds.

The routing-device system consists of in-vehicle devices that perform a routing and a simulation-wide (static) methods for colecting edge weights.

The edge weights container "myEdgeSpeeds" is pre-initialised as soon as one device is built and is kept updated via an event that adapts it to the current mean speed on the simulated network's edges.

A device is assigned to a vehicle using the common explicit/probability - procedure.

A device computes a new route for a vehicle as soon as the vehicle is inserted (within "enterLaneAtInsertion") - and, if the given period is larger than 0 - each x time steps where x is the period. This is triggered by an event that executes "wrappedRerouteCommandExecute".

Definition at line 76 of file MSDevice_Routing.h.

Member Enumeration Documentation

Definition of a vehicle state.

Enumerator
NOTIFICATION_DEPARTED 

The vehicle has departed (was inserted into the network)

NOTIFICATION_JUNCTION 

The vehicle arrived at a junction.

NOTIFICATION_SEGMENT 

The vehicle changes the segment (meso only)

NOTIFICATION_LANE_CHANGE 

The vehicle changes lanes (micro only)

NOTIFICATION_TELEPORT 

The vehicle is being teleported.

NOTIFICATION_PARKING 

The vehicle starts or ends parking.

NOTIFICATION_ARRIVED 

The vehicle arrived at its destination (is deleted)

NOTIFICATION_VAPORIZED 

The vehicle got vaporized.

NOTIFICATION_TELEPORT_ARRIVED 

The vehicle was teleported out of the net.

Definition at line 95 of file MSMoveReminder.h.

Constructor & Destructor Documentation

MSDevice_Routing::~MSDevice_Routing ( )

Destructor.

Definition at line 229 of file MSDevice_Routing.cpp.

References WrappingCommand< T >::deschedule(), MSNet::getInstance(), and myRerouteCommand.

Referenced by isEnabled().

MSDevice_Routing::MSDevice_Routing ( SUMOVehicle holder,
const std::string &  id,
SUMOTime  period,
SUMOTime  preInsertionPeriod 
)
private

Constructor.

Parameters
[in]holderThe vehicle that holds this device
[in]idThe ID of the device
[in]periodThe period with which a new route shall be searched
[in]preInsertionPeriodThe route search period before insertion

Definition at line 214 of file MSDevice_Routing.cpp.

References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), SUMOVehicleParameter::depart, MSNet::getInsertionEvents(), MSNet::getInstance(), SUMOVehicle::getParameter(), myEdgeWeightSettingCommand, myPreInsertionPeriod, myRerouteCommand, preInsertionReroute(), VEHPARS_FORCE_REROUTE, and SUMOVehicleParameter::wasSet().

Referenced by buildVehicleDevices(), and skipRouting().

MSDevice_Routing::MSDevice_Routing ( const MSDevice_Routing )
private

Invalidated copy constructor.

Member Function Documentation

SUMOTime MSDevice_Routing::adaptEdgeEfforts ( SUMOTime  currentTime)
staticprivate

Adapt edge efforts by the current edge states.

This method is called by the event handler at the end of a simulation step. The current edge weights are combined with the previously stored.

Parameters
[in]currentTimeThe current simulation time
Returns
The offset to the next call (always 1 in this case - edge weights are updated each time step)
Todo:
Describe how the weights are adapted
See also
MSEventHandler
StaticCommand

Definition at line 309 of file MSDevice_Routing.cpp.

References OutputDevice::closeTag(), DELTA_T, OutputDevice::getDeviceByOption(), MSNet::getEdgeControl(), MSEdgeControl::getEdges(), MSNet::getInstance(), OptionsCont::getOptions(), myAdaptationInterval, myAdaptationSteps, myAdaptationStepsIndex, myAdaptationWeight, myCachedRoutes, myEdgeSpeeds, myLastAdaptation, myPastEdgeSpeeds, OutputDevice::openTag(), STEPS2TIME, SUMO_ATTR_BEGIN, SUMO_ATTR_END, SUMO_ATTR_ID, SUMO_TAG_EDGE, SUMO_TAG_INTERVAL, SUMOReal, and OutputDevice::writeAttr().

Referenced by buildVehicleDevices(), and skipRouting().

void Named::addTo ( const StoringVisitor cont) const
inlineinherited

Adds this object to the given container.

Parameters

Definition at line 129 of file Named.h.

References Named::StoringVisitor::add().

void MSDevice_Routing::buildVehicleDevices ( SUMOVehicle v,
std::vector< MSDevice * > &  into 
)
static

Build devices for the given vehicle, if needed.

The options are read and evaluated whether rerouting-devices shall be built for the given vehicle.

When the first device is built, the static container of edge weights used for routing is initialised with the mean speed the edges allow. In addition, an event is generated which updates these weights is built and added to the list of events to execute at a simulation end.

For each seen vehicle, the global vehicle index is increased.

The built device is stored in the given vector.

Parameters
[in]vThe vehicle for which a device may be built

Definition at line 140 of file MSDevice_Routing.cpp.

References MSEventControl::ADAPT_AFTER_EXECUTION, adaptEdgeEfforts(), MSEventControl::addEvent(), OutputDevice::createDeviceByOption(), MSDevice::equippedByDefaultAssignmentOptions(), OptionsCont::getBool(), MSNet::getCurrentTimeStep(), MSNet::getEdgeControl(), MSEdgeControl::getEdges(), MSNet::getEndOfTimestepEvents(), OptionsCont::getFloat(), SUMOVehicle::getID(), MSNet::getInstance(), OptionsCont::getInt(), OptionsCont::getOptions(), SUMOVehicle::getParameter(), OptionsCont::getString(), MSNet::getTravelTime(), OptionsCont::isSet(), MSDevice_Routing(), myAdaptationInterval, myAdaptationSteps, myAdaptationWeight, myEdgeSpeeds, myEdgeWeightSettingCommand, myLastAdaptation, myPastEdgeSpeeds, myRandomizeWeightsFactor, myWithTaz, SIMTIME, string2time(), SUMOReal, VEHPARS_FORCE_REROUTE, SUMOVehicleParameter::wasSet(), WRITE_ERROR, and WRITE_WARNING.

Referenced by MSDevice::buildVehicleDevices().

bool MSDevice_Routing::checkOptions ( OptionsCont oc)
static

checks MSDevice_Routing-options

Parameters

Definition at line 130 of file MSDevice_Routing.cpp.

References OptionsCont::getInt(), OptionsCont::isDefault(), and WRITE_ERROR.

Referenced by MSDevice::checkOptions().

void MSDevice_Routing::cleanup ( )
static

deletes the router instance

Definition at line 449 of file MSDevice_Routing.cpp.

References MSEdge::EDGEFUNCTION_DISTRICT, MSEdge::getPurpose(), myCachedRoutes, myRouter, myRouterWithProhibited, and myWithTaz.

Referenced by MSNet::clearAll().

bool MSDevice::equippedByDefaultAssignmentOptions ( const OptionsCont oc,
const std::string &  deviceName,
SUMOVehicle v 
)
staticprotectedinherited
virtual void MSDevice::generateOutput ( ) const
inlinevirtualinherited

Called on writing tripinfo output.

The device may write some statistics into the tripinfo output. It is assumed that the written information is a valid xml-snipplet, which will be embedded within the vehicle's information.

The device should use the openTag / closeTag methods of the OutputDevice for correct indentation.

Parameters
[in]osThe stream to write the information into
Exceptions
IOErrornot yet implemented

Reimplemented in MSDevice_Tripinfo, MSDevice_Example, MSDevice_Vehroutes, MSDevice_Emissions, and MSDevice_Battery.

Definition at line 127 of file MSDevice.h.

References MSDevice::equippedByDefaultAssignmentOptions(), and MSDevice::insertDefaultAssignmentOptions().

SUMOReal MSDevice_Routing::getAssumedSpeed ( const MSEdge edge)
static

return current travel speed assumption

Definition at line 303 of file MSDevice_Routing.cpp.

References getEffort(), and MSEdge::getLength().

Referenced by MSEdge::getRoutingSpeed(), and skipRouting().

const std::string& MSMoveReminder::getDescription ( ) const
inlineinherited
SUMOReal MSDevice_Routing::getEffort ( const MSEdge *const  e,
const SUMOVehicle *const  v,
SUMOReal  t 
)
staticprivate

Returns the effort to pass an edge.

This method is given to the used router in order to obtain the efforts to pass an edge from the internal edge weights container.

The time is not used, here, as the current simulation state is used in an aggregated way.

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

Definition at line 289 of file MSDevice_Routing.cpp.

References MSEdge::getLength(), MSEdge::getMinimumTravelTime(), MSEdge::getNumericalID(), MAX2(), myEdgeSpeeds, myRandomizeWeightsFactor, RandHelper::rand(), and SUMOReal.

Referenced by getAssumedSpeed(), getRouterTT(), reroute(), and skipRouting().

SUMOVehicle& MSDevice::getHolder ( ) const
inlineinherited

Returns the vehicle that holds this device.

Returns
The vehicle that holds this device

Definition at line 110 of file MSDevice.h.

References MSDevice::myHolder.

const std::string& Named::getID ( ) const
inlineinherited

Returns the id.

Returns
The stored id

Definition at line 66 of file Named.h.

References Named::myID.

Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicle::adaptToLeader(), MSVehicle::adaptToLeaders(), PCPolyContainer::add(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), MSDetectorControl::add(), Named::StoringVisitor::add(), ShapeContainer::add(), IntermodalRouter< E, L, N, V >::addAccess(), NLTriggerBuilder::addAccess(), RORouteDef::addAlternative(), MSLane::addApproachingLane(), MSNet::addBusStop(), MSNet::addChargingStation(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), MSNet::addContainerStop(), NIXMLConnectionsHandler::addCrossing(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), GUIEdge::addRerouter(), NBEdge::addRestrictedLane(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NIXMLEdgesHandler::addSplit(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), ROVehicle::addStop(), MSVehicle::addStop(), NBEdge::addStraightConnections(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciBusOrContainerStop(), MSVehicle::addTraciStop(), AGActivityTripWriter::addTrip(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::beginEventOutput(), NLEdgeControlBuilder::build(), NIVisumTL::build(), RODFNet::buildApproachList(), MS_E2_ZS_CollectorOverLanes::buildCollector(), MSSOTLE2Sensors::buildContinueSensior(), MSSOTLE2Sensors::buildCountSensorForLane(), MSSOTLE2Sensors::buildCountSensorForOutLane(), NBNode::buildCrossings(), NBNode::buildCrossingsAndWalkingAreas(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), GNEConnectorFrame::buildIinternalLanes(), GNETLSEditorFrame::buildIinternalLanes(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), MELoop::buildSegmentsFor(), MSSOTLE2Sensors::buildSensorForLane(), MSSOTLE2Sensors::buildSensorForOutLane(), NBNode::buildWalkingAreas(), MSBaseVehicle::calculateArrivalParams(), MSSwarmTrafficLightLogic::calculateEtaDiff(), MSSwarmTrafficLightLogic::calculateEtaRatio(), MSSOTLPolicyBasedTrafficLightLogic::canRelease(), MSLaneChanger::changeOpposite(), MELoop::changeSegment(), MSSimpleTrafficLightLogic::changeStepAndDuration(), NBEdge::checkGeometry(), MSVehicleTransfer::checkInsertions(), MSVehicle::checkRewindLinkLanes(), MSSwarmTrafficLightLogic::choosePolicy(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBLoadedSUMOTLDef::collectEdges(), NBTrafficLightDefinition::collectEdges(), NBLoadedSUMOTLDef::collectEdgeVectors(), NBLoadedTLDef::collectLinks(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBOwnTLDef::computeLogicAndConts(), NBNode::computeNodeShape(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBNode::computeSmoothShape(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), NLDetectorBuilder::convUncontE2PosLength(), MSSOTLWaveTrafficLightLogic::countVehicles(), MSSOTLE2Sensors::countVehicles(), GUINet::createTLWrapper(), MSDeterministicHiLevelTrafficLightLogic::decideNextPhase(), MSSOTLPolicyBasedTrafficLightLogic::decideNextPhase(), MSSwarmTrafficLightLogic::decideNextPhase(), MSDeterministicHiLevelTrafficLightLogic::decidePolicy(), MSSwarmTrafficLightLogic::decidePolicy(), NIVissimDistrictConnection::dict_BuildDistricts(), NBEdge::divideOnEdges(), NBEdge::divideSelectedLanesOnEdges(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSE3Collector::enter(), METriggeredCalibrator::execute(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSPModel_Striping::MovePedestrians::execute(), MSTrafficLightLogic::SwitchCommand::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), TraCIServerAPI_Vehicle::findCloserLane(), NBRampsComputer::fulfillsRampConstraints(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSVehicle::getBackPosition(), MSNet::getBusStopID(), MSVehicle::getCenterOnEdge(), MSDevice_Battery::getChargingStationID(), MSNet::getChargingStationID(), NBEdge::getConnection(), MSNet::getContainerStopID(), NBEdge::getCrossingAngle(), GNEEdge::getDest(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), MSE2Collector::getEstimateQueueLength(), NBEdge::getFirstNonPedestrianLane(), MSLane::getFollower(), MSLane::getFollowerOnConsecutive(), MSLane::getFollowersOnConsecutive(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), MSLane::getLastVehicleInformation(), MSVehicle::getLatOffset(), MSLane::getLeader(), MSLane::getLeaderOnConsecutive(), MSLane::getLeadersOnConsecutive(), MSTLLogicControl::TLSLogicVariants::getLogicInstantiatingOff(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForInputLanes(), MSDeterministicHiLevelTrafficLightLogic::getMeanSpeedForOutputLanes(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPerson::getNextEdge(), MSPModel_Striping::getNextLane(), MSLane::getOppositeFollower(), MSLane::getOppositeLeader(), MSLane::getOppositePos(), GUIInstantInductLoop::MyWrapper::getParameterWindow(), GUIMEInductLoop::MyWrapper::getParameterWindow(), GUI_E2_ZS_Collector::MyWrapper::getParameterWindow(), GUIVehicle::getParameterWindow(), GUIInductLoop::MyWrapper::getParameterWindow(), MSLane::getPartialBehind(), MSSOTLTrafficLightLogic::getPhaseIndexWithMaxCTS(), MSSwarmTrafficLightLogic::getPheromoneForInputLanes(), MSSwarmTrafficLightLogic::getPheromoneForOutputLanes(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), GNEEdge::getSource(), MSVehicleControl::getWaitingVehicle(), MSLink::getZipperSpeed(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), MSLane::handleCollisionBetween(), NBEdgeCont::ignoreFilterMatch(), MSDeterministicHiLevelTrafficLightLogic::init(), MSRailSignal::init(), MSActuatedTrafficLightLogic::init(), MSTrafficLightLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBNodeCont::insert(), NBTrafficLightLogicCont::insert(), NBEdgeCont::insert(), MSEdge::insertVehicle(), IntermodalNetwork< E, L, N, V >::IntermodalNetwork(), GNEJunction::invalidateTLS(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), MSPedestrianPushButton::isActiveForEdge(), MSPedestrianPushButton::isActiveOnAnySideOfTheRoad(), RODFNet::isDestination(), RODFNet::isFalseSource(), MSLane::isInsertionSuccess(), RODFNet::isSource(), MSSOTLTrafficLightLogic::isThresholdPassed(), NBNodeCont::joinJunctions(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), MSDevice_BTreceiver::BTreceiverUpdate::leaveRange(), MSPedestrianPushButton::loadCrossingEdgeMap(), NIImporter_OpenDrive::loadNetwork(), MSPedestrianPushButton::loadPushButtons(), NBEdge::MainDirections::MainDirections(), ODDistrictCont::makeDistricts(), NBNodeCont::mapToNumericalIDs(), NBEdgeCont::mapToNumericalIDs(), MSSOTLE2Sensors::meanVehiclesSpeed(), METriggeredCalibrator::METriggeredCalibrator(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), NBRampsComputer::moveRampRight(), MSPModel_Striping::PState::moveToNextLane(), MSCalibrator::MSCalibrator(), MSChargingStation::MSChargingStation(), MSDevice_Battery::MSDevice_Battery(), NBLoadedTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_BTreceiver::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Example::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSTriggeredRerouter::notifyEnter(), MSE2Collector::notifyEnter(), MSDevice_Transportable::notifyLeave(), MSE3Collector::MSE3EntryReminder::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_Tripinfo::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSMeanData::MeanDataValues::notifyMove(), MSDevice_BTsender::notifyMove(), MSE2Collector::notifyMove(), GUIViewTraffic::onGamingClick(), GNEViewNet::onLeftBtnPress(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), RODFNet::idComp::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), MSEdge::by_id_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), MSRouteHandler::parseWalkPositions(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_SL2015::patchSpeed(), MSLCM_JE2013::patchSpeed(), MSLCM_LC2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSVehicle::planMove(), MSLane::planMovements(), MSRightOfWayJunction::postloadInit(), NBEdge::prepareEdgePriorities(), MSAbstractLaneChangeModel::primaryLaneChanged(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_ArealDetector::processGet(), TraCIServerAPI_Lane::processGet(), MSVehicle::processNextStop(), TraCIServerAPI_Vehicle::processSet(), NIXMLNodesHandler::processTrafficLightDefinitions(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NIImporter_OpenStreetMap::reconstructLayerElevation(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNodeCont::removeIsolatedRoads(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::rename(), NBEdgeCont::rename(), GNENet::renameEdge(), GNENet::renameJunction(), RORouteDef::repairCurrentRoute(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), MSBaseVehicle::reroute(), MSLane::resetPartialOccupation(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), MSLane::saveState(), MSDevice_Battery::setAirDragCoefficient(), NBNodeCont::setAsTLControlled(), MSChargingStation::setChargeDelay(), MSChargingStation::setChargingPower(), MSDevice_Battery::setConstantPowerIntake(), NBEdge::setControllingTLInformation(), MSChargingStation::setEfficency(), MSDevice_Battery::setFrontSurfaceArea(), MSDevice_Battery::setInternalMomentOfInertia(), GNEJunction::setLogicValid(), MSDevice_Battery::setMass(), MSDevice_Battery::setMaximumBatteryCapacity(), NIXMLEdgesHandler::setNodes(), MSLane::setPartialOccupation(), MSDevice_Battery::setPowerMax(), MSDevice_Battery::setPropulsionEfficiency(), MSDevice_Battery::setRadialDragCoefficient(), MSDevice_Battery::setRecuperationEfficiency(), MSLink::setRequestInformation(), MSDevice_Battery::setRollDragCoefficient(), MSTLLogicControl::TLSLogicVariants::setStateInstantiatingOnline(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBOwnTLDef::setTLControllingInformation(), NBTrafficLightLogicCont::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdge::shiftPositionAtNode(), NBEdgeCont::splitAt(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MELoop::teleportVehicle(), METriggeredCalibrator::tryEmit(), MSSOTLTrafficLightLogic::trySwitch(), MSVehicle::updateBestLanes(), MSSOTLTrafficLightLogic::updateCTS(), GNETLSEditorFrame::updateDescription(), MSSwarmTrafficLightLogic::updatePheromoneLevels(), MSSwarmTrafficLightLogic::updateSensitivities(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap(), MSPModel_Striping::PState::walk(), MSLCM_JE2013::wantsChange(), MSLCM_LC2013::wantsChange(), MSLCM_SL2015::wantsChangeSublane(), MSBatteryExport::write(), MSEmissionExport::write(), MSFCDExport::write(), MSInstantInductLoop::write(), MSLink::writeApproaching(), NBSign::writeAsPOI(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), MSFullExport::writeEdge(), MSXMLRawOut::writeEdge(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), RODFDetector::writeEmitterDefinition(), RODFDetectorCon::writeEmitterPOIs(), RODFDetectorCon::writeEmitters(), RODFDetectorCon::writeEndRerouterDetectors(), NWWriter_SUMO::writeInternalConnections(), writeInterval(), NWWriter_SUMO::writeJunction(), MSQueueExport::writeLane(), MSFullExport::writeLane(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_SUMO::writeRoundabout(), RODFDetectorCon::writeSpeedTrigger(), NWWriter_DlrNavteq::writeTrafficSignals(), MSFCDExport::writeTransportable(), MSInductLoop::writeTypedXMLOutput(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), PointOfInterest::writeXML(), SUMO::Polygon::writeXML(), MSRouteProbe::writeXMLOutput(), MSE2Collector::writeXMLOutput(), and RONet::~RONet().

SUMOAbstractRouter< MSEdge, SUMOVehicle > & MSDevice_Routing::getRouterTT ( const MSEdgeVector prohibited = MSEdgeVector())
static
void MSDevice::insertDefaultAssignmentOptions ( const std::string &  deviceName,
const std::string &  optionsTopic,
OptionsCont oc 
)
staticprotectedinherited

Adds common command options that allow to assign devices to vehicles.

Parameters
[in]deviceNameThe name of the device type
[in]optionsTopicThe options topic into which the options shall be added

!! describe

!! describe

!! describe

Definition at line 94 of file MSDevice.cpp.

References OptionsCont::addDescription(), OptionsCont::addSynonyme(), and OptionsCont::doRegister().

Referenced by MSDevice::generateOutput(), MSDevice_Battery::insertOptions(), MSDevice_Example::insertOptions(), MSDevice_BTsender::insertOptions(), MSDevice_BTreceiver::insertOptions(), MSDevice_Emissions::insertOptions(), and insertOptions().

static bool MSDevice_Routing::isEnabled ( )
inlinestatic

returns whether any routing actions take place

Definition at line 113 of file MSDevice_Routing.h.

References getRouterTT(), myEdgeSpeeds, myWithTaz, notifyEnter(), reroute(), and ~MSDevice_Routing().

Referenced by MSInsertionControl::determineCandidates(), and MSInsertionControl::emitVehicles().

bool MSDevice_Routing::notifyEnter ( SUMOVehicle veh,
MSMoveReminder::Notification  reason 
)
virtual

Computes a new route on vehicle insertion.

A new route is computed by calling the vehicle's "reroute" method, supplying "getEffort" as the edge effort retrieval method.

If the reroute period is larger than 0, an event is generated and added to the list of simulation step begin events which executes "wrappedRerouteCommandExecute".

Parameters
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns
Always false
See also
MSMoveReminder::notifyEnter
MSMoveReminder::Notification
MSVehicle::reroute
MSEventHandler
WrappingCommand

Reimplemented from MSMoveReminder.

Definition at line 238 of file MSDevice_Routing.cpp.

References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), WrappingCommand< T >::deschedule(), MSNet::getBeginOfTimestepEvents(), MSNet::getInstance(), myPeriod, myPreInsertionPeriod, myRerouteCommand, MSMoveReminder::NOTIFICATION_DEPARTED, and wrappedRerouteCommandExecute().

Referenced by isEnabled(), and MSStateHandler::myStartElement().

virtual bool MSMoveReminder::notifyLeave ( SUMOVehicle veh,
SUMOReal  lastPos,
Notification  reason 
)
inlinevirtualinherited

Called if the vehicle leaves the reminder's lane.

Informs if vehicle leaves reminder lane (due to lane change, removal from the network, or leaving to the next lane). The default is to do nothing.

Parameters
[in]vehThe leaving vehicle.
[in]lastPosPosition on the lane when leaving.
[in]reasonhow the vehicle leaves the lane
See also
Notification
Returns
True if the reminder wants to receive further info.

Reimplemented in MSMeanData::MeanDataValueTracker, MSE3Collector::MSE3LeaveReminder, MSInductLoop, MSE2Collector, MSTriggeredRerouter, MSDevice_BTsender, MSDevice_BTreceiver, MSMeanData::MeanDataValues, MSDevice_Tripinfo, MSDevice_Example, MSInstantInductLoop, MSDevice_Vehroutes, MSE3Collector::MSE3EntryReminder, MSMeanData_Net::MSLaneMeanDataValues, and MSDevice_Transportable.

Definition at line 175 of file MSMoveReminder.h.

References SUMOReal, UNUSED_PARAMETER, and MSMoveReminder::updateDetector().

virtual bool MSMoveReminder::notifyMove ( SUMOVehicle veh,
SUMOReal  oldPos,
SUMOReal  newPos,
SUMOReal  newSpeed 
)
inlinevirtualinherited

Checks whether the reminder still has to be notified about the vehicle moves.

Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from it's reminder-container.

Parameters
[in]vehVehicle that asks this reminder.
[in]oldPosPosition before move.
[in]newPosPosition after move with newSpeed.
[in]newSpeedMoving speed.
Returns
True if vehicle hasn't passed the reminder completely.

Reimplemented in MSE3Collector::MSE3LeaveReminder, MSTriggeredRerouter, MSE2Collector, MSInductLoop, MSDevice_BTsender, MSMeanData::MeanDataValues, MSDevice_BTreceiver, MSDevice_Emissions, MSDevice_Tripinfo, MSE3Collector::MSE3EntryReminder, MSInstantInductLoop, MSDevice_Example, MSDevice_Battery, and MSDevice_Transportable.

Definition at line 150 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

virtual void MSMoveReminder::notifyMoveInternal ( SUMOVehicle veh,
SUMOReal  timeOnLane,
SUMOReal  speed 
)
inlinevirtualinherited

Internal notification about the vehicle moves.

Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from it's reminder-container.

Parameters
[in]vehVehicle that asks this reminder.
[in]timeOnLanetime the vehicle spent on the lane.
[in]speedMoving speed.

Reimplemented in MSMeanData::MeanDataValueTracker, MSDevice_Tripinfo, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_Amitran::MSLaneMeanDataValues, and MSMeanData_Emissions::MSLaneMeanDataValues.

Definition at line 201 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

Referenced by MSMeanData::MeanDataValues::notifyMove(), and MSMoveReminder::updateDetector().

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

Invalidated assignment operator.

Referenced by skipRouting().

SUMOTime MSDevice_Routing::preInsertionReroute ( const SUMOTime  currentTime)
private

Performs rerouting before insertion into the network.

A new route is computed by calling the reroute method. If the routing involves taz the internal route cache is asked beforehand.

Parameters
[in]currentTimeThe current simulation time
Returns
The offset to the next call (the rerouting period "myPreInsertionPeriod")
See also
MSVehicle::reroute
MSEventHandler
WrappingCommand

Definition at line 258 of file MSDevice_Routing.cpp.

References MSRoute::begin(), DELTA_T, MSEdge::EDGEFUNCTION_DISTRICT, SUMOVehicle::getID(), MSRoute::getLastEdge(), MSEdge::getPurpose(), SUMOVehicle::getRoute(), myCachedRoutes, MSDevice::myHolder, myPreInsertionPeriod, mySkipRouting, SUMOVehicle::replaceRoute(), reroute(), and WRITE_WARNING.

Referenced by MSDevice_Routing(), and skipRouting().

void MSMoveReminder::removeFromVehicleUpdateValues ( SUMOVehicle veh)
protectedinherited
void MSMoveReminder::setDescription ( const std::string &  description)
inlineinherited
void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 74 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::mapToNumericalIDs(), NBEdgeCont::mapToNumericalIDs(), NBNodeCont::rename(), and NBEdgeCont::rename().

void MSDevice_Routing::skipRouting ( const SUMOTime  currentTime)
inline

Labels the current time step as "unroutable".

Sets mySkipRouting to the current time in order to skip rerouting. This is useful for pre insertion routing when we know in advance we cannot insert.

Parameters
[in]currentTimeThe current simulation time

Definition at line 179 of file MSDevice_Routing.h.

References adaptEdgeEfforts(), getAssumedSpeed(), getEffort(), MSDevice_Routing(), myRouter, mySkipRouting, operator=(), preInsertionReroute(), SUMOReal, and wrappedRerouteCommandExecute().

Referenced by MSInsertionControl::checkCandidates().

void MSMoveReminder::updateDetector ( SUMOVehicle veh,
SUMOReal  entryPos,
SUMOReal  leavePos,
SUMOTime  entryTime,
SUMOTime  currentTime,
SUMOTime  leaveTime,
bool  cleanUp 
)
inherited
SUMOTime MSDevice_Routing::wrappedRerouteCommandExecute ( SUMOTime  currentTime)
private

Performs rerouting after a period.

A new route is computed by calling the vehicle's "reroute" method, supplying "getEffort" as the edge effort retrieval method.

This method is called from the event handler at the begin of a simulation step after the rerouting period is over. The reroute period is returned.

Parameters
[in]currentTimeThe current simulation time
Returns
The offset to the next call (the rerouting period "myPeriod")
See also
MSVehicle::reroute
MSEventHandler
WrappingCommand

Definition at line 282 of file MSDevice_Routing.cpp.

References myPeriod, reroute(), and SUMOReal.

Referenced by notifyEnter(), and skipRouting().

Field Documentation

SUMOTime MSDevice_Routing::myAdaptationInterval = -1
staticprivate

At which time interval the edge weights get updated.

Definition at line 330 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), buildVehicleDevices(), insertOptions(), and reroute().

int MSDevice_Routing::myAdaptationSteps
staticprivate

The number of steps for averaging edge speeds (ring-buffer)

Definition at line 336 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), buildVehicleDevices(), and insertOptions().

int MSDevice_Routing::myAdaptationStepsIndex = 0
staticprivate

The current index in the pastEdgeSpeed ring-buffer.

Definition at line 339 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts().

SUMOReal MSDevice_Routing::myAdaptationWeight
staticprivate

Information which weight prior edge efforts have.

Definition at line 327 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), and buildVehicleDevices().

std::map< std::pair< const MSEdge *, const MSEdge * >, const MSRoute * > MSDevice_Routing::myCachedRoutes
staticprivate

The container of pre-calculated routes.

Definition at line 348 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), cleanup(), and preInsertionReroute().

std::string MSMoveReminder::myDescription
protectedinherited

a description of this moveReminder

Definition at line 225 of file MSMoveReminder.h.

Referenced by MSMoveReminder::getDescription(), and MSMoveReminder::setDescription().

std::vector< SUMOReal > MSDevice_Routing::myEdgeSpeeds
staticprivate

The container of edge speeds.

Definition at line 324 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), buildVehicleDevices(), getEffort(), insertOptions(), and isEnabled().

Command * MSDevice_Routing::myEdgeWeightSettingCommand = 0
staticprivate

The weights adaptation/overwriting command.

Definition at line 321 of file MSDevice_Routing.h.

Referenced by buildVehicleDevices(), insertOptions(), and MSDevice_Routing().

SUMOTime MSDevice_Routing::myLastAdaptation = -1
staticprivate

Information when the last edge weight adaptation occured.

Definition at line 333 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), buildVehicleDevices(), insertOptions(), and reroute().

SUMOTime MSDevice_Routing::myLastRouting
private

The last time a routing took place.

Definition at line 312 of file MSDevice_Routing.h.

Referenced by reroute().

std::vector< std::vector< SUMOReal > > MSDevice_Routing::myPastEdgeSpeeds
staticprivate

The container of edge speeds.

Definition at line 342 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), and buildVehicleDevices().

SUMOTime MSDevice_Routing::myPeriod
private

The period with which a vehicle shall be rerouted.

Definition at line 306 of file MSDevice_Routing.h.

Referenced by notifyEnter(), and wrappedRerouteCommandExecute().

SUMOTime MSDevice_Routing::myPreInsertionPeriod
private

The period with which a vehicle shall be rerouted before insertion.

Definition at line 309 of file MSDevice_Routing.h.

Referenced by MSDevice_Routing(), notifyEnter(), and preInsertionReroute().

SUMOReal MSDevice_Routing::myRandomizeWeightsFactor = 0
staticprivate

Whether to disturb edge weights dynamically.

Definition at line 357 of file MSDevice_Routing.h.

Referenced by buildVehicleDevices(), and getEffort().

WrappingCommand< MSDevice_Routing >* MSDevice_Routing::myRerouteCommand
private

The (optional) command responsible for rerouting.

Definition at line 318 of file MSDevice_Routing.h.

Referenced by MSDevice_Routing(), notifyEnter(), and ~MSDevice_Routing().

SUMOAbstractRouter< MSEdge, SUMOVehicle > * MSDevice_Routing::myRouter = 0
staticprivate

The router to use.

Definition at line 351 of file MSDevice_Routing.h.

Referenced by cleanup(), reroute(), and skipRouting().

AStarRouter< MSEdge, SUMOVehicle, prohibited_withPermissions< MSEdge, SUMOVehicle > > * MSDevice_Routing::myRouterWithProhibited = 0
staticprivate

The router to use by rerouter elements.

Definition at line 354 of file MSDevice_Routing.h.

Referenced by cleanup(), and getRouterTT().

SUMOTime MSDevice_Routing::mySkipRouting
private

The time for which routing may be skipped because we cannot be inserted.

Definition at line 315 of file MSDevice_Routing.h.

Referenced by preInsertionReroute(), and skipRouting().

bool MSDevice_Routing::myWithTaz
staticprivate

whether taz shall be used at initial rerouting

Definition at line 345 of file MSDevice_Routing.h.

Referenced by buildVehicleDevices(), cleanup(), isEnabled(), and reroute().


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