SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:
MSDevice MSMoveReminder Named

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.
virtual void generateOutput () const
 Called on writing tripinfo output.
const std::string & getDescription () const
SUMOVehiclegetHolder () const
 Returns the vehicle that holds this device.
const std::string & getID () const
 Returns the id.
const MSLanegetLane () const
 Returns the lane the reminder works on.
virtual void notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
 Internal notification about the vehicle moves.
void setDescription (const std::string &description)
void setID (const std::string &newID)
 resets the id
 ~MSDevice_Routing ()
 Destructor.
Methods called on vehicle movement / state change, overwriting MSDevice
bool notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason)
 Computes a new route on vehicle insertion.
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.
virtual bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
 Called if the vehicle leaves the reminder's lane.

Static Public Member Functions

static void buildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into)
 Build devices for the given vehicle, if needed.
static void cleanup ()
 deletes the router instance
static void insertOptions (OptionsCont &oc)
 Inserts MSDevice_Routing-options.

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.
static bool equippedByDefaultAssignmentOptions (const OptionsCont &oc, const std::string &deviceName, SUMOVehicle &v)
 Determines whether a vehicle should get a certain device.

Protected Attributes

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

Private Member Functions

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

Static Private Member Functions

static SUMOReal getEffort (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t)
 Returns the effort to pass an edge.
static SUMOAbstractRouter
< MSEdge, SUMOVehicle > & 
getRouter ()
 get the router, initialize on first use
Network state adaptation
static SUMOTime adaptEdgeEfforts (SUMOTime currentTime)
 Adapt edge efforts by the current edge states.

Private Attributes

SUMOTime myPeriod
 The period with which a vehicle shall be rerouted.
SUMOTime myPreInsertionPeriod
 The period with which a vehicle shall be rerouted before insertion.
WrappingCommand
< MSDevice_Routing > * 
myRerouteCommand
 The (optional) command responsible for rerouting.

Static Private Attributes

static SUMOTime myAdaptationInterval
 Information which weight prior edge efforts have.
static SUMOReal myAdaptationWeight
 Information which weight prior edge efforts have.
static std::map< std::pair
< const MSEdge *, const MSEdge * >
, const MSRoute * > 
myCachedRoutes
 The container of pre-calculated routes.
static std::vector< SUMORealmyEdgeEfforts
 The container of edge efforts.
static CommandmyEdgeWeightSettingCommand = 0
 The weights adaptation/overwriting command.
static SUMOAbstractRouter
< MSEdge, SUMOVehicle > * 
myRouter = 0
 The router to use.
static bool myWithTaz
 whether taz shall be used at initial rerouting

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 "myEdgeEfforts" 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 71 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 171 of file MSDevice_Routing.cpp.

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

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

References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), SUMOVehicleParameter::depart, MSNet::getInsertionEvents(), MSNet::getInstance(), SUMOVehicle::getParameter(), myRerouteCommand, myWithTaz, and preInsertionReroute().

Referenced by buildVehicleDevices().

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 239 of file MSDevice_Routing.cpp.

References MSNet::getEdgeControl(), MSEdgeControl::getEdges(), MSNet::getInstance(), myAdaptationInterval, myAdaptationWeight, myCachedRoutes, myEdgeEfforts, and SUMOReal.

Referenced by buildVehicleDevices().

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

Adds this object to the given container.

Parameters
in,filled]cont The container to add this item to

Definition at line 121 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
filled]into The vector to store the built device in

Reimplemented from MSDevice.

Definition at line 102 of file MSDevice_Routing.cpp.

References MSEventControl::ADAPT_AFTER_EXECUTION, adaptEdgeEfforts(), MSEventControl::addEvent(), MSEdge::dictionary(), MSDevice::equippedByDefaultAssignmentOptions(), SUMOVehicleParameter::fromTaz, OptionsCont::getBool(), MSNet::getEdgeControl(), MSEdgeControl::getEdges(), MSNet::getEndOfTimestepEvents(), OptionsCont::getFloat(), SUMOVehicle::getID(), MSNet::getInstance(), OptionsCont::getOptions(), SUMOVehicle::getParameter(), OptionsCont::getString(), MSNet::getTravelTime(), OptionsCont::isSet(), MSDevice_Routing(), myAdaptationInterval, myAdaptationWeight, myEdgeEfforts, myEdgeWeightSettingCommand, myWithTaz, STEPS2TIME, string2time(), SUMOReal, SUMOVehicleParameter::toTaz, VEHPARS_FORCE_REROUTE, SUMOVehicleParameter::wasSet(), and WRITE_ERROR.

void MSDevice_Routing::cleanup ( )
static

deletes the router instance

Definition at line 274 of file MSDevice_Routing.cpp.

References myRouter.

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_Example, MSDevice_Vehroutes, MSDevice_Tripinfo, and MSDevice_Emissions.

Definition at line 122 of file MSDevice.h.

const std::string& MSMoveReminder::getDescription ( ) const
inlineinherited

Definition at line 214 of file MSMoveReminder.h.

References MSMoveReminder::myDescription.

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 229 of file MSDevice_Routing.cpp.

References MSEdge::getMinimumTravelTime(), MSEdge::getNumericalID(), MAX2(), and myEdgeEfforts.

Referenced by getRouter().

SUMOVehicle& MSDevice::getHolder ( ) const
inlineinherited

Returns the vehicle that holds this device.

Returns
The vehicle that holds this device

Definition at line 105 of file MSDevice.h.

References MSDevice::myHolder.

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

Returns the id.

Returns
The stored id

Definition at line 60 of file Named.h.

References Named::myID.

Referenced by NIImporter_SUMO::_loadNetwork(), MSVehicleTransfer::add(), TraCIServerAPI_Lane::StoringVisitor::add(), Named::StoringVisitor::add(), MSDetectorControl::add(), RORouteDef::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIXMLConnectionsHandler::addCrossing(), RODFDetectorCon::addDetector(), RONet::addEdge(), ROJTREdge::addFollowerProbability(), MSTLLogicControl::TLSLogicVariants::addLogic(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), NBTrafficLightLogic::addStep(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), GUITrafficLightLogicWrapper::begin2TrackPhases(), MSPerson::MSPersonStage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Waiting::beginEventOutput(), NIVisumTL::build(), RODFNet::buildApproachList(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NBNode::buildCrossings(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), RODFNet::buildEdgeFlowMap(), NBNode::buildInnerEdges(), NBEdge::buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBNode::buildWalkingAreas(), MSSimpleTrafficLightLogic::changeStepAndDuration(), NBEdge::checkGeometry(), MSVehicleTransfer::checkInsertions(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBTrafficLightDefinition::collectEdges(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), RODFNet::computeRoutesFor(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NGNet::connect(), MSAbstractLaneChangeModel::continueLaneChangeManeuver(), NLDetectorBuilder::convUncontE2PosLength(), GUINet::createTLWrapper(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSPerson::MSPersonStage_Driving::endEventOutput(), MSPerson::MSPersonStage_Waiting::endEventOutput(), MSE3Collector::enter(), MSCalibrator::execute(), Command_SaveTLSState::execute(), Command_SaveTLSSwitchStates::execute(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), MSPModel_Striping::MovePedestrians::execute(), MSVehicle::executeMove(), MSLane::executeMovements(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), MSNet::getBusStopID(), NBEdge::getCrossingAngle(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), PedestrianEdge< E, L, N >::getEffort(), NBEdge::getFirstNonPedestrianLane(), MS_E2_ZS_CollectorOverLanes::getLanePredeccessorLanes(), AGStreet::getName(), NIImporter_VISUM::getNamedEdgeContinuating(), MSPModel_Striping::getNextLane(), GUIVehicle::getParameterWindow(), GUITrafficLightLogicWrapper::getPopUpMenu(), NLTriggerBuilder::getPosition(), NLDetectorBuilder::getPositionChecking(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBNode::guessCrossings(), RODFDetectorCon::guessEmptyFlows(), NBNodeCont::guessTLs(), GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), MSTrafficLightLogic::init(), PedestrianEdge< E, L, N >::initPedestrianNetwork(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBNode::invalidateTLS(), MSTLLogicControl::isActive(), RODFNet::isDestination(), RODFNet::isFalseSource(), RODFNet::isSource(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), NBRampsComputer::moveRampRight(), MSPModel_Striping::PState::moveToNextLane(), MSCalibrator::MSCalibrator(), MSPerson::MSPersonStage_Waiting::MSPersonStage_Waiting(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_BTreceiver::notifyEnter(), MSDevice_Tripinfo::notifyEnter(), MSDevice_BTsender::notifyEnter(), MSDevice_Example::notifyEnter(), MSCalibrator::VehicleRemover::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), MSDevice_Person::notifyLeave(), MSDevice_Example::notifyLeave(), MSDevice_BTreceiver::notifyLeave(), MSDevice_BTsender::notifyLeave(), MSDevice_Example::notifyMove(), MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::notifyMove(), GUIViewTraffic::onGamingClick(), RORouteHandler::openRoute(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), RODFNet::idComp::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), MSEdge::by_id_sorter::operator()(), NBNode::nodes_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(), NBLoadedSUMOTLDef::patchIfCrossingsAdded(), MSLCM_JE2013::patchSpeed(), NBLoadedTLDef::SignalGroup::patchTYellow(), MSRightOfWayJunction::postloadInit(), AGStreet::print(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Vehicle::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_Vehicle::processSet(), NWWriter_SUMO::prohibitionConnection(), MSPModel_Striping::PState::PState(), NBEdgeCont::recheckPostProcessConnections(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), MSCalibrator::removePending(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), RODFNet::revalidateFlows(), PCPolyContainer::save(), RONet::saveAndRemoveRoutesUntil(), MSBaseVehicle::saveState(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), NIXMLEdgesHandler::setNodes(), MSLink::setRequestInformation(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), MSLane::succLinkSec(), GUITrafficLightLogicWrapper::switchTLSLogic(), MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility(), TraCIServerAPI_Vehicle::vtdMap_matchingEdgeLane(), TraCIServerAPI_Vehicle::vtdMap_matchingRoutePosition(), MSLCM_JE2013::wantsChange(), MSFCDExport::write(), MSEmissionExport::write(), MSInstantInductLoop::write(), 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(), 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(), MSInductLoop::writeTypedXMLOutput(), RODFDetectorCon::writeValidationDetectors(), MSFullExport::writeVehicles(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

SUMOAbstractRouter< MSEdge, SUMOVehicle > & MSDevice_Routing::getRouter ( )
staticprivate

get the router, initialize on first use

Definition at line 256 of file MSDevice_Routing.cpp.

References getEffort(), OptionsCont::getOptions(), OptionsCont::getString(), myRouter, and MSEdge::numericalDictSize().

Referenced by preInsertionReroute(), and wrappedRerouteCommandExecute().

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
filled]oc The options container to add the options to

!! describe

!! describe

!! describe

Definition at line 84 of file MSDevice.cpp.

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

Referenced by MSDevice_BTsender::insertOptions(), MSDevice_BTreceiver::insertOptions(), MSDevice_Emissions::insertOptions(), and insertOptions().

void MSDevice_Routing::insertOptions ( OptionsCont oc)
static

Inserts MSDevice_Routing-options.

Parameters
filled]oc The options container to add the options to

Reimplemented from MSDevice.

Definition at line 69 of file MSDevice_Routing.cpp.

References OptionsCont::addDescription(), OptionsCont::addOptionSubTopic(), OptionsCont::addSynonyme(), OptionsCont::doRegister(), MSDevice::insertDefaultAssignmentOptions(), myEdgeEfforts, and myEdgeWeightSettingCommand.

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 180 of file MSDevice_Routing.cpp.

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

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, MSE2Collector, MSInductLoop, MSMeanData::MeanDataValues, MSDevice_BTsender, MSDevice_BTreceiver, MSDevice_Example, MSInstantInductLoop, MSDevice_Vehroutes, MSE3Collector::MSE3EntryReminder, MSDevice_Person, MSDevice_Tripinfo, and MSMeanData_Net::MSLaneMeanDataValues.

Definition at line 175 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

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, MSE2Collector, MSInductLoop, MSMeanData::MeanDataValues, MSDevice_BTsender, MSDevice_BTreceiver, MSDevice_Emissions, MSE3Collector::MSE3EntryReminder, MSInstantInductLoop, MSDevice_Example, MSDevice_Person, and MSDevice_Tripinfo.

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, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, MSMeanData_Amitran::MSLaneMeanDataValues, and MSMeanData_Emissions::MSLaneMeanDataValues.

Definition at line 202 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

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

Invalidated assignment operator.

SUMOTime MSDevice_Routing::preInsertionReroute ( SUMOTime  currentTime)
private

Performs rerouting at insertion into the network.

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

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 204 of file MSDevice_Routing.cpp.

References MSRoute::addReference(), MSEdge::dictionary(), SUMOVehicleParameter::fromTaz, SUMOVehicle::getParameter(), SUMOVehicle::getRoute(), getRouter(), myCachedRoutes, MSDevice::myHolder, myPreInsertionPeriod, SUMOVehicle::replaceRoute(), SUMOVehicle::reroute(), and SUMOVehicleParameter::toTaz.

Referenced by MSDevice_Routing().

void MSMoveReminder::setDescription ( const std::string &  description)
inlineinherited

Definition at line 210 of file MSMoveReminder.h.

References MSMoveReminder::myDescription.

Referenced by MSCalibrator::MSCalibrator().

void Named::setID ( const std::string &  newID)
inlineinherited

resets the id

Parameters
[in]newIDThe new id of this object

Definition at line 68 of file Named.h.

References Named::myID.

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

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 222 of file MSDevice_Routing.cpp.

References getRouter(), MSDevice::myHolder, myPeriod, and SUMOVehicle::reroute().

Referenced by notifyEnter().

Field Documentation

SUMOTime MSDevice_Routing::myAdaptationInterval
staticprivate

Information which weight prior edge efforts have.

Definition at line 239 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), and buildVehicleDevices().

SUMOReal MSDevice_Routing::myAdaptationWeight
staticprivate

Information which weight prior edge efforts have.

Definition at line 236 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 245 of file MSDevice_Routing.h.

Referenced by adaptEdgeEfforts(), and preInsertionReroute().

std::string MSMoveReminder::myDescription
protectedinherited

a description of this moveReminder

Definition at line 223 of file MSMoveReminder.h.

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

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

The container of edge efforts.

Definition at line 233 of file MSDevice_Routing.h.

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

Command * MSDevice_Routing::myEdgeWeightSettingCommand = 0
staticprivate

The weights adaptation/overwriting command.

Definition at line 230 of file MSDevice_Routing.h.

Referenced by buildVehicleDevices(), and insertOptions().

MSLane* const MSMoveReminder::myLane
protectedinherited
SUMOTime MSDevice_Routing::myPeriod
private

The period with which a vehicle shall be rerouted.

Definition at line 221 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 224 of file MSDevice_Routing.h.

Referenced by notifyEnter(), and preInsertionReroute().

WrappingCommand< MSDevice_Routing >* MSDevice_Routing::myRerouteCommand
private

The (optional) command responsible for rerouting.

Definition at line 227 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 248 of file MSDevice_Routing.h.

Referenced by cleanup(), and getRouter().

bool MSDevice_Routing::myWithTaz
staticprivate

whether taz shall be used at initial rerouting

Definition at line 242 of file MSDevice_Routing.h.

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


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