Eclipse SUMO - Simulation of Urban MObility
NBEdge::Connection Struct Referencefinal

A structure which describes a connection between edges or lanes. More...

#include <NBEdge.h>

Inheritance diagram for NBEdge::Connection:
Collaboration diagram for NBEdge::Connection:

Public Member Functions

void clearParameter ()
 Clears the parameter map. More...
 
 Connection (int fromLane_, NBEdge *toEdge_, int toLane_)
 Constructor. More...
 
 Connection (int fromLane_, NBEdge *toEdge_, int toLane_, bool mayDefinitelyPass_, bool keepClear_=true, double contPos_=UNSPECIFIED_CONTPOS, double visibility_=UNSPECIFIED_VISIBILITY_DISTANCE, double speed_=UNSPECIFIED_SPEED, bool haveVia_=false, bool uncontrolled_=false, const PositionVector &customShape_=PositionVector::EMPTY, SVCPermissions permissions=SVC_UNSPECIFIED)
 constructor with more parameters More...
 
std::string getDescription (const NBEdge *parent) const
 get string describing this connection More...
 
double getDouble (const std::string &key, const double defaultValue) const
 Returns the value for a given key converted to a double. More...
 
std::string getInternalLaneID () const
 get ID of internal lane More...
 
const std::string getParameter (const std::string &key, const std::string &defaultValue="") const
 Returns the value for a given key. More...
 
const std::map< std::string, std::string > & getParametersMap () const
 Returns the inner key/value map. More...
 
std::string getParametersStr () const
 Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN". More...
 
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known. More...
 
bool prohibits (const NBVehicle *const) const
 
bool restricts (const NBVehicle *const) const
 
void setParameter (const std::string &key, const std::string &value)
 Sets a parameter. More...
 
void setParameters (const Parameterised &params)
 set the inner key/value map in map<string, string> format More...
 
void setParametersMap (const std::map< std::string, std::string > &paramsMap)
 set the inner key/value map in map<string, string> format More...
 
void setParametersStr (const std::string &paramsString)
 set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN" More...
 
void unsetParameter (const std::string &key)
 Removes a parameter. More...
 
void updateParameters (const std::map< std::string, std::string > &mapArg)
 Adds or updates all given parameters from the map. More...
 
void writeParams (OutputDevice &device) const
 write Params in the given outputdevice More...
 

Static Public Member Functions

static bool areParametersValid (const std::string &value, bool report=false)
 check if given string can be parsed to a parameters map "key1=value1|key2=value2|...|keyN=valueN" More...
 
static double getTravelTimeStatic (const NBRouterEdge *const edge, const NBVehicle *const, double)
 

Data Fields

double contPos
 custom position for internal junction on this connection More...
 
PositionVector customShape
 custom shape for connection More...
 
std::vector< std::string > foeIncomingLanes
 FOE Incomings lanes. More...
 
std::vector< int > foeInternalLinks
 FOE Internal links. More...
 
int fromLane
 The lane the connections starts at. More...
 
bool haveVia
 check if Connection have a Via More...
 
std::string id
 id of Connection More...
 
int internalLaneIndex
 The lane index of this internal lane within the internal edge. More...
 
bool keepClear
 whether the junction must be kept clear when using this connection More...
 
double length
 computed length (average of all internal lane shape lengths that share an internal edge) More...
 
bool mayDefinitelyPass
 Information about being definitely free to drive (on-ramps) More...
 
SVCPermissions permissions
 List of vehicle types that are allowed on this connection. More...
 
PositionVector shape
 shape of Connection More...
 
double speed
 custom speed for connection More...
 
std::string tlID
 The id of the traffic light that controls this connection. More...
 
int tlLinkIndex
 The index of this connection within the controlling traffic light. More...
 
int tlLinkIndex2
 The index of the internal junction within the controlling traffic light (optional) More...
 
NBEdgetoEdge
 The edge the connections yields in. More...
 
int toLane
 The lane the connections yields in. More...
 
bool uncontrolled
 check if Connection is uncontrolled More...
 
std::string viaID
 if Connection have a via, ID of it More...
 
PositionVector viaShape
 shape of via More...
 
double visibility
 custom foe visiblity for connection More...
 
double vmax
 maximum velocity More...
 

Static Private Member Functions

static bool isParameterValid (const std::string &value, bool report)
 check if given string can be parsed to a parameter of type "key=value" More...
 

Private Attributes

std::map< std::string, std::string > myMap
 The key->value map. More...
 

NBRouterEdge interface

static ConstRouterEdgePairVector myViaSuccessors = ConstRouterEdgePairVector({ std::pair<NBRouterEdge*, NBRouterEdge*>(nullptr, nullptr) })
 
const std::string & getID () const
 
double getSpeed () const
 
double getLength () const
 
int getNumericalID () const
 
bool isInternal () const
 
const ConstRouterEdgePairVectorgetViaSuccessors (SUMOVehicleClass vClass=SVC_IGNORING) const
 

Detailed Description

A structure which describes a connection between edges or lanes.

Definition at line 189 of file NBEdge.h.

Constructor & Destructor Documentation

◆ Connection() [1/2]

NBEdge::Connection::Connection ( int  fromLane_,
NBEdge toEdge_,
int  toLane_ 
)

Constructor.

Parameters
[in]fromLane_The lane the connections starts at
[in]toEdge_The edge the connections yields in
[in]toLane_The lane the connections yields in

Definition at line 92 of file NBEdge.cpp.

◆ Connection() [2/2]

NBEdge::Connection::Connection ( int  fromLane_,
NBEdge toEdge_,
int  toLane_,
bool  mayDefinitelyPass_,
bool  keepClear_ = true,
double  contPos_ = UNSPECIFIED_CONTPOS,
double  visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE,
double  speed_ = UNSPECIFIED_SPEED,
bool  haveVia_ = false,
bool  uncontrolled_ = false,
const PositionVector customShape_ = PositionVector::EMPTY,
SVCPermissions  permissions = SVC_UNSPECIFIED 
)

constructor with more parameters

Definition at line 111 of file NBEdge.cpp.

Member Function Documentation

◆ areParametersValid()

◆ clearParameter()

void Parameterised::clearParameter ( )
inherited

Clears the parameter map.

Definition at line 100 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by NLHandler::beginEdgeParsing(), and GNERouteHandler::closeRoute().

◆ getDescription()

std::string NBEdge::Connection::getDescription ( const NBEdge parent) const

◆ getDouble()

◆ getID()

const std::string& NBEdge::Connection::getID ( ) const
inlinevirtual

Implements NBRouterEdge.

Definition at line 289 of file NBEdge.h.

References id.

Referenced by NBNode::computeLanes2Lanes().

◆ getInternalLaneID()

std::string NBEdge::Connection::getInternalLaneID ( ) const

get ID of internal lane

Definition at line 81 of file NBEdge.cpp.

References internalLaneIndex, and toString().

Referenced by NWWriter_SUMO::getOppositeInternalID(), and NWWriter_SUMO::writeConnection().

◆ getLength()

double NBEdge::Connection::getLength ( ) const
inlinevirtual

Implements NBRouterEdge.

Definition at line 295 of file NBEdge.h.

References PositionVector::length(), shape, and viaShape.

◆ getNumericalID()

int NBEdge::Connection::getNumericalID ( ) const
inlinevirtual

Implements NBRouterEdge.

Definition at line 298 of file NBEdge.h.

◆ getParameter()

const std::string Parameterised::getParameter ( const std::string &  key,
const std::string &  defaultValue = "" 
) const
inherited

Returns the value for a given key.

Parameters
[in]keyThe key to ask for
[in]defaultValueThe default value to return if no value is stored under the key
Returns
The value stored under the key

Definition at line 72 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by NBEdge::addRestrictedLane(), FareModul::addStop(), NBEdge::append(), MSDevice_Battery::buildVehicleDevices(), MSDevice_Bluelight::buildVehicleDevices(), MSDevice_Example::buildVehicleDevices(), ROEdge::cacheParamRestrictions(), SUMOVTypeParameter::cacheParamRestrictions(), GNEEdge::drawEdgeName(), GNEConnection::drawGL(), GUIEdge::drawGL(), GUIBaseVehicle::drawOnPos(), libsumo::Simulation::findIntermodalRoute(), MSSwarmTrafficLightLogic::getBetaNo(), MSSwarmTrafficLightLogic::getBetaSp(), MSDevice::getBoolParam(), NBRailwayTopologyAnalyzer::getBrokenRailNodes(), MSSwarmTrafficLightLogic::getChangePlanProbability(), GUIVehicle::getColorValue(), GNELane::getColorValue(), GUILane::getColorValue(), MSSOTLTrafficLightLogic::getDecayConstant(), MSDevice_SSM::getDetectionRange(), MSDevice_SSM::getExtraTime(), MSDevice::getFloatParam(), MSSwarmTrafficLightLogic::getForgettingCox(), MSSwarmTrafficLightLogic::getGammaNo(), MSSwarmTrafficLightLogic::getGammaSp(), MSTLLogicControl::WAUTSwitchProcedure::getGSPValue(), MSSOTLTrafficLightLogic::getInputSensorsLength(), MSSwarmTrafficLightLogic::getLearningCox(), MSSwarmTrafficLightLogic::getMaxCongestionDuration(), MSDevice_SSM::getMeasuresAndThresholds(), MSSOTLRequestPolicy::getMinDecisionalPhaseDuration(), MSSOTLTrafficLightLogic::getMode(), GUIJunctionWrapper::getOptionalName(), GUIBaseVehicle::getOptionalName(), MSDevice_ToC::getOutputFilename(), MSDevice_SSM::getOutputFilename(), MSSOTLTrafficLightLogic::getOutputSensorsLength(), libsumo::Route::getParameter(), libsumo::Polygon::getParameter(), libsumo::POI::getParameter(), libsumo::Person::getParameter(), libsumo::TrafficLight::getParameter(), libsumo::Edge::getParameter(), libsumo::Lane::getParameter(), libsumo::VehicleType::getParameter(), libsumo::Vehicle::getParameter(), libsumo::Simulation::getParameter(), MSSwarmTrafficLightLogic::getPheroMaxVal(), MSSwarmTrafficLightLogic::getPoliciesParam(), MSSwarmTrafficLightLogic::getReinforcementMode(), MSSOTLTrafficLightLogic::getSpeedThreshold(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchAreaNo(), MSTLLogicControl::WAUTSwitchProcedure_Stretch::getStretchBereichDef(), MSDevice::getStringParam(), MSSwarmTrafficLightLogic::getThetaInit(), MSSwarmTrafficLightLogic::getThetaMax(), MSSwarmTrafficLightLogic::getThetaMin(), MSSOTLTrafficLightLogic::getThreshold(), MSTriggeredRerouter::getWeight(), PushButtonLogic::init(), MSSOTLPhasePolicy::init(), SigmoidLogic::init(), MSSOTLTrafficLightLogic::init(), MSSwarmTrafficLightLogic::init(), GNEVehicleType::initRailVisualizationParameters(), MSVehicleType::initRailVisualizationParameters(), MSSOTLTrafficLightLogic::isDecayThresholdActivated(), MSSOTLTrafficLightLogic::isPushButtonPressed(), MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(), MSDelayBasedTrafficLightLogic::MSDelayBasedTrafficLightLogic(), MSSOTLPolicy::MSSOTLPolicy(), MSSOTLPolicy5DFamilyStimulus::MSSOTLPolicy5DFamilyStimulus(), MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(), GNEVehicleType::overwriteVType(), MSDevice_SSM::requestsTrajectories(), NBEdgeCont::splitAt(), MSDevice_SSM::useGeoCoords(), NWWriter_DlrNavteq::writeLinksUnsplitted(), and NWWriter_OpenDrive::writeRoadObjects().

◆ getParametersMap()

◆ getParametersStr()

◆ getSpeed()

double NBEdge::Connection::getSpeed ( ) const
inlinevirtual

Implements NBRouterEdge.

Definition at line 292 of file NBEdge.h.

References vmax.

◆ getTravelTimeStatic()

static double NBRouterEdge::getTravelTimeStatic ( const NBRouterEdge *const  edge,
const NBVehicle * const  ,
double   
)
inlinestaticinherited

◆ getViaSuccessors()

const ConstRouterEdgePairVector& NBEdge::Connection::getViaSuccessors ( SUMOVehicleClass  vClass = SVC_IGNORING) const
inlinevirtual

Implements NBRouterEdge.

Definition at line 304 of file NBEdge.h.

References myViaSuccessors, and UNUSED_PARAMETER.

◆ isInternal()

bool NBEdge::Connection::isInternal ( ) const
inlinevirtual

Reimplemented from NBRouterEdge.

Definition at line 301 of file NBEdge.h.

◆ isParameterValid()

bool Parameterised::isParameterValid ( const std::string &  value,
bool  report 
)
staticprivateinherited

check if given string can be parsed to a parameter of type "key=value"

Definition at line 189 of file Parameterised.cpp.

References StringTokenizer::getVector(), SUMOXMLDefinitions::isValidParameterKey(), and SUMOXMLDefinitions::isValidParameterValue().

Referenced by Parameterised::areParametersValid().

◆ knowsParameter()

◆ prohibits()

bool NBRouterEdge::prohibits ( const NBVehicle * const  ) const
inlineinherited

Definition at line 74 of file NBEdge.h.

◆ restricts()

bool NBRouterEdge::restricts ( const NBVehicle * const  ) const
inlineinherited

Definition at line 77 of file NBEdge.h.

◆ setParameter()

◆ setParameters()

void Parameterised::setParameters ( const Parameterised params)
inherited

set the inner key/value map in map<string, string> format

Definition at line 127 of file Parameterised.cpp.

References Parameterised::getParametersMap(), and Parameterised::myMap.

◆ setParametersMap()

void Parameterised::setParametersMap ( const std::map< std::string, std::string > &  paramsMap)
inherited

set the inner key/value map in map<string, string> format

Definition at line 133 of file Parameterised.cpp.

References Parameterised::myMap.

◆ setParametersStr()

void Parameterised::setParametersStr ( const std::string &  paramsString)
inherited

◆ unsetParameter()

void Parameterised::unsetParameter ( const std::string &  key)
inherited

Removes a parameter.

Parameters
[in]keyThe parameter's name

Definition at line 52 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by NIImporter_OpenStreetMap::insertEdge(), and GNEVehicleType::setAttribute().

◆ updateParameters()

void Parameterised::updateParameters ( const std::map< std::string, std::string > &  mapArg)
inherited

◆ writeParams()

Field Documentation

◆ contPos

double NBEdge::Connection::contPos

◆ customShape

◆ foeIncomingLanes

std::vector<std::string> NBEdge::Connection::foeIncomingLanes

FOE Incomings lanes.

Definition at line 269 of file NBEdge.h.

Referenced by NBEdge::buildInnerEdges().

◆ foeInternalLinks

std::vector<int> NBEdge::Connection::foeInternalLinks

FOE Internal links.

Definition at line 266 of file NBEdge.h.

Referenced by NBEdge::buildInnerEdges().

◆ fromLane

◆ haveVia

bool NBEdge::Connection::haveVia

◆ id

std::string NBEdge::Connection::id

◆ internalLaneIndex

int NBEdge::Connection::internalLaneIndex

The lane index of this internal lane within the internal edge.

Definition at line 272 of file NBEdge.h.

Referenced by NBEdge::buildInnerEdges(), getInternalLaneID(), and NWWriter_SUMO::writeInternalConnections().

◆ keepClear

bool NBEdge::Connection::keepClear

whether the junction must be kept clear when using this connection

Definition at line 230 of file NBEdge.h.

Referenced by GNEEdge::addConnection(), GNEConnection::getAttribute(), NIXMLConnectionsHandler::parseLaneBound(), GNEConnection::setAttribute(), and NWWriter_SUMO::writeConnection().

◆ length

double NBEdge::Connection::length

computed length (average of all internal lane shape lengths that share an internal edge)

Definition at line 284 of file NBEdge.h.

Referenced by NWWriter_SUMO::getOppositeInternalID().

◆ mayDefinitelyPass

◆ myMap

◆ myViaSuccessors

ConstRouterEdgePairVector NBEdge::Connection::myViaSuccessors = ConstRouterEdgePairVector({ std::pair<NBRouterEdge*, NBRouterEdge*>(nullptr, nullptr) })
static

Definition at line 288 of file NBEdge.h.

Referenced by getViaSuccessors().

◆ permissions

SVCPermissions NBEdge::Connection::permissions

List of vehicle types that are allowed on this connection.

Definition at line 245 of file NBEdge.h.

Referenced by GNEConnection::getAttribute(), GNEConnection::setAttribute(), and NWWriter_SUMO::writeConnection().

◆ shape

◆ speed

◆ tlID

◆ tlLinkIndex

◆ tlLinkIndex2

int NBEdge::Connection::tlLinkIndex2

◆ toEdge

NBEdge* NBEdge::Connection::toEdge

The edge the connections yields in.

Definition at line 212 of file NBEdge.h.

Referenced by GNEEdge::addConnection(), NBEdge::addLane(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimTL::NIVissimTLSignal::addTo(), NBEdge::bothLeftIntersect(), NBEdge::buildInnerEdges(), NBEdge::canMoveConnection(), NBRequest::checkLaneFoesByClass(), NBRequest::checkLaneFoesByCooperation(), NBTrafficLightDefinition::collectAllLinks(), NBLoadedTLDef::collectLinks(), NBNode::computeInternalLaneShape(), NBNode::computeLanes2Lanes(), NBEdge::connections_sorter(), NBEdge::debugPrintConnections(), NBNode::displaceShapeAtWidthChange(), GNEConnection::getAttribute(), NBNode::getConnectionIndex(), NWWriter_SUMO::getOppositeInternalID(), NBRequest::getResponseString(), NBRequest::mergeConflict(), NBEdge::moveConnectionToLeft(), NBEdge::moveConnectionToRight(), NBEdge::moveOutgoingConnectionsFrom(), NBNode::needsCont(), NBEdge::connections_toedge_finder::operator()(), NBEdge::connections_toedgelane_finder::operator()(), NBEdge::connections_finder::operator()(), NBEdge::connections_conflict_finder::operator()(), NBEdge::connections_relative_edgelane_sorter::operator()(), NBRequest::oppositeLeftTurnConflict(), NBEdge::recheckLanes(), NBEdgeCont::recheckPostProcessConnections(), GNEChange_Connection::redo(), GNEEdge::removeConnection(), NBEdge::removeFromConnections(), GNEConnection::setAttribute(), NBNode::tlsContConflict(), GNEChange_Connection::undo(), GNEConnection::updateGeometry(), GNEConnection::updateLinkState(), NWWriter_DlrNavteq::writeConnectedLanes(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeInternalEdges(), and NWWriter_OpenDrive::writeNetwork().

◆ toLane

◆ uncontrolled

◆ viaID

std::string NBEdge::Connection::viaID

if Connection have a via, ID of it

Definition at line 260 of file NBEdge.h.

Referenced by NBEdge::buildInnerEdges(), and NWWriter_SUMO::writeInternalConnections().

◆ viaShape

PositionVector NBEdge::Connection::viaShape

◆ visibility

double NBEdge::Connection::visibility

◆ vmax

double NBEdge::Connection::vmax

maximum velocity

Definition at line 254 of file NBEdge.h.

Referenced by NBEdge::buildInnerEdges(), getSpeed(), and NWWriter_OpenDrive::writeInternalEdge().


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