SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NBEdge Class Reference

The representation of a single edge during network building. More...

#include <NBEdge.h>

Inheritance diagram for NBEdge:
Named Parameterised

Data Structures

struct  Connection
 A structure which describes a connection between edges or lanes. More...
class  connections_finder
class  connections_fromlane_finder
class  connections_relative_edgelane_sorter
class  connections_toedge_finder
class  connections_toedgelane_finder
struct  Lane
 An (internal) definition of a single lane of an edge. More...
class  MainDirections
class  tls_disable_finder
struct  TLSDisabledConnection
class  ToEdgeConnectionsAdder

Public Types

enum  EdgeBuildingStep {
  INIT_REJECT_CONNECTIONS, INIT, EDGE2EDGES, LANES2EDGES,
  LANES2LANES_RECHECK, LANES2LANES_DONE, LANES2LANES_USER
}
 Current state of the edge within the building process. More...
enum  Lane2LaneInfoType { L2L_COMPUTED, L2L_USER, L2L_VALIDATED }
 Modes of setting connections between lanes. More...

Public Member Functions

void addCrossingPointsAsIncomingWithGivenOutgoing (NBEdge *o, PositionVector &into)
void addParameter (const std::string &key, const std::string &value)
 Adds a parameter.
void addParameter (const std::map< std::string, std::string > &mapArg)
 Adds all given parameter.
void addParameter (const Parameterised &p)
 Adds all given parameter.
void addSidewalk (SUMOReal width)
 add a pedestrian sidewalk of the given width and shift existing connctions
void addSign (NBSign sign)
void addTo (const StoringVisitor &cont) const
 Adds this object to the given container.
void allowVehicleClass (int lane, SUMOVehicleClass vclass)
 set allowed class for the given lane or for all lanes if -1 is given
void append (NBEdge *continuation)
void appendTurnaround (bool noTLSControlled)
 Add a connection to the previously computed turnaround, if wished.
void buildInnerEdges (const NBNode &n, unsigned int noInternalNoSplits, unsigned int &linkIndex, unsigned int &splitIndex)
void clearControllingTLInformation ()
 clears tlID for all connections
void clearParameter ()
 Clears the parameter map.
bool computeEdge2Edges (bool noLeftMovers)
 computes the edge (step1: computation of approached edges)
bool computeLanes2Edges (const bool buildCrossingsAndWalkingAreas)
 computes the edge, step2: computation of which lanes approach the edges)
void decLaneNo (unsigned int by, int dir=0)
void declareConnectionsAsLoaded ()
void disableConnection4TLS (int fromLane, NBEdge *toEdge, int toLane)
void disallowVehicleClass (int lane, SUMOVehicleClass vclass)
 set disallowed class for the given lane or for all lanes if -1 is given
void dismissVehicleClassInformation ()
bool expandableBy (NBEdge *possContinuation) const
SUMOReal getAngleAtNode (const NBNode *const node) const
 Returns the angle of the edge's geometry at the given node.
PositionVector getCCWBoundaryLine (const NBNode &n, SUMOReal offset) const
SUMOReal getCrossingAngle (NBNode *node)
 return the angle for computing pedestrian crossings at the given node
PositionVector getCWBoundaryLine (const NBNode &n, SUMOReal offset) const
NBEdge::Lane getFirstNonPedestrianLane (int direction) const
int getFirstNonPedestrianLaneIndex (int direction) const
 return the first lane with permissions other than SVC_PEDESTRIAN
const std::string & getID () const
 Returns the id.
int getJunctionPriority (const NBNode *const node) const
 Returns the junction priority (normalised for the node currently build)
std::string getLaneID (unsigned int lane) const
std::string getLaneIDInsecure (unsigned int lane) const
SUMOReal getLaneSpeed (unsigned int lane) const
LanegetLaneStruct (unsigned int lane)
const LanegetLaneStruct (unsigned int lane) const
const std::map< std::string,
std::string > & 
getMap () const
 Returns the inner key/value map.
SUMOReal getMaxLaneOffset ()
const std::string & getParameter (const std::string &key, const std::string &defaultValue) const
 Returns the value for a given key.
SVCPermissions getPermissions (int lane=-1) const
 get the union of allowed classes over all lanes or for a specific lane
const std::vector< NBSign > & getSigns () const
NBEdgegetTurnDestination () const
const std::string & getTypeID () const
bool hasLaneSpecificEndOffset () const
 whether lanes differ in offset
bool hasLaneSpecificPermissions () const
 whether lanes differ in allowed vehicle classes
bool hasLaneSpecificSpeed () const
 whether lanes differ in speed
bool hasLaneSpecificWidth () const
 whether lanes differ in width
bool hasRestrictions () const
 whether at least one lane has restrictions
bool hasSignalisedConnectionTo (const NBEdge *const e) const
void incLaneNo (unsigned int by)
bool isNearEnough2BeJoined2 (NBEdge *e, SUMOReal threshold) const
bool isTurningDirectionAt (const NBNode *n, const NBEdge *const edge) const
 Returns whether the given edge is the opposite direction to this edge.
bool knowsParameter (const std::string &key) const
 Returns whether the parameter is known.
bool lanesWereAssigned () const
void markAsInLane2LaneState ()
bool mayBeTLSControlled (int fromLane, NBEdge *toEdge, int toLane) const
void moveOutgoingConnectionsFrom (NBEdge *e, unsigned int laneOff)
 NBEdge (const std::string &id, NBNode *from, NBNode *to, std::string type, SUMOReal speed, unsigned int nolanes, int priority, SUMOReal width, SUMOReal offset, const std::string &streetName="", LaneSpreadFunction spread=LANESPREAD_RIGHT)
 Constructor.
 NBEdge (const std::string &id, NBNode *from, NBNode *to, std::string type, SUMOReal speed, unsigned int nolanes, int priority, SUMOReal width, SUMOReal offset, PositionVector geom, const std::string &streetName="", LaneSpreadFunction spread=LANESPREAD_RIGHT, bool tryIgnoreNodePositions=false)
 Constructor.
 NBEdge (const std::string &id, NBNode *from, NBNode *to, NBEdge *tpl, const PositionVector &geom=PositionVector(), int numLanes=-1)
 Constructor.
bool needsLaneSpecificOutput () const
 whether at least one lane has values differing from the edges values
void preferVehicleClass (int lane, SUMOVehicleClass vclass)
bool recheckLanes (const bool buildCrossingsAndWalkingAreas)
void reinit (NBNode *from, NBNode *to, const std::string &type, SUMOReal speed, unsigned int nolanes, int priority, PositionVector geom, SUMOReal width, SUMOReal offset, const std::string &streetName, LaneSpreadFunction spread=LANESPREAD_RIGHT, bool tryIgnoreNodePositions=false)
 Resets initial values.
void reinitNodes (NBNode *from, NBNode *to)
 Resets nodes but keeps all other values the same (used when joining)
bool setControllingTLInformation (const NBConnection &c, const std::string &tlID)
 Returns if the link could be set as to be controlled.
void setEndOffset (int lane, SUMOReal offset)
 set lane specific end-offset (negative lane implies set for all lanes)
void setID (const std::string &newID)
 resets the id
void setJunctionPriority (const NBNode *const node, int prio)
 Sets the junction priority of the edge.
void setLaneWidth (int lane, SUMOReal width)
 set lane specific width (negative lane implies set for all lanes)
void setLeftHanded ()
 Marks this edge to be left-handed.
void setLoadedLength (SUMOReal val)
void setPermissions (SVCPermissions permissions, int lane=-1)
 set allowed/disallowed classes for the given lane or for all lanes if -1 is given
void setPreferredVehicleClass (SVCPermissions permissions, int lane=-1)
void setSpeed (int lane, SUMOReal speed)
 set lane specific speed (negative lane implies set for all lanes)
void setTurningDestination (NBEdge *e)
NBNodetryGetNodeAtPosition (SUMOReal pos, SUMOReal tolerance=5.0) const
 Returns the node at the given edges length (using an epsilon) When no node is existing at the given position, 0 is returned The epsilon is a static member of NBEdge, should be setable via program options.
SUMOReal width () const
 ~NBEdge ()
 Destructor.
Applying offset
void reshiftPosition (SUMOReal xoff, SUMOReal yoff)
 Applies an offset to the edge.
Atomar getter methods
unsigned int getNumLanes () const
 Returns the number of lanes.
int getPriority () const
 Returns the priority of the edge.
NBNodegetFromNode () const
 Returns the origin node of the edge.
NBNodegetToNode () const
 Returns the destination node of the edge.
SUMOReal getStartAngle () const
 Returns the angle at the start of the edge The angle is computed in computeAngle()
SUMOReal getEndAngle () const
 Returns the angle at the end of the edge The angle is computed in computeAngle()
SUMOReal getTotalAngle () const
 get the angle as measure from the start to the end of this edge
SUMOReal getLength () const
 Returns the computed length of the edge.
SUMOReal getLoadedLength () const
 Returns the length was set explicitly or the computed length if it wasn't set.
bool hasLoadedLength () const
 Returns whether a length was set explicitly.
SUMOReal getSpeed () const
 Returns the speed allowed on this edge.
EdgeBuildingStep getStep () const
 The building step of this edge.
SUMOReal getLaneWidth () const
 Returns the default width of lanes of this edge.
SUMOReal getLaneWidth (int lane) const
 Returns the width of the lane of this edge.
const std::string & getStreetName () const
 Returns the street name of this edge.
void setStreetName (const std::string &name)
 sets the street name of this edge
SUMOReal getEndOffset () const
 Returns the offset to the destination node.
SUMOReal getEndOffset (int lane) const
 Returns the offset to the destination node a the specified lane.
SUMOReal getSignalOffset () const
 Returns the offset of a traffic signal from the end of this edge.
void setSignalOffset (SUMOReal offset)
 sets the offset of a traffic signal from the end of this edge
const std::string & getTypeName () const
 Returns the type name.
const std::vector< NBEdge::Lane > & getLanes () const
 Returns the lane definitions.
Edge geometry access and computation
const PositionVectorgetGeometry () const
 Returns the geometry of the edge.
const PositionVector getInnerGeometry () const
 Returns the geometry of the edge without the endpoints.
bool hasDefaultGeometry () const
 Returns whether the geometry consists only of the node positions.
bool hasDefaultGeometryEndpoints () const
 Returns whether the geometry is terminated by the node positions This default may be violated by initializing with tryIgnoreNodePositions=true' or with setGeometry() non-default endpoints are useful to control the generated node shape.
void setGeometry (const PositionVector &g, bool inner=false)
 (Re)sets the edge's geometry
void addGeometryPoint (int index, const Position &p)
 Adds a further geometry point.
void computeEdgeShape ()
 Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the fromNode and toNode is calculated and the lane shorted accordingly. The edge length is then set to the average of all lane lenghts (which may differ). This average length is used as the lane length when writing the network.
const PositionVectorgetLaneShape (unsigned int i) const
 Returns the shape of the nth lane.
void setLaneSpreadFunction (LaneSpreadFunction spread)
 (Re)sets how the lanes lateral offset shall be computed
LaneSpreadFunction getLaneSpreadFunction () const
 Returns how this edge's lanes' lateral offset is computed.
bool splitGeometry (NBEdgeCont &ec, NBNodeCont &nc)
 Splits this edge at geometry points.
void reduceGeometry (const SUMOReal minDist)
 Removes points with a distance lesser than the given.
void checkGeometry (const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
 Check the angles of successive geometry segments.
Setting/getting special types
void setAsMacroscopicConnector ()
 Marks this edge as a macroscopic connector.
bool isMacroscopicConnector () const
 Returns whether this edge was marked as a macroscopic connector.
void setIsInnerEdge ()
 Marks this edge being within an intersection.
bool isInnerEdge () const
 Returns whether this edge was marked as being within an intersection.

Static Public Member Functions

static bool connections_sorter (const Connection &c1, const Connection &c2)
static std::pair< SUMOReal,
SUMOReal
laneOffset (const Position &from, const Position &to, SUMOReal laneCenterOffset, bool leftHand)
 Computes the offset from the edge shape on the current segment.

Static Public Attributes

static const SUMOReal ANGLE_LOOKAHEAD = 10.0
 the distance at which to take the default anglen
static const SUMOReal UNSPECIFIED_LOADED_LENGTH = -1
 no length override given
static const SUMOReal UNSPECIFIED_OFFSET = 0
 unspecified lane offset
static const SUMOReal UNSPECIFIED_SIGNAL_OFFSET = -1
 unspecified signal offset
static const SUMOReal UNSPECIFIED_WIDTH = -1
 unspecified lane width

Protected Attributes

std::string myID
 The name of the object.

Private Member Functions

void computeAngle ()
 computes the angle of this edge and stores it in myAngle
PositionVector computeLaneShape (unsigned int lane, SUMOReal offset)
 Computes the shape for the given lane.
void computeLaneShapes ()
 Computes the offset from the edge shape on the current segment.
unsigned int computePrioritySum (std::vector< unsigned int > *priorities)
void divideOnEdges (const EdgeVector *outgoing, const bool buildCrossingsAndWalkingAreas)
void init (unsigned int noLanes, bool tryIgnoreNodePositions)
 Initialization routines common to all constructors.
 NBEdge (const NBEdge &s)
 invalidated copy constructor
NBEdgeoperator= (const NBEdge &s)
 invalidated assignment operator
std::vector< unsigned int > * prepareEdgePriorities (const EdgeVector *outgoing)
PositionVector startShapeAt (const PositionVector &laneShape, const NBNode *startNode) const

Private Attributes

bool myAmInnerEdge
 Information whether this is a junction-inner edge.
bool myAmLeftHand
 Whether this edge is a left-hand edge.
bool myAmMacroscopicConnector
 Information whether this edge is a (macroscopic) connector.
std::vector< ConnectionmyConnections
 List of connections to following edges.
std::vector< ConnectionmyConnectionsToDelete
 List of connections marked for delayed removal.
SUMOReal myEndAngle
SUMOReal myEndOffset
 This edges's offset to the intersection begin (will be applied to all lanes)
NBNodemyFrom
 The source and the destination node.
int myFromJunctionPriority
 The priority normalised for the node the edge is outgoing of.
PositionVector myGeom
 The geometry for the edge.
std::vector< LanemyLanes
 Lane information.
LaneSpreadFunction myLaneSpreadFunction
 The information about how to spread the lanes.
SUMOReal myLaneWidth
 This width of this edge's lanes.
SUMOReal myLength
 The length of the edge.
SUMOReal myLoadedLength
 An optional length to use (-1 if not valid)
int myPriority
 The priority of the edge.
SUMOReal mySignalOffset
 the offset of a traffic light signal from the end of this edge (-1 for None)
std::vector< NBSignmySigns
 the street signs along this edge
SUMOReal mySpeed
 The maximal speed.
SUMOReal myStartAngle
 The angles of the edge.
EdgeBuildingStep myStep
 The building step.
std::string myStreetName
 The street name (or whatever arbitrary string you wish to attach)
std::vector
< TLSDisabledConnection
myTLSDisabledConnections
NBNodemyTo
int myToJunctionPriority
 The priority normalised for the node the edge is incoming in.
SUMOReal myTotalAngle
NBEdgemyTurnDestination
 The turn destination edge.
std::string myType
 The type of the edge.

Friends

class GNEEdge
class GNELane
class NBEdgeCont
class NBEdgeSuccessorBuilder

Setting and getting connections

bool addEdge2EdgeConnection (NBEdge *dest)
 Adds a connection to another edge.
bool addLane2LaneConnection (unsigned int fromLane, NBEdge *dest, unsigned int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false)
 Adds a connection between the specified this edge's lane and an approached one.
bool addLane2LaneConnections (unsigned int fromLane, NBEdge *dest, unsigned int toLane, unsigned int no, Lane2LaneInfoType type, bool invalidatePrevious=false, bool mayDefinitelyPass=false)
 Builds no connections starting at the given lanes.
void setConnection (unsigned int lane, NBEdge *destEdge, unsigned int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false)
 Adds a connection to a certain lane of a certain edge.
std::vector< ConnectiongetConnectionsFromLane (unsigned int lane) const
 Returns connections from a given lane.
bool hasConnectionTo (NBEdge *destEdge, unsigned int destLane, int fromLane=-1) const
 Retrieves info about a connection to a certain lane of a certain edge.
bool isConnectedTo (NBEdge *e)
 Returns the information whethe a connection to the given edge has been added (or computed)
const std::vector< Connection > & getConnections () const
 Returns the connections.
std::vector< Connection > & getConnections ()
 Returns the connections.
const EdgeVectorgetConnectedSorted ()
 Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
EdgeVector getConnectedEdges () const
 Returns the list of outgoing edges unsorted.
std::vector< intgetConnectionLanes (NBEdge *currentOutgoing) const
 Returns the list of lanes that may be used to reach the given edge.
void sortOutgoingConnectionsByAngle ()
 sorts the outgoing connections by their angle relative to their junction
void sortOutgoingConnectionsByIndex ()
 sorts the outgoing connections by their from-lane-index and their to-lane-index
void remapConnections (const EdgeVector &incoming)
 Remaps the connection in a way that allows the removal of it.
void removeFromConnections (NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
 Removes the specified connection(s)
void invalidateConnections (bool reallowSetting=false)
void replaceInConnections (NBEdge *which, NBEdge *by, unsigned int laneOff)
void replaceInConnections (NBEdge *which, const std::vector< NBEdge::Connection > &origConns)
void copyConnectionsFrom (NBEdge *src)
void shiftToLanesToEdge (NBEdge *to, unsigned int laneOff)
 modifify the toLane for all connections to the given edge
void moveConnectionToLeft (unsigned int lane, const bool buildCrossingsAndWalkingAreas)
void moveConnectionToRight (unsigned int lane, const bool buildCrossingsAndWalkingAreas)
bool canMoveConnection (const Connection &con, unsigned int newFromLane, const bool buildCrossingsAndWalkingAreas) const
 whether the connection can originate on newFromLane

Detailed Description

The representation of a single edge during network building.

Definition at line 71 of file NBEdge.h.

Member Enumeration Documentation

Current state of the edge within the building process.

As the network is build in a cascaded way, considering loaded information, a counter holding the current step is needed. This is done by using this enumeration.

Enumerator:
INIT_REJECT_CONNECTIONS 

The edge has been loaded and connections shall not be added.

INIT 

The edge has been loaded, nothing is computed yet.

EDGE2EDGES 

The relationships between edges are computed/loaded.

LANES2EDGES 

Lanes to edges - relationships are computed/loaded.

LANES2LANES_RECHECK 

Lanes to lanes - relationships are computed; should be recheked.

LANES2LANES_DONE 

Lanes to lanes - relationships are computed; no recheck is necessary/wished.

LANES2LANES_USER 

Lanes to lanes - relationships are loaded; no recheck is necessary/wished.

Definition at line 89 of file NBEdge.h.

Modes of setting connections between lanes.

Enumerator:
L2L_COMPUTED 

The connection was computed.

L2L_USER 

The connection was given by the user.

L2L_VALIDATED 

The connection was computed and validated.

Definition at line 110 of file NBEdge.h.

Constructor & Destructor Documentation

NBEdge::NBEdge ( const std::string &  id,
NBNode from,
NBNode to,
std::string  type,
SUMOReal  speed,
unsigned int  nolanes,
int  priority,
SUMOReal  width,
SUMOReal  offset,
const std::string &  streetName = "",
LaneSpreadFunction  spread = LANESPREAD_RIGHT 
)

Constructor.

Use this if no edge geometry is given.

Parameters
[in]idThe id of the edge
[in]fromThe node the edge starts at
[in]toThe node the edge ends at
[in]typeThe type of the edge (my be =="")
[in]speedThe maximum velocity allowed on this edge
[in]nolanesThe number of lanes this edge has
[in]priorityThis edge's priority
[in]widthThis edge's lane width
[in]offsetAdditional offset to the destination node
[in]streetNameThe street name (need not be unique)
[in]spreadHow the lateral offset of the lanes shall be computed
See Also
init
LaneSpreadFunction

Definition at line 180 of file NBEdge.cpp.

References init().

Referenced by splitGeometry().

NBEdge::NBEdge ( const std::string &  id,
NBNode from,
NBNode to,
std::string  type,
SUMOReal  speed,
unsigned int  nolanes,
int  priority,
SUMOReal  width,
SUMOReal  offset,
PositionVector  geom,
const std::string &  streetName = "",
LaneSpreadFunction  spread = LANESPREAD_RIGHT,
bool  tryIgnoreNodePositions = false 
)

Constructor.

Use this if the edge's geometry is given.

Parameters
[in]idThe id of the edge
[in]fromThe node the edge starts at
[in]toThe node the edge ends at
[in]typeThe type of the edge (may be =="")
[in]speedThe maximum velocity allowed on this edge
[in]nolanesThe number of lanes this edge has
[in]priorityThis edge's priority
[in]widthThis edge's lane width
[in]offsetAdditional offset to the destination node
[in]geomThe edge's geomatry
[in]streetNameThe street name (need not be unique)
[in]spreadHow the lateral offset of the lanes shall be computed
[in]tryIgnoreNodePositionsDoes not add node geometries if geom.size()>=2
See Also
init
LaneSpreadFunction

Definition at line 202 of file NBEdge.cpp.

References init().

NBEdge::NBEdge ( const std::string &  id,
NBNode from,
NBNode to,
NBEdge tpl,
const PositionVector geom = PositionVector(),
int  numLanes = -1 
)

Constructor.

Use this to copy attribuets from another edge

Parameters
[in]idThe id of the edge
[in]fromThe node the edge starts at
[in]toThe node the edge ends at
[in]tplThe template edge to copy attributes from
[in]geomThe geometry to use (may be empty)
[in]numLanesThe number of lanes of the new edge (copy from tpl by default)

Definition at line 225 of file NBEdge.cpp.

References getLaneSpeed(), getNumLanes(), getPermissions(), init(), MIN2(), myGeom, myLanes, myTo, setEndOffset(), setLaneWidth(), setPermissions(), and setSpeed().

NBEdge::~NBEdge ( )

Destructor.

Definition at line 354 of file NBEdge.cpp.

NBEdge::NBEdge ( const NBEdge s)
private

invalidated copy constructor

Member Function Documentation

void NBEdge::addCrossingPointsAsIncomingWithGivenOutgoing ( NBEdge o,
PositionVector into 
)
bool NBEdge::addEdge2EdgeConnection ( NBEdge dest)

Adds a connection to another edge.

If the given edge does not start at the node this edge ends on, false is returned.

All other cases return true. Though, a connection may not been added if this edge is in step "INIT_REJECT_CONNECTIONS". Also, this method assures that a connection to an edge is set only once, no multiple connections to next edge are stored.

After a first connection to an edge was set, the process step is set to "EDGE2EDGES".

Note
Passing 0 implicitly removes all existing connections
Parameters
[in]destThe connection's destination edge
Returns
Whether the connection was valid

Definition at line 604 of file NBEdge.cpp.

References EDGE2EDGES, INIT_REJECT_CONNECTIONS, invalidateConnections(), myConnections, myFrom, myStep, and myTo.

Referenced by addLane2LaneConnection(), NIImporter_OpenStreetMap::RelationHandler::applyRestriction(), NBEdgeCont::joinSameNodeConnectingEdges(), NIXMLConnectionsHandler::myStartElement(), NIImporter_VISUM::parse_Turns(), and remapConnections().

void NBEdge::addGeometryPoint ( int  index,
const Position p 
)

Adds a further geometry point.

Some importer do not know an edge's geometry when it is initialised. This method allows to insert further geometry points after the edge has been built.

Parameters
[in]indexThe position at which the point shall be added
[in]pThe point to add

Definition at line 501 of file NBEdge.cpp.

References PositionVector::insertAt(), and myGeom.

Referenced by NIImporter_VISUM::parse_EdgePolys().

bool NBEdge::addLane2LaneConnection ( unsigned int  fromLane,
NBEdge dest,
unsigned int  toLane,
Lane2LaneInfoType  type,
bool  mayUseSameDestination = false,
bool  mayDefinitelyPass = false 
)

Adds a connection between the specified this edge's lane and an approached one.

If the given edge does not start at the node this edge ends on, false is returned.

All other cases return true. Though, a connection may not been added if this edge is in step "INIT_REJECT_CONNECTIONS". Before the lane-to-lane connection is set, a connection between edges is established using "addEdge2EdgeConnection". Then, "setConnection" is called for inserting the lane-to-lane connection.

Parameters
[in]fromLaneThe connection's starting lane (of this edge)
[in]destThe connection's destination edge
[in]toLaneThe connection's destination lane
[in]typeThe connections's type
[in]mayUseSameDestinationWhether this connection may be set though connecting an already connected lane
[in]mayDefinitelyPassWhether this connection is definitely undistrubed (special case for on-ramps)
Returns
Whether the connection was added / exists
See Also
addEdge2EdgeConnection
setConnection
Todo:
Check difference between "setConnection" and "addLane2LaneConnection"

Definition at line 628 of file NBEdge.cpp.

References addEdge2EdgeConnection(), INIT_REJECT_CONNECTIONS, myFrom, myStep, myTo, and setConnection().

Referenced by NIImporter_SUMO::_loadNetwork(), addLane2LaneConnections(), NIVissimConnection::buildEdgeConnections(), NBNodeCont::joinNodeClusters(), NIImporter_OpenDrive::loadNetwork(), moveOutgoingConnectionsFrom(), NIXMLEdgesHandler::myEndElement(), NIImporter_VISUM::parse_LanesConnections(), NIXMLConnectionsHandler::parseLaneBound(), NBEdgeCont::recheckPostProcessConnections(), and NBEdgeCont::splitAt().

bool NBEdge::addLane2LaneConnections ( unsigned int  fromLane,
NBEdge dest,
unsigned int  toLane,
unsigned int  no,
Lane2LaneInfoType  type,
bool  invalidatePrevious = false,
bool  mayDefinitelyPass = false 
)

Builds no connections starting at the given lanes.

If "invalidatePrevious" is true, a call to "invalidateConnections(true)" is done. This method loops through the given connections to set, calling "addLane2LaneConnection" for each.

Parameters
[in]fromLaneThe first of the connections' starting lanes (of this edge)
[in]destThe connections' destination edge
[in]toLaneThe first of the connections' destination lanes
[in]noThe number of connections to set
[in]typeThe connections' type
[in]invalidatePreviousWhether previously set connection shall be deleted
[in]mayDefinitelyPassWhether these connections are definitely undistrubed (special case for on-ramps)
Returns
Whether the connections were added / existed
See Also
addLane2LaneConnection
invalidateConnections

Definition at line 650 of file NBEdge.cpp.

References addLane2LaneConnection(), and invalidateConnections().

Referenced by NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), and NBNode::computeLanes2Lanes().

void Parameterised::addParameter ( const std::string &  key,
const std::string &  value 
)
inherited
void Parameterised::addParameter ( const std::map< std::string, std::string > &  mapArg)
inherited

Adds all given parameter.

Parameters
[in]mapArgThe keys/values to insert

Definition at line 59 of file Parameterised.cpp.

References Parameterised::myMap.

void Parameterised::addParameter ( const Parameterised p)
inherited

Adds all given parameter.

Parameters
[in]pThe keys/values to insert

Definition at line 67 of file Parameterised.cpp.

References Parameterised::myMap.

void NBEdge::addSign ( NBSign  sign)
inline

Definition at line 1049 of file NBEdge.h.

References mySigns.

Referenced by NBEdgeCont::generateStreetSigns().

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 NBEdge::allowVehicleClass ( int  lane,
SUMOVehicleClass  vclass 
)

set allowed class for the given lane or for all lanes if -1 is given

Definition at line 2027 of file NBEdge.cpp.

References myLanes.

Referenced by NINavTeqHelper::addVehicleClasses(), NINavTeqHelper::addVehicleClassesV6(), and preferVehicleClass().

void NBEdge::appendTurnaround ( bool  noTLSControlled)

Add a connection to the previously computed turnaround, if wished.

If a turning direction exists (myTurnDestination!=0) and either the edge is not controlled by a tls or noTLSControlled is false, a connection to the edge stored in myTurnDestination is added (from the leftmost lane of this edge to the leftmost lane of myTurnDestination).

Parameters
[in]noTLSControlledWhether the turnaround shall not be connected if this edge is controlled by a tls

Definition at line 1640 of file NBEdge.cpp.

References getNumLanes(), NBNode::isTLControlled(), L2L_VALIDATED, myLanes, myTo, myTurnDestination, and setConnection().

bool NBEdge::canMoveConnection ( const Connection con,
unsigned int  newFromLane,
const bool  buildCrossingsAndWalkingAreas 
) const
private

whether the connection can originate on newFromLane

Definition at line 951 of file NBEdge.cpp.

References getPermissions(), SVC_PEDESTRIAN, NBEdge::Connection::toEdge, and NBEdge::Connection::toLane.

Referenced by moveConnectionToLeft(), and moveConnectionToRight().

void NBEdge::checkGeometry ( const SUMOReal  maxAngle,
const SUMOReal  minRadius,
bool  fix 
)

Check the angles of successive geometry segments.

Parameters
[in]maxAngleThe maximum angle allowed
[in]minRadiusThe minimum turning radius allowed at the start and end
[in]fixWhether to prune geometry points to avoid sharp turns at start and end

Definition at line 558 of file NBEdge.cpp.

References Line::atan2DegreeAngle(), DEG2RAD, PositionVector::eraseAt(), PositionVector::getBegLine(), PositionVector::getEndLine(), Named::getID(), Line::length2D(), PositionVector::lineAt(), myGeom, NBHelpers::relAngle(), SUMOReal, toString(), WRITE_MESSAGE, and WRITE_WARNING.

void NBEdge::clearControllingTLInformation ( )

clears tlID for all connections

Definition at line 1801 of file NBEdge.cpp.

References myConnections.

void Parameterised::clearParameter ( )
inherited

Clears the parameter map.

Definition at line 91 of file Parameterised.cpp.

References Parameterised::myMap.

bool NBEdge::computeEdge2Edges ( bool  noLeftMovers)

computes the edge (step1: computation of approached edges)

Definition at line 1410 of file NBEdge.cpp.

References EDGE2EDGES, NBNode::getOutgoingEdges(), NBNode::isLeftMover(), myConnections, myStep, and myTo.

void NBEdge::computeEdgeShape ( )

Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the fromNode and toNode is calculated and the lane shorted accordingly. The edge length is then set to the average of all lane lenghts (which may differ). This average length is used as the lane length when writing the network.

Note
All lanes of an edge in a sumo net must have the same nominal length but may differ in actual geomtric length.
Depends on previous call to NBNodeCont::computeNodeShapes

Definition at line 406 of file NBEdge.cpp.

References Line::atan2DegreeAngle(), computeAngle(), GeomHelper::getMinAngleDiff(), PositionVector::getSubpart(), PositionVector::length(), myFrom, myLanes, myLength, myTo, POSITION_EPS, PositionVector::reverse(), startShapeAt(), and SUMOReal.

bool NBEdge::computeLanes2Edges ( const bool  buildCrossingsAndWalkingAreas)

computes the edge, step2: computation of which lanes approach the edges)

Definition at line 1431 of file NBEdge.cpp.

References divideOnEdges(), EDGE2EDGES, getConnectedSorted(), LANES2EDGES, myConnections, and myStep.

PositionVector NBEdge::computeLaneShape ( unsigned int  lane,
SUMOReal  offset 
)
private
void NBEdge::computeLaneShapes ( )
private
unsigned int NBEdge::computePrioritySum ( std::vector< unsigned int > *  priorities)
private

computes the sum of the given list's entries (sic!)

Definition at line 1630 of file NBEdge.cpp.

Referenced by divideOnEdges().

bool NBEdge::connections_sorter ( const Connection c1,
const Connection c2 
)
static

connections_sorter sort by fromLane, toEdge and toLane

Definition at line 2186 of file NBEdge.cpp.

References NBEdge::Connection::fromLane, NBEdge::Connection::toEdge, and NBEdge::Connection::toLane.

Referenced by sortOutgoingConnectionsByIndex().

void NBEdge::copyConnectionsFrom ( NBEdge src)

Definition at line 944 of file NBEdge.cpp.

References myConnections, and myStep.

Referenced by NBEdgeCont::splitAt().

void NBEdge::decLaneNo ( unsigned int  by,
int  dir = 0 
)
void NBEdge::declareConnectionsAsLoaded ( )
inline

Definition at line 1033 of file NBEdge.h.

References LANES2LANES_USER, and myStep.

Referenced by NIImporter_SUMO::_loadNetwork().

void NBEdge::disableConnection4TLS ( int  fromLane,
NBEdge toEdge,
int  toLane 
)
void NBEdge::disallowVehicleClass ( int  lane,
SUMOVehicleClass  vclass 
)

set disallowed class for the given lane or for all lanes if -1 is given

Definition at line 2040 of file NBEdge.cpp.

References myLanes.

Referenced by NIImporter_DlrNavteq::EdgesHandler::report().

void NBEdge::dismissVehicleClassInformation ( )

Definition at line 2177 of file NBEdge.cpp.

References myLanes, and SVCAll.

Referenced by NBEdgeCont::insert().

void NBEdge::divideOnEdges ( const EdgeVector outgoing,
const bool  buildCrossingsAndWalkingAreas 
)
private
bool NBEdge::expandableBy ( NBEdge possContinuation) const

!! if (myAllowedOnLanes!=possContinuation->myAllowedOnLanes || myNotAllowedOnLanes!=possContinuation->myNotAllowedOnLanes) { return false; }

Definition at line 1855 of file NBEdge.cpp.

References EDGE2EDGES, getConnectedEdges(), getConnectionLanes(), getPriority(), INIT, INIT_REJECT_CONNECTIONS, LANES2EDGES, LANES2LANES_DONE, LANES2LANES_RECHECK, LANES2LANES_USER, myConnections, myLanes, mySpeed, and myStep.

SUMOReal NBEdge::getAngleAtNode ( const NBNode *const  node) const

Returns the angle of the edge's geometry at the given node.

The angle is signed, regards direction, and starts at 12 o'clock (north->south), proceeds positive clockwise.

Parameters
[in]nodeThe node for which the edge's angle shall be returned
Returns
This edge's angle at the given node

Definition at line 1162 of file NBEdge.cpp.

References Line::atan2DegreeAngle(), PositionVector::getBegLine(), PositionVector::getEndLine(), myFrom, myGeom, and myTo.

Referenced by NBNode::computeLanes2Lanes(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBNode::geometryLike(), NBNodesEdgesSorter::edge_by_junction_angle_sorter::getConvAngle(), getCrossingAngle(), NBNode::getDirection(), NBEdgeCont::guessRoundabouts(), NBNode::isLeftMover(), isTurningDirectionAt(), NBRequest::laneConflict(), and NBEdgePriorityComputer::setPriorityJunctionPriorities().

PositionVector NBEdge::getCCWBoundaryLine ( const NBNode n,
SUMOReal  offset 
) const

Definition at line 1834 of file NBEdge.cpp.

References PositionVector::move2side(), myAmLeftHand, myFrom, and myLanes.

EdgeVector NBEdge::getConnectedEdges ( ) const

Returns the list of outgoing edges unsorted.

Returns
Connected edges

Definition at line 785 of file NBEdge.cpp.

References myConnections.

Referenced by NIVissimDisturbance::addToNode(), expandableBy(), NBTrafficLightDefinition::forbids(), NBContHelper::same_connection_edge_sorter::getMinMaxRelAngles(), and remapConnections().

const EdgeVector * NBEdge::getConnectedSorted ( )

Returns the list of outgoing edges without the turnaround sorted in clockwise direction.

Returns
Connected edges, sorted clockwise

Definition at line 757 of file NBEdge.cpp.

References NBNode::getOutgoingEdges(), myConnections, myTo, and myTurnDestination.

Referenced by computeLanes2Edges().

std::vector< int > NBEdge::getConnectionLanes ( NBEdge currentOutgoing) const

Returns the list of lanes that may be used to reach the given edge.

Returns
Lanes approaching the given edge

Definition at line 797 of file NBEdge.cpp.

References myConnections, and myTurnDestination.

Referenced by NBNode::ApproachingDivider::execute(), and expandableBy().

std::vector<Connection>& NBEdge::getConnections ( )
inline

Returns the connections.

Returns
This edge's connections to following edges

Definition at line 755 of file NBEdge.h.

References myConnections.

std::vector< NBEdge::Connection > NBEdge::getConnectionsFromLane ( unsigned int  lane) const

Returns connections from a given lane.

This method goes through "myConnections" and copies those which are starting at the given lane.

Parameters
[in]laneThe lane which connections shall be returned
Returns
The connections from the given lane
See Also
NBEdge::Connection

Definition at line 726 of file NBEdge.cpp.

References myConnections.

Referenced by NIVissimTL::NIVissimTLSignal::addTo(), NBTrafficLightDefinition::collectAllLinks(), NBLoadedTLDef::collectLinks(), NBOwnTLDef::computeUnblockedWeightedStreamNumber(), moveOutgoingConnectionsFrom(), NBOwnTLDef::myCompute(), NBRequest::writeCrossingResponse(), and NBRequest::writeLaneResponse().

SUMOReal NBEdge::getCrossingAngle ( NBNode node)

return the angle for computing pedestrian crossings at the given node

Definition at line 2212 of file NBEdge.cpp.

References gDebugFlag1, getAngleAtNode(), getFromNode(), Named::getID(), and SUMOReal.

Referenced by NBNode::checkCrossing().

PositionVector NBEdge::getCWBoundaryLine ( const NBNode n,
SUMOReal  offset 
) const

Definition at line 1819 of file NBEdge.cpp.

References PositionVector::move2side(), myAmLeftHand, myFrom, and myLanes.

SUMOReal NBEdge::getEndAngle ( ) const
inline

Returns the angle at the end of the edge The angle is computed in computeAngle()

Returns
This edge's end angle

Definition at line 386 of file NBEdge.h.

References myEndAngle.

Referenced by NBContHelper::relative_incoming_edge_sorter::operator()(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(), and NBRequest::rightTurnConflict().

SUMOReal NBEdge::getEndOffset ( ) const
inline

Returns the offset to the destination node.

Returns
The offset to the destination node

Definition at line 471 of file NBEdge.h.

References myEndOffset.

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), getEndOffset(), and NWWriter_XML::writeEdgesAndConnections().

SUMOReal NBEdge::getEndOffset ( int  lane) const

Returns the offset to the destination node a the specified lane.

Returns
The offset to the destination node

Definition at line 2090 of file NBEdge.cpp.

References getEndOffset(), myLanes, and UNSPECIFIED_OFFSET.

NBEdge::Lane NBEdge::getFirstNonPedestrianLane ( int  direction) const

Definition at line 2228 of file NBEdge.cpp.

References getFirstNonPedestrianLaneIndex(), Named::getID(), and myLanes.

int NBEdge::getFirstNonPedestrianLaneIndex ( int  direction) const

return the first lane with permissions other than SVC_PEDESTRIAN

Definition at line 2198 of file NBEdge.cpp.

References NBNode::BACKWARD, NBNode::FORWARD, myLanes, and SVC_PEDESTRIAN.

Referenced by getFirstNonPedestrianLane().

NBNode* NBEdge::getFromNode ( ) const
inline

Returns the origin node of the edge.

Returns
The node this edge starts at

Definition at line 360 of file NBEdge.h.

References myFrom.

Referenced by NBLoadedSUMOTLDef::addConnection(), NIXMLConnectionsHandler::addCrossing(), NIVissimDisturbance::addToNode(), NBLoadedTLDef::addToSignalGroup(), NBRampsComputer::buildOffRamp(), NBNode::buildWalkingAreas(), NBNode::checkCrossing(), NBRampsComputer::computeRamps(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NIVissimDistrictConnection::dict_BuildDistricts(), NBRampsComputer::fulfillsRampConstraints(), NBNodeCont::generateNodeClusters(), NBNodesEdgesSorter::edge_by_junction_angle_sorter::getConvAngle(), getCrossingAngle(), NBContHelper::edge_opposite_direction_sorter::getEdgeAngleAt(), NWWriter_DlrNavteq::getGraphLength(), NIImporter_VISUM::getNamedEdgeContinuating(), NBNode::guessCrossings(), NBEdgeCont::guessRoundabouts(), NBNodeCont::guessTLs(), NBEdgeCont::insert(), NBNode::isNearDistrict(), NBNodeCont::joinJunctions(), NBNodeCont::joinNodeClusters(), NBRequest::laneConflict(), NIXMLEdgesHandler::myEndElement(), NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(), NBNode::edge_by_direction_sorter::operator()(), NIImporter_VISUM::parse_Lanes(), NBEdgeCont::recheckPostProcessConnections(), NBNodeCont::removeIsolatedRoads(), NBEdgeCont::removeUnwishedEdges(), NBEdgeCont::retrievePossiblySplit(), NIXMLEdgesHandler::setNodes(), NWWriter_SUMO::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_DlrNavteq::writeLinksUnsplitted(), and NWWriter_OpenDrive::writeNetwork().

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(), buildInnerEdges(), NGEdge::buildNBEdge(), NIVissimEdge::buildNBEdge(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBNode::buildWalkingAreas(), MSSimpleTrafficLightLogic::changeStepAndDuration(), checkGeometry(), MSVehicleTransfer::checkInsertions(), ODDistrictHandler::closeDistrict(), NLHandler::closeEdge(), RORouteHandler::closeRouteDistribution(), RORouteHandler::closeVehicle(), NBTrafficLightDefinition::collectAllLinks(), NBTrafficLightDefinition::collectEdges(), ROJTRRouter::compute(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), 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(), getCrossingAngle(), RODFNet::getDetectorEdge(), MSMeanData::getEdgeID(), PedestrianEdge< E, L, N >::getEffort(), 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(), 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().

const PositionVector NBEdge::getInnerGeometry ( ) const

Returns the geometry of the edge without the endpoints.

Definition at line 370 of file NBEdge.cpp.

References getGeometry(), and PositionVector::pop_front().

int NBEdge::getJunctionPriority ( const NBNode *const  node) const

Returns the junction priority (normalised for the node currently build)

If the given node is neither the edge's start nor the edge's ending node, the behaviour is undefined.

Parameters
[in]nodeThe node for which the edge's priority shall be returned
Returns
The edge's priority at the given node
Todo:
Maybe the edge priority whould be stored in the node

Definition at line 1142 of file NBEdge.cpp.

References myFrom, myFromJunctionPriority, and myToJunctionPriority.

Referenced by NBEdgeCont::generateStreetSigns(), NBOwnTLDef::getToPrio(), NBEdge::MainDirections::MainDirections(), NBNode::needsCont(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), and NBRequest::setBlocking().

std::string NBEdge::getLaneID ( unsigned int  lane) const
std::string NBEdge::getLaneIDInsecure ( unsigned int  lane) const

Definition at line 1965 of file NBEdge.cpp.

References Named::myID, and toString().

Referenced by setConnection().

const std::vector<NBEdge::Lane>& NBEdge::getLanes ( ) const
inline
const PositionVector & NBEdge::getLaneShape ( unsigned int  i) const

Returns the shape of the nth lane.

Returns
The shape of the lane given by its index (counter from right)

Definition at line 489 of file NBEdge.cpp.

References myLanes.

Referenced by buildInnerEdges(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBNode::buildWalkingAreas(), NBNode::computeInternalLaneShape(), and NWWriter_OpenDrive::writeNetwork().

SUMOReal NBEdge::getLaneSpeed ( unsigned int  lane) const

Definition at line 1180 of file NBEdge.cpp.

References myLanes.

Referenced by NBEdge().

LaneSpreadFunction NBEdge::getLaneSpreadFunction ( ) const
inline

Returns how this edge's lanes' lateral offset is computed.

Returns
The type of lateral offset that is applied on this edge
See Also
LaneSpreadFunction

Definition at line 597 of file NBEdge.h.

References myLaneSpreadFunction.

Referenced by NIXMLEdgesHandler::addEdge(), NBRampsComputer::moveRampRight(), NIXMLEdgesHandler::myEndElement(), NWWriter_SUMO::writeEdge(), and NWWriter_XML::writeEdgesAndConnections().

Lane& NBEdge::getLaneStruct ( unsigned int  lane)
inline

Definition at line 1022 of file NBEdge.h.

References myLanes.

Referenced by NBNode::computeInternalLaneShape(), and NIImporter_OpenDrive::loadNetwork().

const Lane& NBEdge::getLaneStruct ( unsigned int  lane) const
inline

Definition at line 1027 of file NBEdge.h.

References myLanes.

SUMOReal NBEdge::getLaneWidth ( ) const
inline

Returns the default width of lanes of this edge.

Returns
The width of lanes of this edge

Definition at line 446 of file NBEdge.h.

References myLaneWidth.

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NBNode::checkCrossing(), computeLaneShapes(), getLaneWidth(), NWWriter_XML::writeEdgesAndConnections(), and NWWriter_OpenDrive::writeNetwork().

SUMOReal NBEdge::getLaneWidth ( int  lane) const

Returns the width of the lane of this edge.

Returns
The width of the lane of this edge

Definition at line 2082 of file NBEdge.cpp.

References getLaneWidth(), myLanes, SUMO_const_laneWidth, and UNSPECIFIED_WIDTH.

SUMOReal NBEdge::getLoadedLength ( ) const
inline

Returns the length was set explicitly or the computed length if it wasn't set.

Todo:
consolidate use of myLength and myLoaded length
Returns
The edge's specified length

Definition at line 412 of file NBEdge.h.

References myLength, and myLoadedLength.

Referenced by NIXMLEdgesHandler::addEdge(), NBNodeCont::generateNodeClusters(), NBNodeCont::joinJunctions(), NBNodeCont::joinSimilarEdges(), NWWriter_SUMO::writeEdge(), and NWWriter_XML::writeEdgesAndConnections().

const std::map<std::string, std::string>& Parameterised::getMap ( ) const
inlineinherited

Returns the inner key/value map.

Returns
the inner map

Definition at line 107 of file Parameterised.h.

References Parameterised::myMap.

Referenced by NBTrafficLightDefinition::compute(), GUIVehicle::getParameterWindow(), and PCPolyContainer::save().

SUMOReal NBEdge::getMaxLaneOffset ( )

Definition at line 1719 of file NBEdge.cpp.

References myLanes, SUMO_const_laneWidthAndOffset, and SUMOReal.

unsigned int NBEdge::getNumLanes ( ) const
inline
const std::string & Parameterised::getParameter ( const std::string &  key,
const std::string &  defaultValue 
) const
inherited
int NBEdge::getPriority ( ) const
inline
SUMOReal NBEdge::getSignalOffset ( ) const
inline

Returns the offset of a traffic signal from the end of this edge.

Definition at line 482 of file NBEdge.h.

References mySignalOffset.

Referenced by append(), and NBNodeCont::guessTLs().

const std::vector<NBSign>& NBEdge::getSigns ( ) const
inline

Definition at line 1045 of file NBEdge.h.

References mySigns.

Referenced by NWWriter_XML::writeStreetSigns().

SUMOReal NBEdge::getStartAngle ( ) const
inline

Returns the angle at the start of the edge The angle is computed in computeAngle()

Returns
This edge's start angle

Definition at line 377 of file NBEdge.h.

References myStartAngle.

Referenced by NBContHelper::relative_outgoing_edge_sorter::operator()(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(), and NBRequest::rightTurnConflict().

EdgeBuildingStep NBEdge::getStep ( ) const
inline

The building step of this edge.

Returns
The current building step for this edge
Todo:
Recheck usage!
See Also
EdgeBuildingStep

Definition at line 438 of file NBEdge.h.

References myStep.

Referenced by NIXMLConnectionsHandler::myStartElement().

const std::string& NBEdge::getStreetName ( ) const
inline

Returns the street name of this edge.

Definition at line 458 of file NBEdge.h.

References myStreetName.

Referenced by NIXMLEdgesHandler::addEdge(), NWWriter_SUMO::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), and NWWriter_OpenDrive::writeNetwork().

NBNode* NBEdge::getToNode ( ) const
inline

Returns the destination node of the edge.

Returns
The node this edge ends at

Definition at line 368 of file NBEdge.h.

References myTo.

Referenced by NIImporter_SUMO::_loadNetwork(), NBLoadedSUMOTLDef::addConnection(), NIXMLConnectionsHandler::addCrossing(), NIVissimDisturbance::addToNode(), NBLoadedTLDef::addToSignalGroup(), NBRampsComputer::buildOnRamp(), NBNode::checkCrossing(), NBLoadedTLDef::collectNodes(), NBRampsComputer::computeRamps(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBOwnTLDef::computeUnblockedWeightedStreamNumber(), NIVissimDistrictConnection::dict_BuildDistricts(), NBRampsComputer::fulfillsRampConstraints(), NBNodeCont::generateNodeClusters(), NBEdgeCont::generateStreetSigns(), NWWriter_DlrNavteq::getGraphLength(), NIImporter_VISUM::getNamedEdgeContinuating(), NBNode::getOppositeIncoming(), NBOwnTLDef::getToPrio(), NBEdgeCont::guessRoundabouts(), NBEdgeCont::insert(), NBNode::isNearDistrict(), NBNodeCont::joinJunctions(), NBNodeCont::joinNodeClusters(), NBNodeCont::joinSimilarEdges(), NBRequest::laneConflict(), NIImporter_OpenDrive::loadNetwork(), NBOwnTLDef::myCompute(), NIXMLEdgesHandler::myEndElement(), NIXMLConnectionsHandler::myStartElement(), NBContHelper::relative_incoming_edge_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBContHelper::edge_with_destination_finder::operator()(), NBContHelper::edge_by_angle_to_nodeShapeCentroid_sorter::operator()(), NIImporter_VISUM::parse_Lanes(), NIXMLConnectionsHandler::parseLaneBound(), NBEdgeCont::recheckPostProcessConnections(), NBNodeCont::removeIsolatedRoads(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NIImporter_DlrNavteq::TrafficlightsHandler::report(), NBEdgeCont::retrievePossiblySplit(), NBRequest::rightTurnConflict(), NIXMLEdgesHandler::setNodes(), NBNodesEdgesSorter::swapWhenReversed(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_DlrNavteq::writeLinksUnsplitted(), NWWriter_OpenDrive::writeNetwork(), and NWWriter_SUMO::writeRoundabout().

SUMOReal NBEdge::getTotalAngle ( ) const
inline

get the angle as measure from the start to the end of this edge

Returns the angle at the start of the edge The angle is computed in computeAngle()

Returns
This edge's angle

Definition at line 396 of file NBEdge.h.

References myTotalAngle.

Referenced by NBContHelper::same_connection_edge_sorter::getMinMaxRelAngles(), NBContHelper::edge_similar_direction_sorter::operator()(), and NBEdgePriorityComputer::setPriorityJunctionPriorities().

const std::string& NBEdge::getTypeID ( ) const
inline
const std::string& NBEdge::getTypeName ( ) const
inline

Returns the type name.

Returns
The name of this edge's type

Definition at line 495 of file NBEdge.h.

References myType.

Referenced by NWWriter_SUMO::writeEdge().

bool NBEdge::hasConnectionTo ( NBEdge destEdge,
unsigned int  destLane,
int  fromLane = -1 
) const

Retrieves info about a connection to a certain lane of a certain edge.

Turnaround edge is ignored!

Parameters
[in]destEdgeThe connection's destination edge
[in]destLaneThe connection's destination lane
[in]fromLaneIf a value >= 0 is given, only return true if a connection from the given lane exists
Returns
whether a connection to the specified lane exists

Definition at line 738 of file NBEdge.cpp.

References myConnections.

Referenced by NIImporter_SUMO::_loadNetwork(), NBNode::buildWalkingAreas(), NIXMLConnectionsHandler::myStartElement(), NIXMLConnectionsHandler::parseLaneBound(), and setConnection().

bool NBEdge::hasDefaultGeometry ( ) const

Returns whether the geometry consists only of the node positions.

Definition at line 379 of file NBEdge.cpp.

References hasDefaultGeometryEndpoints(), and myGeom.

Referenced by NIXMLEdgesHandler::addEdge(), NWWriter_SUMO::writeEdge(), and NWWriter_XML::writeEdgesAndConnections().

bool NBEdge::hasDefaultGeometryEndpoints ( ) const

Returns whether the geometry is terminated by the node positions This default may be violated by initializing with tryIgnoreNodePositions=true' or with setGeometry() non-default endpoints are useful to control the generated node shape.

Definition at line 385 of file NBEdge.cpp.

References NBNode::getPosition(), myFrom, myGeom, and myTo.

Referenced by hasDefaultGeometry().

bool NBEdge::hasLaneSpecificEndOffset ( ) const

whether lanes differ in offset

Definition at line 1392 of file NBEdge.cpp.

References myLanes.

Referenced by NIImporter_SUMO::_loadNetwork(), needsLaneSpecificOutput(), and NWWriter_XML::writeEdgesAndConnections().

bool NBEdge::hasLaneSpecificPermissions ( ) const

whether lanes differ in allowed vehicle classes

Definition at line 1356 of file NBEdge.cpp.

References myLanes.

bool NBEdge::hasLaneSpecificSpeed ( ) const

whether lanes differ in speed

Definition at line 1381 of file NBEdge.cpp.

References getSpeed(), and myLanes.

Referenced by needsLaneSpecificOutput(), and NWWriter_XML::writeEdgesAndConnections().

bool NBEdge::hasLaneSpecificWidth ( ) const

whether lanes differ in width

Definition at line 1370 of file NBEdge.cpp.

References myLanes.

Referenced by NIImporter_SUMO::_loadNetwork(), needsLaneSpecificOutput(), and NWWriter_XML::writeEdgesAndConnections().

bool NBEdge::hasLoadedLength ( ) const
inline

Returns whether a length was set explicitly.

Returns
Wether the edge's length was specified

Definition at line 420 of file NBEdge.h.

References myLoadedLength.

Referenced by NIXMLEdgesHandler::addEdge(), NWWriter_SUMO::writeEdge(), and NWWriter_XML::writeEdgesAndConnections().

bool NBEdge::hasRestrictions ( ) const

whether at least one lane has restrictions

Definition at line 1345 of file NBEdge.cpp.

References myLanes, and SVCAll.

Referenced by needsLaneSpecificOutput().

bool NBEdge::hasSignalisedConnectionTo ( const NBEdge *const  e) const

Definition at line 1941 of file NBEdge.cpp.

References myConnections.

Referenced by buildInnerEdges(), and NBRequest::forbids().

void NBEdge::init ( unsigned int  noLanes,
bool  tryIgnoreNodePositions 
)
private

Initialization routines common to all constructors.

Checks whether the number of lanes>0, whether the junction's from- and to-nodes are given (!=0) and whether they are distict. Throws a ProcessError if any of these checks fails.

Adds the nodes positions to geometry if it shall not be ignored or if the geometry is empty.

Computes the angle and length, and adds this edge to its node as outgoing/incoming. Builds lane informations.

Parameters
[in]noLanesThe number of lanes this edge has
[in]tryIgnoreNodePositionsDoes not add node geometries if geom.size()>=2

Definition at line 310 of file NBEdge.cpp.

References PositionVector::add(), NBNode::addIncomingEdge(), NBNode::addOutgoingEdge(), computeAngle(), computeLaneShapes(), Position::distanceTo(), NBNode::getPosition(), myFrom, myGeom, Named::myID, myLanes, myLength, myTo, POSITION_EPS, PositionVector::push_back(), PositionVector::push_back_noDoublePos(), PositionVector::push_front(), PositionVector::push_front_noDoublePos(), PositionVector::removeDoublePoints(), and WRITE_ERROR.

Referenced by NBEdge(), and reinit().

bool NBEdge::isConnectedTo ( NBEdge e)

Returns the information whethe a connection to the given edge has been added (or computed)

Turnaround edge is not ignored!

Parameters
[in]eThe destination edge
Returns
Whether a connection to the specified edge exists

Definition at line 744 of file NBEdge.cpp.

References myConnections, and myTurnDestination.

Referenced by NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NIXMLConnectionsHandler::myStartElement(), and NBNode::removeSelfLoops().

bool NBEdge::isInnerEdge ( ) const
inline

Returns whether this edge was marked as being within an intersection.

Returns
Whether this edge was marked as being within an intersection

Definition at line 854 of file NBEdge.h.

References myAmInnerEdge.

Referenced by NBNode::getLinkState().

bool NBEdge::isMacroscopicConnector ( ) const
inline

Returns whether this edge was marked as a macroscopic connector.

Returns
Whether this edge was marked as a macroscopic connector

Definition at line 839 of file NBEdge.h.

References myAmMacroscopicConnector.

Referenced by NBRampsComputer::fulfillsRampConstraints(), and NWWriter_SUMO::writeEdge().

bool NBEdge::isNearEnough2BeJoined2 ( NBEdge e,
SUMOReal  threshold 
) const

Definition at line 1971 of file NBEdge.cpp.

References PositionVector::distances(), getGeometry(), and myGeom.

Referenced by NBNodeCont::joinSimilarEdges().

bool NBEdge::isTurningDirectionAt ( const NBNode n,
const NBEdge *const  edge 
) const

Returns whether the given edge is the opposite direction to this edge.

Parameters
[in]nThe node at which this may be turnaround direction
[in]edgeThe edge which may be the turnaround direction
Returns
Whether the given edge is this edge's turnaround direction

Definition at line 1655 of file NBEdge.cpp.

References getAngleAtNode(), myFrom, myTo, myTurnDestination, and SUMOReal.

Referenced by NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBRampsComputer::fulfillsRampConstraints(), NBNode::getDirection(), NBNode::isLeftMover(), NBRequest::laneConflict(), NBOwnTLDef::myCompute(), NBContHelper::opposite_finder::operator()(), NBRequest::rightTurnConflict(), NBRequest::setBlocking(), and NBNodesEdgesSorter::swapWhenReversed().

bool Parameterised::knowsParameter ( const std::string &  key) const
inherited

Returns whether the parameter is known.

Parameters
[in]keyThe key to ask for
Returns
Whether the key is known

Definition at line 75 of file Parameterised.cpp.

References Parameterised::myMap.

Referenced by MSDevice_Example::buildVehicleDevices(), MSDevice::equippedByDefaultAssignmentOptions(), and TraCIServerAPI_Vehicle::vtdMap_matchingNearest().

std::pair< SUMOReal, SUMOReal > NBEdge::laneOffset ( const Position from,
const Position to,
SUMOReal  laneCenterOffset,
bool  leftHand 
)
static

Computes the offset from the edge shape on the current segment.

Definition at line 1293 of file NBEdge.cpp.

References GeomHelper::getNormal90D_CW().

Referenced by computeLaneShape(), and NIImporter_SUMO::reconstructEdgeShape().

bool NBEdge::lanesWereAssigned ( ) const

Definition at line 1713 of file NBEdge.cpp.

References LANES2LANES_DONE, LANES2LANES_USER, and myStep.

Referenced by NIVissimTL::NIVissimTLSignal::addTo().

void NBEdge::markAsInLane2LaneState ( )

Definition at line 2020 of file NBEdge.cpp.

References NBNode::getOutgoingEdges(), LANES2LANES_DONE, myStep, and myTo.

void NBEdge::moveConnectionToLeft ( unsigned int  lane,
const bool  buildCrossingsAndWalkingAreas 
)
private

moves a connection one place to the left; Attention! no checking for field validity

Definition at line 960 of file NBEdge.cpp.

References canMoveConnection(), getTurnDestination(), L2L_VALIDATED, myAmLeftHand, myConnections, setConnection(), NBEdge::Connection::toEdge, and NBEdge::Connection::toLane.

Referenced by recheckLanes().

void NBEdge::moveConnectionToRight ( unsigned int  lane,
const bool  buildCrossingsAndWalkingAreas 
)
private

moves a connection one place to the right; Attention! no checking for field validity

Definition at line 985 of file NBEdge.cpp.

References canMoveConnection(), getTurnDestination(), L2L_VALIDATED, myAmLeftHand, myConnections, setConnection(), NBEdge::Connection::toEdge, and NBEdge::Connection::toLane.

Referenced by recheckLanes().

void NBEdge::moveOutgoingConnectionsFrom ( NBEdge e,
unsigned int  laneOff 
)
bool NBEdge::needsLaneSpecificOutput ( ) const

whether at least one lane has values differing from the edges values

Definition at line 1403 of file NBEdge.cpp.

References hasLaneSpecificEndOffset(), hasLaneSpecificSpeed(), hasLaneSpecificWidth(), and hasRestrictions().

Referenced by NWWriter_XML::writeEdgesAndConnections().

NBEdge& NBEdge::operator= ( const NBEdge s)
private

invalidated assignment operator

void NBEdge::preferVehicleClass ( int  lane,
SUMOVehicleClass  vclass 
)

Definition at line 2053 of file NBEdge.cpp.

References allowVehicleClass(), and myLanes.

std::vector< unsigned int > * NBEdge::prepareEdgePriorities ( const EdgeVector outgoing)
private

recomputes the edge priorities and manipulates them for a distribution of lanes on edges which is more like in real-life

Definition at line 1588 of file NBEdge.cpp.

References NBEdge::MainDirections::DIR_FORWARD, NBEdge::MainDirections::DIR_RIGHTMOST, NBEdge::MainDirections::empty(), NBEdge::MainDirections::includes(), myLanes, and myTo.

Referenced by divideOnEdges().

bool NBEdge::recheckLanes ( const bool  buildCrossingsAndWalkingAreas)

recheck whether all lanes within the edge are all right and optimises the connections once again

Definition at line 1455 of file NBEdge.cpp.

References getPermissions(), isForbidden(), LANES2LANES_DONE, LANES2LANES_USER, moveConnectionToLeft(), moveConnectionToRight(), myConnections, myConnectionsToDelete, myLanes, myStep, and removeFromConnections().

void NBEdge::reduceGeometry ( const SUMOReal  minDist)

Removes points with a distance lesser than the given.

Parameters
[in]minDistThe minimum distance between two position to keep the second

Definition at line 552 of file NBEdge.cpp.

References myGeom, and PositionVector::removeDoublePoints().

void NBEdge::reinit ( NBNode from,
NBNode to,
const std::string &  type,
SUMOReal  speed,
unsigned int  nolanes,
int  priority,
PositionVector  geom,
SUMOReal  width,
SUMOReal  offset,
const std::string &  streetName,
LaneSpreadFunction  spread = LANESPREAD_RIGHT,
bool  tryIgnoreNodePositions = false 
)

Resets initial values.

Parameters
[in]fromThe node the edge starts at
[in]toThe node the edge ends at
[in]typeThe type of the edge (may be =="")
[in]speedThe maximum velocity allowed on this edge
[in]nolanesThe number of lanes this edge has
[in]priorityThis edge's priority
[in]geomThe edge's geomatry
[in]widthThis edge's lane width
[in]offsetAdditional offset to the destination node
[in]streetNameThe street name (need not be unique)
[in]spreadHow the lateral offset of the lanes shall be computed
[in]tryIgnoreNodePositionsDoes not add node geometries if geom.size()>=2

Definition at line 258 of file NBEdge.cpp.

References StringUtils::convertUmlaute(), init(), myEndOffset, myFrom, myGeom, myLaneSpreadFunction, myLaneWidth, myLoadedLength, myPriority, mySpeed, myStreetName, myTo, myType, NBNode::removeEdge(), and UNSPECIFIED_LOADED_LENGTH.

Referenced by NIXMLEdgesHandler::addEdge().

void NBEdge::reinitNodes ( NBNode from,
NBNode to 
)

Resets nodes but keeps all other values the same (used when joining)

Parameters
[in]fromThe node the edge starts at
[in]toThe node the edge ends at

Definition at line 290 of file NBEdge.cpp.

References NBNode::addIncomingEdge(), NBNode::addOutgoingEdge(), computeAngle(), myFrom, Named::myID, myTo, and NBNode::removeEdge().

Referenced by NBNodeCont::joinNodeClusters().

void NBEdge::remapConnections ( const EdgeVector incoming)

Remaps the connection in a way that allows the removal of it.

This edge (which is a self loop edge, in fact) connections are spread over the valid incoming edges

Todo:
recheck!

Definition at line 823 of file NBEdge.cpp.

References addEdge2EdgeConnection(), EDGE2EDGES, getConnectedEdges(), myStep, and removeFromConnections().

Referenced by NBNode::removeSelfLoops().

void NBEdge::removeFromConnections ( NBEdge toEdge,
int  fromLane = -1,
int  toLane = -1,
bool  tryLater = false 
)

Removes the specified connection(s)

Parameters
[in]toEdgeThe destination edge
[in]fromLaneThe lane from which connections shall be removed; -1 means remove all
[in]toLaneThe lane to which connections shall be removed; -1 means remove all
[in]tryLaterIf the connection does not exist, try again during recheckLanes()

Definition at line 839 of file NBEdge.cpp.

References NBEdge::Connection::fromLane, myConnections, myConnectionsToDelete, myTurnDestination, NBEdge::Connection::toEdge, and NBEdge::Connection::toLane.

Referenced by NIImporter_OpenStreetMap::RelationHandler::applyRestriction(), decLaneNo(), NBEdgeCont::guessRoundabouts(), NIXMLConnectionsHandler::myStartElement(), recheckLanes(), NBEdgeCont::recheckPostProcessConnections(), remapConnections(), and replaceInConnections().

void NBEdge::replaceInConnections ( NBEdge which,
NBEdge by,
unsigned int  laneOff 
)

Definition at line 875 of file NBEdge.cpp.

References myConnections, myTurnDestination, and UNUSED_PARAMETER.

Referenced by NBNode::replaceOutgoing().

void NBEdge::replaceInConnections ( NBEdge which,
const std::vector< NBEdge::Connection > &  origConns 
)

Definition at line 890 of file NBEdge.cpp.

References L2L_COMPUTED, myConnections, removeFromConnections(), and setConnection().

void NBEdge::reshiftPosition ( SUMOReal  xoff,
SUMOReal  yoff 
)

Applies an offset to the edge.

Parameters
[in]xoffThe x-offset to apply
[in]yoffThe y-offset to apply

Definition at line 359 of file NBEdge.cpp.

References computeAngle(), myGeom, myLanes, and PositionVector::reshiftRotate().

void NBEdge::setAsMacroscopicConnector ( )
inline

Marks this edge as a macroscopic connector.

Definition at line 831 of file NBEdge.h.

References myAmMacroscopicConnector.

Referenced by NIImporter_VISUM::parse_Connectors().

void NBEdge::setConnection ( unsigned int  lane,
NBEdge destEdge,
unsigned int  destLane,
Lane2LaneInfoType  type,
bool  mayUseSameDestination = false,
bool  mayDefinitelyPass = false 
)

Adds a connection to a certain lane of a certain edge.

Parameters
[in]laneThe connection's starting lane (of this edge)
[in]destEdgeThe connection's destination edge
[in]destLaneThe connection's destination lane
[in]typeThe connections's type
[in]mayUseSameDestinationWhether this connection may be set though connecting an already connected lane
[in]mayDefinitelyPassWhether this connection is definitely undistrubed (special case for on-ramps)
Todo:
Check difference between "setConnection" and "addLane2LaneConnection"

Definition at line 667 of file NBEdge.cpp.

References getLaneIDInsecure(), getNumLanes(), hasConnectionTo(), INIT_REJECT_CONNECTIONS, L2L_COMPUTED, L2L_USER, LANES2LANES_DONE, LANES2LANES_RECHECK, LANES2LANES_USER, myConnections, myLanes, myStep, and WRITE_ERROR.

Referenced by addLane2LaneConnection(), appendTurnaround(), NBNode::computeLanes2Lanes(), moveConnectionToLeft(), moveConnectionToRight(), and replaceInConnections().

void NBEdge::setEndOffset ( int  lane,
SUMOReal  offset 
)

set lane specific end-offset (negative lane implies set for all lanes)

Definition at line 2096 of file NBEdge.cpp.

References myEndOffset, and myLanes.

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addLane(), and NBEdge().

void NBEdge::setGeometry ( const PositionVector g,
bool  inner = false 
)

(Re)sets the edge's geometry

Replaces the edge's prior geometry by the given. Then, computes the geometries of all lanes using computeLaneShapes. Definitely not the best way to have it accessable from outside...

Parameters
[in]gThe edge's new geometry
[in]innerwhether g should be interpreted as inner points
Todo:
Recheck usage, disallow access
See Also
computeLaneShapes

Definition at line 392 of file NBEdge.cpp.

References computeAngle(), computeLaneShapes(), myGeom, PositionVector::push_back(), and PositionVector::push_front().

Referenced by NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NBRampsComputer::moveRampRight(), and NIXMLEdgesHandler::myEndElement().

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().

void NBEdge::setIsInnerEdge ( )
inline

Marks this edge being within an intersection.

Definition at line 846 of file NBEdge.h.

References myAmInnerEdge.

void NBEdge::setJunctionPriority ( const NBNode *const  node,
int  prio 
)

Sets the junction priority of the edge.

Parameters
[in]nodeThe node for which the edge's priority is given
[in]prioThe edge's new priority at this node
Todo:
Maybe the edge priority whould be stored in the node

Definition at line 1152 of file NBEdge.cpp.

References myFrom, myFromJunctionPriority, and myToJunctionPriority.

Referenced by NBEdgePriorityComputer::extractAndMarkFirst(), and NBEdgePriorityComputer::setPriorityJunctionPriorities().

void NBEdge::setLaneSpreadFunction ( LaneSpreadFunction  spread)

(Re)sets how the lanes lateral offset shall be computed

Parameters
[in]spreadThe type of lateral offset to apply
See Also
LaneSpreadFunction

Definition at line 495 of file NBEdge.cpp.

References myLaneSpreadFunction.

Referenced by NIImporter_VISUM::parse_Edges().

void NBEdge::setLaneWidth ( int  lane,
SUMOReal  width 
)

set lane specific width (negative lane implies set for all lanes)

Definition at line 2066 of file NBEdge.cpp.

References myLanes, myLaneWidth, and width().

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addLane(), and NBEdge().

void NBEdge::setLeftHanded ( )
inline

Marks this edge to be left-handed.

Definition at line 333 of file NBEdge.h.

References myAmLeftHand.

Referenced by NBEdgeCont::insert().

void NBEdge::setLoadedLength ( SUMOReal  val)
void NBEdge::setPermissions ( SVCPermissions  permissions,
int  lane = -1 
)

set allowed/disallowed classes for the given lane or for all lanes if -1 is given

Definition at line 2128 of file NBEdge.cpp.

References myLanes.

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addEdge(), NIXMLEdgesHandler::addLane(), NINavTeqHelper::addVehicleClasses(), NINavTeqHelper::addVehicleClassesV6(), NIImporter_OpenStreetMap::insertEdge(), and NBEdge().

void NBEdge::setPreferredVehicleClass ( SVCPermissions  permissions,
int  lane = -1 
)

Definition at line 2142 of file NBEdge.cpp.

References myLanes.

Referenced by NIXMLEdgesHandler::addLane().

void NBEdge::setSignalOffset ( SUMOReal  offset)
inline

sets the offset of a traffic signal from the end of this edge

Definition at line 488 of file NBEdge.h.

References mySignalOffset.

void NBEdge::setSpeed ( int  lane,
SUMOReal  speed 
)

set lane specific speed (negative lane implies set for all lanes)

Definition at line 2112 of file NBEdge.cpp.

References myLanes, and mySpeed.

Referenced by NIImporter_SUMO::_loadNetwork(), NIXMLEdgesHandler::addLane(), NIVissimEdge::buildNBEdge(), and NBEdge().

void NBEdge::setStreetName ( const std::string &  name)
inline

sets the street name of this edge

Definition at line 464 of file NBEdge.h.

References myStreetName.

void NBEdge::setTurningDestination ( NBEdge e)

Definition at line 1174 of file NBEdge.cpp.

References myTurnDestination.

void NBEdge::shiftToLanesToEdge ( NBEdge to,
unsigned int  laneOff 
)

modifify the toLane for all connections to the given edge

XXX could we repurpose the function replaceInConnections ?

Definition at line 2264 of file NBEdge.cpp.

References myConnections.

void NBEdge::sortOutgoingConnectionsByAngle ( )

sorts the outgoing connections by their angle relative to their junction

Definition at line 811 of file NBEdge.cpp.

References myConnections.

void NBEdge::sortOutgoingConnectionsByIndex ( )

sorts the outgoing connections by their from-lane-index and their to-lane-index

Definition at line 817 of file NBEdge.cpp.

References connections_sorter(), and myConnections.

Referenced by NWWriter_XML::writeEdgesAndConnections(), and NWWriter_SUMO::writeNetwork().

bool NBEdge::splitGeometry ( NBEdgeCont ec,
NBNodeCont nc 
)

Splits this edge at geometry points.

Parameters
[in]ecThe edge cont to add new edges to
[in]ncThe node cont to add new nodes to
Returns
Whether the geometry was changed

Definition at line 507 of file NBEdge.cpp.

References NBNode::addIncomingEdge(), NBNode::getPosition(), INIT, NBNodeCont::insert(), NBEdgeCont::insert(), myFrom, myGeom, Named::myID, myLanes, myLaneSpreadFunction, myLaneWidth, myPriority, mySpeed, myStep, myStreetName, myTo, myType, NBEdge(), PositionVector::push_back(), NBNode::removeEdge(), NBNodeCont::retrieve(), toString(), and UNSPECIFIED_OFFSET.

PositionVector NBEdge::startShapeAt ( const PositionVector laneShape,
const NBNode startNode 
) const
private
NBNode * NBEdge::tryGetNodeAtPosition ( SUMOReal  pos,
SUMOReal  tolerance = 5.0 
) const

Returns the node at the given edges length (using an epsilon) When no node is existing at the given position, 0 is returned The epsilon is a static member of NBEdge, should be setable via program options.

Definition at line 1683 of file NBEdge.cpp.

References myFrom, myLength, and myTo.

SUMOReal NBEdge::width ( ) const

Definition at line 1849 of file NBEdge.cpp.

References myLanes, SUMO_const_laneOffset, SUMO_const_laneWidth, and SUMOReal.

Referenced by addSidewalk(), computeLaneShapes(), and setLaneWidth().

Friends And Related Function Documentation

friend class GNEEdge
friend

Definition at line 78 of file NBEdge.h.

friend class GNELane
friend

used for visualization (NETEDIT)

Definition at line 77 of file NBEdge.h.

friend class NBEdgeCont
friend

Definition at line 74 of file NBEdge.h.

friend class NBEdgeSuccessorBuilder
friend

used for the computation of connections to following edges

Definition at line 73 of file NBEdge.h.

Field Documentation

const SUMOReal NBEdge::ANGLE_LOOKAHEAD = 10.0
static

the distance at which to take the default anglen

Definition at line 209 of file NBEdge.h.

Referenced by computeAngle(), NBContHelper::relative_outgoing_edge_sorter::operator()(), and NBContHelper::relative_incoming_edge_sorter::operator()().

bool NBEdge::myAmInnerEdge
private

Information whether this is a junction-inner edge.

Definition at line 1269 of file NBEdge.h.

Referenced by isInnerEdge(), and setIsInnerEdge().

bool NBEdge::myAmLeftHand
private

Whether this edge is a left-hand edge.

Definition at line 1265 of file NBEdge.h.

Referenced by computeLaneShapes(), divideOnEdges(), getCCWBoundaryLine(), getCWBoundaryLine(), moveConnectionToLeft(), moveConnectionToRight(), and setLeftHanded().

bool NBEdge::myAmMacroscopicConnector
private

Information whether this edge is a (macroscopic) connector.

Definition at line 1272 of file NBEdge.h.

Referenced by isMacroscopicConnector(), and setAsMacroscopicConnector().

std::vector<Connection> NBEdge::myConnectionsToDelete
private

List of connections marked for delayed removal.

Definition at line 1233 of file NBEdge.h.

Referenced by recheckLanes(), and removeFromConnections().

SUMOReal NBEdge::myEndAngle
private

Definition at line 1217 of file NBEdge.h.

Referenced by computeAngle(), and getEndAngle().

SUMOReal NBEdge::myEndOffset
private

This edges's offset to the intersection begin (will be applied to all lanes)

Definition at line 1251 of file NBEdge.h.

Referenced by getEndOffset(), reinit(), and setEndOffset().

int NBEdge::myFromJunctionPriority
private

The priority normalised for the node the edge is outgoing of.

Definition at line 1239 of file NBEdge.h.

Referenced by getJunctionPriority(), and setJunctionPriority().

LaneSpreadFunction NBEdge::myLaneSpreadFunction
private

The information about how to spread the lanes.

Definition at line 1248 of file NBEdge.h.

Referenced by addSidewalk(), computeAngle(), computeLaneShapes(), getLaneSpreadFunction(), reinit(), setLaneSpreadFunction(), and splitGeometry().

SUMOReal NBEdge::myLaneWidth
private

This width of this edge's lanes.

Definition at line 1254 of file NBEdge.h.

Referenced by getLaneWidth(), reinit(), setLaneWidth(), and splitGeometry().

SUMOReal NBEdge::myLength
private

The length of the edge.

Definition at line 1213 of file NBEdge.h.

Referenced by append(), computeEdgeShape(), getLength(), getLoadedLength(), init(), and tryGetNodeAtPosition().

SUMOReal NBEdge::myLoadedLength
private

An optional length to use (-1 if not valid)

Definition at line 1262 of file NBEdge.h.

Referenced by getLoadedLength(), hasLoadedLength(), reinit(), and setLoadedLength().

int NBEdge::myPriority
private

The priority of the edge.

Definition at line 1221 of file NBEdge.h.

Referenced by getPriority(), reinit(), and splitGeometry().

SUMOReal NBEdge::mySignalOffset
private

the offset of a traffic light signal from the end of this edge (-1 for None)

Definition at line 1291 of file NBEdge.h.

Referenced by append(), getSignalOffset(), and setSignalOffset().

std::vector<NBSign> NBEdge::mySigns
private

the street signs along this edge

Definition at line 1288 of file NBEdge.h.

Referenced by addSign(), and getSigns().

SUMOReal NBEdge::mySpeed
private

The maximal speed.

Definition at line 1224 of file NBEdge.h.

Referenced by expandableBy(), getSpeed(), reinit(), setSpeed(), and splitGeometry().

SUMOReal NBEdge::myStartAngle
private

The angles of the edge.

Definition at line 1216 of file NBEdge.h.

Referenced by computeAngle(), and getStartAngle().

std::string NBEdge::myStreetName
private

The street name (or whatever arbitrary string you wish to attach)

Definition at line 1284 of file NBEdge.h.

Referenced by getStreetName(), reinit(), setStreetName(), and splitGeometry().

std::vector<TLSDisabledConnection> NBEdge::myTLSDisabledConnections
private
int NBEdge::myToJunctionPriority
private

The priority normalised for the node the edge is incoming in.

Definition at line 1242 of file NBEdge.h.

Referenced by getJunctionPriority(), and setJunctionPriority().

SUMOReal NBEdge::myTotalAngle
private

Definition at line 1218 of file NBEdge.h.

Referenced by computeAngle(), and getTotalAngle().

std::string NBEdge::myType
private

The type of the edge.

Definition at line 1207 of file NBEdge.h.

Referenced by getTypeID(), getTypeName(), reinit(), and splitGeometry().

const SUMOReal NBEdge::UNSPECIFIED_LOADED_LENGTH = -1
static

no length override given

Definition at line 207 of file NBEdge.h.

Referenced by NIImporter_SUMO::addEdge(), NIXMLEdgesHandler::addEdge(), and reinit().

const SUMOReal NBEdge::UNSPECIFIED_SIGNAL_OFFSET = -1
static

unspecified signal offset

Definition at line 205 of file NBEdge.h.

Referenced by append(), and NBNodeCont::guessTLs().


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