SUMO - Simulation of Urban MObility
|
#include <MSRoute.h>
Public Member Functions | |
void | addReference () const |
increments the reference counter for the route | |
MSRouteIterator | begin () const |
Returns the begin of the list of edges to pass. | |
bool | contains (const MSEdge *const edge) const |
bool | containsAnyOf (const std::vector< MSEdge * > &edgelist) const |
MSRouteIterator | end () const |
Returns the end of the list of edges to pass. | |
const RGBColor & | getColor () const |
Returns the color. | |
SUMOReal | getDistanceBetween (SUMOReal fromPos, SUMOReal toPos, const MSEdge *fromEdge, const MSEdge *toEdge) const |
Compute the distance between 2 given edges on this route, including the length of internal lanes. | |
const MSEdgeVector & | getEdges () const |
const std::string & | getID () const |
Returns the id. | |
const MSEdge * | getLastEdge () const |
returns the destination edge | |
SUMOReal | getLength () const |
const std::vector < SUMOVehicleParameter::Stop > & | getStops () const |
Returns the stops. | |
MSRoute (const std::string &id, const MSEdgeVector &edges, unsigned int references, const RGBColor &c, const std::vector< SUMOVehicleParameter::Stop > &stops) | |
Constructor. | |
const MSEdge * | operator[] (unsigned index) const |
void | release () const |
deletes the route if there are no further references to it | |
void | setID (const std::string &newID) |
resets the id | |
unsigned | size () const |
Returns the number of edges to pass. | |
void | writeEdgeIDs (OutputDevice &os, const MSEdge *const from, const MSEdge *const upTo=0) const |
output the edge ids up to but not including the id of the given edge | |
virtual | ~MSRoute () |
Destructor. |
Static Public Member Functions | |
static void | clear () |
Clears the dictionary (delete all known routes, too) | |
static bool | dictionary (const std::string &id, const MSRoute *route) |
Adds a route to the dictionary. | |
static bool | dictionary (const std::string &id, RandomDistributor< const MSRoute * > *routeDist) |
Adds a route distribution to the dictionary. | |
static const MSRoute * | dictionary (const std::string &id) |
Returns the named route or a sample from the named distribution. | |
static RandomDistributor < const MSRoute * > * | distDictionary (const std::string &id) |
Returns the named route distribution. | |
static void | insertIDs (std::vector< std::string > &into) |
Protected Attributes | |
std::string | myID |
The name of the object. |
Private Types | |
typedef std::map< std::string, const MSRoute * > | RouteDict |
Definition of the dictionary container. | |
typedef std::map< std::string, RandomDistributor< const MSRoute * > * > | RouteDistDict |
Definition of the dictionary container. |
Private Attributes | |
RGBColor | myColor |
The color. | |
MSEdgeVector | myEdges |
The list of edges to pass. | |
unsigned int | myReferenceCounter |
Information by how many vehicles the route is used. | |
std::vector < SUMOVehicleParameter::Stop > | myStops |
List of the stops on the parsed route. |
Static Private Attributes | |
static RouteDict | myDict |
The dictionary container. | |
static RouteDistDict | myDistDict |
The dictionary container. |
|
private |
|
private |
MSRoute::MSRoute | ( | const std::string & | id, |
const MSEdgeVector & | edges, | ||
unsigned int | references, | ||
const RGBColor & | c, | ||
const std::vector< SUMOVehicleParameter::Stop > & | stops | ||
) |
Constructor.
Definition at line 59 of file MSRoute.cpp.
|
virtual |
Destructor.
Definition at line 68 of file MSRoute.cpp.
void MSRoute::addReference | ( | ) | const |
increments the reference counter for the route
Definition at line 94 of file MSRoute.cpp.
References myReferenceCounter.
Referenced by MSDevice_Vehroutes::addRoute(), MSRouteHandler::closeVehicle(), MSBaseVehicle::MSBaseVehicle(), MSDevice_Vehroutes::MSDevice_Vehroutes(), MSRouteProbe::notifyEnter(), MSDevice_Routing::preInsertionReroute(), MSVehicle::replaceRoute(), and MSBaseVehicle::replaceRouteEdges().
MSRouteIterator MSRoute::begin | ( | ) | const |
Returns the begin of the list of edges to pass.
Definition at line 71 of file MSRoute.cpp.
References myEdges.
Referenced by MSRouteHandler::closeVehicle(), traci::TraCIServer::commandAddVehicle(), GUIVehicle::draw(), MSVehicle::enterLaneAtLaneChange(), MSEdge::getDepartLane(), getMaxSpeedRegardingNextLanes(), MSLane::isInsertionSuccess(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::replaceRoute(), and MSRouteProbe::writeXMLOutput().
|
static |
Clears the dictionary (delete all known routes, too)
Definition at line 154 of file MSRoute.cpp.
References myDict, and myDistDict.
Referenced by MSNet::clearAll().
Definition at line 95 of file MSRoute.h.
References myEdges.
Referenced by containsAnyOf(), and MSVehicle::replaceRoute().
Definition at line 197 of file MSRoute.cpp.
References contains().
Referenced by MSTriggeredRerouter::getCurrentReroute(), and MSTriggeredRerouter::hasCurrentReroute().
Adds a route to the dictionary.
Returns true if the route could be added, false if a route (distribution) with the same name already exists.
[in] | id | the id for the new route |
[in] | route | pointer to the route object |
Definition at line 110 of file MSRoute.cpp.
References myDict, and myDistDict.
Referenced by MSInsertionControl::checkFlows(), MSRouteHandler::closeFlow(), MSRouteHandler::closeRoute(), MSRouteHandler::closeRouteDistribution(), MSRouteHandler::closeVehicle(), traci::TraCIServer::commandAddVehicle(), MSRouteProbe::MSRouteProbe(), MSTriggeredRerouter::myStartElement(), MSRouteHandler::openRoute(), MSRouteHandler::openRouteDistribution(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Route::processSet(), TraCIServerAPI_Vehicle::processSet(), MSBaseVehicle::replaceRouteEdges(), and MSRouteProbe::writeXMLOutput().
|
static |
Adds a route distribution to the dictionary.
Returns true if the distribution could be added, false if a route (distribution) with the same name already exists.
[in] | id | the id for the new route distribution |
[in] | route | pointer to the distribution object |
Definition at line 120 of file MSRoute.cpp.
References myDict, and myDistDict.
|
static |
Returns the named route or a sample from the named distribution.
Returns 0 if no route and no distribution with the given name exists or if the distribution exists and is empty.
[in] | id | the id of the route or the distribution |
Definition at line 130 of file MSRoute.cpp.
References myDict, and myDistDict.
|
static |
Returns the named route distribution.
Returns 0 if no route distribution with the given name exists.
[in] | id | the id of the route distribution |
Definition at line 144 of file MSRoute.cpp.
References myDistDict.
Referenced by MSInsertionControl::add(), and MSRouteProbe::MSRouteProbe().
MSRouteIterator MSRoute::end | ( | ) | const |
Returns the end of the list of edges to pass.
Definition at line 76 of file MSRoute.cpp.
References myEdges.
Referenced by MSVehicle::addStop(), GUIVehicle::draw(), MSVehicle::ends(), MSDevice_Tripinfo::generateOutput(), MSVehicle::getBestLanes(), getDistanceBetween(), getMaxSpeedRegardingNextLanes(), MSBaseVehicle::hasValidRoute(), MSVehicle::moveChecked(), MSVehicle::moveRegardingCritical(), TraCIServerAPI_Route::processGet(), TraCIServerAPI_Vehicle::processGet(), MSVehicle::vsafeCriticalCont(), MSVehicle::willPass(), and MSRouteProbe::writeXMLOutput().
const RGBColor & MSRoute::getColor | ( | ) | const |
Returns the color.
Definition at line 444 of file MSRoute.cpp.
References myColor.
Referenced by MSBaseVehicle::replaceRouteEdges().
SUMOReal MSRoute::getDistanceBetween | ( | SUMOReal | fromPos, |
SUMOReal | toPos, | ||
const MSEdge * | fromEdge, | ||
const MSEdge * | toEdge | ||
) | const |
Compute the distance between 2 given edges on this route, including the length of internal lanes.
[in] | fromPos | position on the first edge, at wich the computed distance begins |
[in] | toPos | position on the last edge, at which the coumputed distance endsance |
[in] | fromEdge | edge at wich computation begins |
[in] | toEdge | edge at which distance computation shall stop |
Definition at line 401 of file MSRoute.cpp.
References end(), max, myEdges, and SUMOReal.
Referenced by TraCIServerAPI_Vehicle::commandDistanceRequest(), TraCIServerAPI_Simulation::commandDistanceRequest(), and MSVehicle::getDistanceToPosition().
|
inline |
Definition at line 122 of file MSRoute.h.
References myEdges.
Referenced by traci::TraCIServer::commandAddVehicle(), MSVehicle::replaceRoute(), and GUIVehicle::setFunctionalColor().
|
inlineinherited |
Returns the id.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 61 of file Named.h.
References Named::myID.
Referenced by MSDetectorControl::add(), ShapeContainer::add(), RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), RORDLoader_SUMOBase::myCharacters(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_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(), NBLoadedTLDef::SignalGroup::patchTYellow(), RORouteDef_Complete::preComputeCurrentRoute(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSInstantInductLoop::write(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), MSInductLoop::writeTypedXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().
const MSEdge * MSRoute::getLastEdge | ( | ) | const |
returns the destination edge
Definition at line 87 of file MSRoute.cpp.
References myEdges.
Referenced by MSBaseVehicle::calculateArrivalPos(), MSTriggeredRerouter::notifyEnter(), and MSBaseVehicle::reroute().
SUMOReal MSRoute::getLength | ( | ) | const |
Definition at line 391 of file MSRoute.cpp.
References myEdges, and SUMOReal.
Referenced by MSDevice_Tripinfo::generateOutput().
const std::vector< SUMOVehicleParameter::Stop > & MSRoute::getStops | ( | ) | const |
Returns the stops.
Definition at line 450 of file MSRoute.cpp.
References myStops.
Referenced by MSVehicle::MSVehicle(), and MSBaseVehicle::replaceRouteEdges().
|
static |
Definition at line 167 of file MSRoute.cpp.
References myDict, and myDistDict.
Referenced by TraCIServerAPI_Route::processGet().
const MSEdge * MSRoute::operator[] | ( | unsigned | index | ) | const |
Definition at line 209 of file MSRoute.cpp.
References myEdges.
void MSRoute::release | ( | ) | const |
deletes the route if there are no further references to it
Definition at line 100 of file MSRoute.cpp.
References myDict, Named::myID, and myReferenceCounter.
Referenced by MSDevice_Vehroutes::addRoute(), MSRouteHandler::closeVehicle(), MSVehicle::replaceRoute(), MSBaseVehicle::replaceRouteEdges(), MSBaseVehicle::~MSBaseVehicle(), and MSDevice_Vehroutes::~MSDevice_Vehroutes().
|
inlineinherited |
resets the id
Definition at line 67 of file Named.h.
References Named::myID.
Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().
unsigned MSRoute::size | ( | ) | const |
Returns the number of edges to pass.
Definition at line 81 of file MSRoute.cpp.
References myEdges.
Referenced by MSEdge::getDepartLane(), TraCIServerAPI_Route::processGet(), and TraCIServerAPI_Vehicle::processGet().
void MSRoute::writeEdgeIDs | ( | OutputDevice & | os, |
const MSEdge *const | from, | ||
const MSEdge *const | upTo = 0 |
||
) | const |
output the edge ids up to but not including the id of the given edge
Definition at line 179 of file MSRoute.cpp.
References myEdges.
Referenced by MSDevice_Vehroutes::writeXMLRoute().
|
private |
|
staticprivate |
The dictionary container.
Definition at line 210 of file MSRoute.h.
Referenced by clear(), dictionary(), insertIDs(), and release().
|
staticprivate |
The dictionary container.
Definition at line 216 of file MSRoute.h.
Referenced by clear(), dictionary(), distDictionary(), and insertIDs().
|
private |
The list of edges to pass.
Definition at line 194 of file MSRoute.h.
Referenced by begin(), contains(), end(), getDistanceBetween(), getEdges(), getLastEdge(), getLength(), operator[](), size(), and writeEdgeIDs().
|
protectedinherited |
The name of the object.
Reimplemented in MS_E2_ZS_CollectorOverLanes.
Definition at line 83 of file Named.h.
Referenced by NLDetectorBuilder::addE3Entry(), NLDetectorBuilder::addE3Exit(), NBEdge::computeEdgeShape(), Named::getID(), NBEdge::getLaneID(), NBEdge::init(), RORouteDef_OrigDest::preComputeCurrentRoute(), RORouteDef_Alternatives::preComputeCurrentRoute(), RORouteDef_Complete::preComputeCurrentRoute(), release(), Named::setID(), NBEdge::splitGeometry(), MSXMLRawOut::writeLane(), NBNode::writeLogic(), MSE3Collector::writeXMLOutput(), and MSMeanData::writeXMLOutput().
|
mutableprivate |
Information by how many vehicles the route is used.
Definition at line 197 of file MSRoute.h.
Referenced by addReference(), and release().
|
private |
List of the stops on the parsed route.
Definition at line 203 of file MSRoute.h.
Referenced by getStops().