65 virtual const std::string&
getID()
const = 0;
207 Connection(
int fromLane_,
NBEdge* toEdge_,
int toLane_,
const bool mayDefinitelyPass_ =
false);
326 throw ProcessError(
"NBEdge::Connection does not implement getNumericalID()");
414 NBEdge(
const std::string&
id,
416 double speed,
double friction,
int nolanes,
int priority,
417 double width,
double endOffset,
419 const std::string& streetName =
"");
443 NBEdge(
const std::string&
id,
445 double speed,
double friction,
int nolanes,
int priority,
446 double width,
double endOffset,
449 const std::string& streetName =
"",
450 const std::string& origID =
"",
451 bool tryIgnoreNodePositions =
false);
464 NBEdge(
const std::string&
id,
490 double speed,
double friction,
int nolanes,
int priority,
492 const std::string& streetName,
494 bool tryIgnoreNodePositions =
false);
730 const std::vector<NBEdge::Lane>&
getLanes()
const {
884 void checkGeometry(
const double maxAngle,
bool fixAngle,
const double minRadius,
bool fix,
bool silent);
927 bool mayUseSameDestination =
false,
928 bool mayDefinitelyPass =
false,
938 const bool indirectLeft =
false,
939 const std::string& edgeType =
"",
942 bool postProcess =
false);
962 NBEdge* dest,
int toLane,
int no,
964 bool mayDefinitelyPass =
false);
979 bool mayUseSameDestination =
false,
980 bool mayDefinitelyPass =
false,
990 bool indirectLeft =
false,
991 const std::string& edgeType =
"",
994 bool postProcess =
false);
1092 void removeFromConnections(
NBEdge* toEdge,
int fromLane = -1,
int toLane = -1,
bool tryLater =
false,
const bool adaptToLaneRemoval =
false,
const bool keepPossibleTurns =
false);
1241 void appendTurnaround(
bool noTLSControlled,
bool noFringe,
bool onlyDeadends,
bool onlyTurnlane,
bool noGeometryLike,
bool checkPermissions);
1331 void deleteLane(
int index,
bool recompute,
bool shiftIndices);
1334 void addLane(
int index,
bool recomputeShape,
bool recomputeConnections,
bool shiftIndices);
1376 void setLaneType(
int lane,
const std::string& type);
1382 void setSpeed(
int lane,
double speed);
1410 void setOrigID(
const std::string origID,
const bool append,
const int laneIdx = -1);
1430 assert(lane < (
int)
myLanes.size());
1437 assert(lane < (
int)
myLanes.size());
1473 bool isBidiRail(
bool ignoreSpread =
false)
const;
1476 bool isBidiEdge(
bool checkPotential =
false)
const;
1585 void execute(
const int lane,
const int virtEdge);
1672 void init(
int noLanes,
bool tryIgnoreNodePositions,
const std::string& origID);
1708 int numPoints,
double width1,
double width2,
int shapeFlag = 0)
const;
1717 double assignInternalLaneLength(std::vector<Connection>::iterator i,
int numLanes,
double lengthSum,
bool averageLength);
1720 static std::vector<LinkDirection>
decodeTurnSigns(
int turnSigns,
int shift = 0);
std::vector< std::pair< const NBRouterEdge *, const NBRouterEdge * > > ConstRouterEdgePairVector
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
KeepClear
keepClear status of connections
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
#define UNUSED_PARAMETER(x)
A road/street connecting two junctions (netedit-version)
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
bool empty() const
returns the information whether no following street has a higher priority
MainDirections(const MainDirections &)=delete
Invalidated copy constructor.
bool includes(Direction d) const
returns the information whether the street in the given direction has a higher priority
int getStraightest() const
returns the index of the straightmost among the given outgoing edges
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
~MainDirections()
destructor
MainDirections & operator=(const MainDirections &)=delete
Invalidated assignment operator.
int myStraightest
the index of the straightmost among the given outgoing edges
Direction
enum of possible directions
A class that being a bresenham-callback assigns the incoming lanes to the edges.
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
ToEdgeConnectionsAdder(const ToEdgeConnectionsAdder &)=delete
Invalidated copy constructor.
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)=delete
Invalidated assignment operator.
~ToEdgeConnectionsAdder()
destructor
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
void execute(const int lane, const int virtEdge)
executes a bresenham - step
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
NBEdge *const myEdge2Find
edge to find
bool operator()(const Connection &c) const
operator ()
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
bool myCheckRight
check if is right
int myFromLane
index of from lane
int myLane2Find
lane to find
bool operator()(const Connection &c) const
operator ()
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
NBEdge *const myEdge2Find
edge to find
int myFromLane
index of from lane
bool myInvertEdge2find
invert edge to find
int myLane2Find
index of lane to find
bool operator()(const Connection &c) const
operator ()
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)=delete
invalidated assignment operator
connections_fromlane_finder(int lane2find)
@briefconstructor
Class to sort edges by their angle.
NBEdge * myEdge
the edge to compute the relative angle of
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
connections_relative_edgelane_sorter(NBEdge *e)
constructor
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
const bool myHasFromLane
check if has from lane
bool operator()(const Connection &c) const
operator ()
const NBEdge *const myEdge2Find
edge to find
bool operator()(const Connection &c) const
operator ()
int myFromLane2Find
from lane to find
int myLane2Find
lane to find
const NBEdge *const myEdge2Find
edge to find
connections_toedgelane_finder(const NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
Storage for edges, including some functionality operating on multiple edges.
The representation of a single edge during network building.
void setStreetName(const std::string &name)
sets the street name of this edge
void reinit(NBNode *from, NBNode *to, const std::string &type, double speed, double friction, int nolanes, int priority, PositionVector geom, double width, double endOffset, const std::string &streetName, LaneSpreadFunction spread, bool tryIgnoreNodePositions=false)
Resets initial values.
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
static std::vector< LinkDirection > decodeTurnSigns(int turnSigns, int shift=0)
decode bitset
void mirrorX()
mirror coordinates along the x-axis
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
static const int TURN_SIGN_SHIFT_BUS
shift values for decoding turn signs
double getLaneSpeed(int lane) const
get lane speed
static const int TURN_SIGN_SHIFT_BICYCLE
NBEdge * guessOpposite(bool reguess=false)
set oppositeID and return opposite edge if found
void setPermittedChanging(int lane, SVCPermissions changeLeft, SVCPermissions changeRight)
set allowed classes for changing to the left and right from the given lane
double getLength() const
Returns the computed length of the edge.
double myLaneWidth
This width of this edge's lanes.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
double getDistancAt(double pos) const
get distance at the given offset
double myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
const std::vector< Connection > & getConnections() const
Returns the connections.
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
const Position & getSignalPosition() const
Returns the position of a traffic signal on this edge.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
bool isInsideTLS() const
Returns whether this edge was marked as being within an intersection.
StopOffset myEdgeStopOffset
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
JunctionPriority
junction priority values set by setJunctionPriority
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
const Lane & getLaneStruct(int lane) const
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
double getLaneFriction(int lane) const
get lane friction of specified lane
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Returns the following edges for the given vClass.
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
double mySpeed
The maximal speed.
bool hasLaneSpecificFriction() const
whether lanes differ in friction
double getLaneWidth() const
Returns the default width of lanes of this edge.
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
NBNode * getToNode() const
Returns the destination node of the edge.
void checkGeometry(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool silent)
Check the angles of successive geometry segments.
std::vector< Connection > myConnections
List of connections to following edges.
Connection & getConnectionRef(int fromLane, const NBEdge *to, int toLane)
Returns reference to the specified connection This method goes through "myConnections" and returns th...
NBEdge()
constructor for dummy edge
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
ConstRouterEdgePairVector myViaSuccessors
PositionVector getCCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going counter-clock-wise around the given node
double buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
static const double UNSPECIFIED_FRICTION
unspecified lane friction
void incLaneNo(int by)
increment lane
static EdgeVector filterByPermissions(const EdgeVector &edges, SVCPermissions permissions)
return only those edges that permit at least one of the give permissions
Lane & getLaneStruct(int lane)
const Connection & getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection (unmodifiable) This method goes through "myConnections" and returns ...
const std::vector< NBSign > & getSigns() const
get Signs
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
void markOffRamp(bool isOffRamp)
marks this edge has being an offRamp or leading to one (used for connection computation)
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
void setAverageLengthWithOpposite(double val)
patch average lane length in regard to the opposite edge
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
void removeInvalidConnections()
double getShapeStartAngle() const
Returns the angle at the start of the edge.
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
bool isBidi()
return whether this edge should be a bidi edge
void appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished and a turning direction exists (myT...
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
std::string myType
The type of the edge.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
bool hasPermissions() const
whether at least one lane has restrictions
std::vector< Connection > & getConnections()
Returns the connections.
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
std::string myTurnSignTarget
node for which turnSign information applies
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
void dismissVehicleClassInformation()
dimiss vehicle class information
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
EdgeBuildingStep getStep() const
The building step of this edge.
void setInsideTLS(bool inside)
Marks this edge being within an intersection.
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
void moveConnectionToLeft(int lane)
void updateChangeRestrictions(SVCPermissions ignoring)
modify all existing restrictions on lane changing
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
Position getEndpointAtNode(const NBNode *node) const
NBEdge * getStraightContinuation(SVCPermissions permissions) const
return the straightest follower edge for the given permissions or nullptr (never returns turn-arounds...
bool hasLoadedLength() const
Returns whether a length was set explicitly.
void resetEndpointAtNode(const NBNode *node)
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
bool addEdge2EdgeConnection(NBEdge *dest, bool overrideRemoval=false, SVCPermissions permission=SVC_UNSPECIFIED)
Adds a connection to another edge.
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, const bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection between the specified this edge's lane and an approached one.
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
divide selected lanes on edges
int getNumericalID() const
Returns the index (numeric id) of the edge.
void setTurnSignTarget(const std::string &target)
void setDistance(double distance)
set kilometrage at start of edge (negative value implies couting down along the edge)
static double getTravelTimeStatic(const NBEdge *const edge, const NBVehicle *const, double)
bool setEdgeStopOffset(int lane, const StopOffset &offset, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes)
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
static double myDefaultConnectionLength
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
EdgeBuildingStep myStep
The building step.
void setLaneType(int lane, const std::string &type)
set lane specific type (negative lane implies set for all lanes)
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
EdgeBuildingStep
Current state of the edge within the building process.
@ INIT_REJECT_CONNECTIONS
The edge has been loaded and connections shall not be added.
@ EDGE2EDGES
The relationships between edges are computed/loaded.
@ LANES2LANES_RECHECK
Lanes to lanes - relationships are computed; should be rechecked.
@ LANES2LANES_DONE
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
@ LANES2EDGES
Lanes to edges - relationships are computed/loaded.
@ LANES2LANES_USER
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
@ INIT
The edge has been loaded, nothing is computed yet.
NBEdge * getStraightPredecessor(SVCPermissions permissions) const
return the straightest predecessor edge for the given permissions or nullptr (never returns turn-arou...
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
double getSpeed() const
Returns the speed allowed on this edge.
const std::string & getID() const
int getFirstAllowedLaneIndex(int direction) const
return the first lane that permits at least 1 vClass or the last lane if search direction of there is...
bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
double getDistance() const
get distance
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
void resetLaneShapes()
reset lane shapes to what they would be before cutting with the junction shapes
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
bool bothLeftTurns(LinkDirection dir, const NBEdge *otherFrom, LinkDirection dir2) const
determine conflict between opposite left turns
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
const StopOffset & getEdgeStopOffset() const
Returns the stopOffset to the end of the edge.
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
void clearControllingTLInformation()
clears tlID for all connections
NBEdge & operator=(const NBEdge &s)=delete
invalidated assignment operator
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > &priorities)
add some straight connections
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
void computeAngle()
computes the angle of this edge and stores it in myAngle
bool isBidiEdge(bool checkPotential=false) const
whether this edge is part of a bidirectional edge pair
void setBidi(bool isBidi)
mark this edge as a bidi edge
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
const NBNode * getSignalNode() const
Returns the node that (possibly) represents a traffic signal controlling at the end of this edge.
std::vector< Lane > myLanes
Lane information.
int getNumLanes() const
Returns the number of lanes.
std::vector< Connection > getConnectionsFromLane(int lane, const NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
bool myIsBidi
whether this edge is part of a non-rail bidi edge pair
static double firstIntersection(const PositionVector &v1, const PositionVector &v2, double width1, double width2, const std::string &error="", bool secondIntersection=false)
compute the first intersection point between the given lane geometries considering their rspective wi...
PositionVector myToBorder
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
void setFriction(int lane, double friction)
set lane specific friction (negative lane implies set for all lanes)
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
int getNumLanesThatAllow(SVCPermissions permissions, bool allPermissions=true) const
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
static NBEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
bool joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
void resetNodeBorder(const NBNode *node)
void markAsInLane2LaneState()
mark edge as in lane to state lane
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
void addRestrictedLane(double width, SUMOVehicleClass vclass)
add a lane of the given width, restricted to the given class and shift existing connections
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false, const bool keepPossibleTurns=false)
Removes the specified connection(s)
double myLength
The length of the edge.
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
@brif get first non-pedestrian lane
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
const std::vector< int > prepareEdgePriorities(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
recomputes the edge priorities and manipulates them for a distribution of lanes on edges which is mor...
int myIndex
the index of the edge in the list of all edges. Set by NBEdgeCont and requires re-set whenever the li...
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
Position geometryPositionAtOffset(double offset) const
return position taking into account loaded length
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
double getInternalLaneWidth(const NBNode &node, const NBEdge::Connection &connection, const NBEdge::Lane &successor, bool isVia) const
Returns the width of the internal lane associated with the connection.
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
bool isConnectedTo(const NBEdge *e, const bool ignoreTurnaround=false) const
Returns the information whethe a connection to the given edge has been added (or computed)
void addSign(NBSign sign)
add Sign
double getMaxLaneOffset()
get max lane offset
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
std::vector< NBSign > mySigns
the street signs along this edge
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
const PositionVector & getNodeBorder(const NBNode *node) const
const NBNode * mySignalNode
bool hasLaneSpecificWidth() const
whether lanes differ in width
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
void moveConnectionToRight(int lane)
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
static const int TURN_SIGN_SHIFT_TAXI
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
std::string getLaneID(int lane) const
get lane ID
bool myIsOffRamp
whether this edge is an Off-Ramp or leads to one
static const double UNSPECIFIED_SPEED
unspecified lane speed
Lane2LaneInfoType
Modes of setting connections between lanes.
@ USER
The connection was given by the user.
@ VALIDATED
The connection was computed and validated.
@ COMPUTED
The connection was computed.
double getFriction() const
Returns the friction on this edge.
static PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape)
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing, bool withBikes=true) const
Returns the list of lanes that may be used to reach the given edge.
void computeLaneShapes()
compute lane shapes
double getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
double getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
int getSpecialLane(SVCPermissions permissions) const
return index of the first lane that allows the given permissions
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection to a certain lane of a certain edge.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
double myDistance
The mileage/kilometrage at the start of this edge in a linear coordination system.
const std::string & getTypeID() const
get ID of type
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
const std::string & getStreetName() const
Returns the street name of this edge.
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
double myLoadedLength
An optional length to use (-1 if not valid)
static void updateTurnPermissions(SVCPermissions &perm, LinkDirection dir, SVCPermissions spec, std::vector< LinkDirection > dirs)
static void setDefaultConnectionLength(double length)
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
bool applyTurnSigns()
apply loaded turn sign information
bool haveIntersection(const NBNode &n, const PositionVector &shape, const NBEdge *otherFrom, const NBEdge::Connection &otherCon, int numPoints, double width1, double width2, int shapeFlag=0) const
NBEdge(const NBEdge &s)=delete
invalidated copy constructor
void preferVehicleClass(int lane, SVCPermissions vclasses)
prefer certain vehicle classes for the given lane or for all lanes if -1 is given (ensures also permi...
const NBEdge * getBidiEdge() const
NBNode * getFromNode() const
Returns the origin node of the edge.
double myStartAngle
The angles of the edge.
double getAngleAtNodeNormalized(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node and disregards edge direction.
NBEdge * getTurnDestination(bool possibleDestination=false) const
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
bool hasLaneSpecificType() const
whether lanes differ in type
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
void setPriority(int priority)
Sets the priority of the edge.
double getTotalAngle() const
Returns the angle at the start of the edge.
bool myAmInTLS
Information whether this is lies within a joined tls.
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
bool hasDefaultGeometryEndpointAtNode(const NBNode *node) const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
int getPriority() const
Returns the priority of the edge.
void computeEdgeShape(double smoothElevationThreshold=-1)
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
double assignInternalLaneLength(std::vector< Connection >::iterator i, int numLanes, double lengthSum, bool averageLength)
assign length to all lanes of an internal edge
static const double UNSPECIFIED_WIDTH
unspecified lane width
bool hasRestrictedLane(SUMOVehicleClass vclass) const
returns whether any lane already allows the given vclass exclusively
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
double getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
const StopOffset & getLaneStopOffset(int lane) const
Returns the stop offset to the specified lane's end.
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
Position mySignalPosition
the position of a traffic light signal on this edge
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
bool lanesWereAssigned() const
Check if lanes were assigned.
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
double getEndOffset() const
Returns the offset to the destination node.
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
double myFriction
The current friction.
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
static const double UNSPECIFIED_OFFSET
unspecified lane offset
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
bool addLane2LaneConnections(int fromLane, NBEdge *dest, int toLane, int no, Lane2LaneInfoType type, bool invalidatePrevious=false, bool mayDefinitelyPass=false)
Builds no connections starting at the given lanes.
void setOrigID(const std::string origID, const bool append, const int laneIdx=-1)
set origID for all lanes or for a specific lane
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const
Returns whether the given vehicle class may change left from this lane.
static int getLaneIndexFromLaneID(const std::string laneID)
bool hasConnectionTo(const NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
void setAsMacroscopicConnector()
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
bool hasLaneParams() const
whether one of the lanes has parameters set
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
double getShapeEndAngle() const
Returns the angle at the end of the edge.
bool prohibitsChanging() const
whether one of the lanes prohibits lane changing
void setLoadedLength(double val)
set loaded length
const std::string & getTurnSignTarget() const
PositionVector myGeom
The geometry for the edge.
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
void setSignalPosition(const Position &pos, const NBNode *signalNode)
sets the offset of a traffic signal from the end of this edge
void decLaneNo(int by)
decrement lane
NBNode * myFrom
The source and the destination node.
void append(NBEdge *continuation)
append another edge
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
double getFinalLength() const
get length that will be assigned to the lanes in the final network
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
int myPriority
The priority of the edge.
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
int getFirstNonPedestrianNonBicycleLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN, SVC_BICYCLE and 0
Container for nodes during the netbuilding process.
Represents a single node (junction) during network building.
Superclass for NBEdge and NBEdge::Connection to initialize Router.
virtual double getLength() const =0
static double getTravelTimeStatic(const NBRouterEdge *const edge, const NBVehicle *const, double)
bool restricts(const NBVehicle *const) const
virtual int getNumericalID() const =0
virtual bool isInternal() const
bool prohibits(const NBVehicle *const) const
virtual const std::string & getID() const =0
virtual const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const =0
virtual const NBRouterEdge * getBidiEdge() const =0
virtual double getSpeed() const =0
A class representing a single street sign.
A vehicle as used by router.
Base class for objects which have an id.
const std::string & getID() const
Returns the id.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
A point in 2D or 3D with translation and scaling methods.
double length() const
Returns the length.
static const PositionVector EMPTY
empty Vector
A structure which describes a connection between edges or lanes.
bool indirectLeft
Whether this connection is an indirect left turn.
const std::string & getID() const
int fromLane
The lane the connections starts at.
std::string viaID
if Connection have a via, ID of it
int toLane
The lane the connections yields in.
std::vector< int > foeInternalLinks
FOE Internal links.
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
const Connection * getBidiEdge() const
int getNumericalID() const
std::string getInternalViaLaneID() const
get ID of internal lane (second part)
double speed
custom speed for connection
NBEdge * toEdge
The edge the connections yields in.
KeepClear keepClear
whether the junction must be kept clear when using this connection
double customLength
custom length for connection
std::string edgeType
optional type of Connection
double vmax
maximum velocity
bool uncontrolled
check if Connection is uncontrolled
PositionVector customShape
custom shape for connection
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this connections internal lane(s)
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this connections internal lane(s)
PositionVector viaShape
shape of via
std::string getDescription(const NBEdge *parent) const
get string describing this connection
double contPos
custom position for internal junction on this connection
std::string getInternalLaneID() const
get ID of internal lane
int internalLaneIndex
The lane index of this internal lane within the internal edge.
std::string tlID
The id of the traffic light that controls this connection.
double visibility
custom foe visiblity for connection
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
double length
computed length (average of all internal lane shape lengths that share an internal edge)
PositionVector shape
shape of Connection
std::string id
id of Connection
std::vector< std::string > foeIncomingLanes
FOE Incomings lanes.
bool haveVia
check if Connection have a Via
int tlLinkIndex
The index of this connection within the controlling traffic light.
double viaLength
the length of the via shape (maybe customized)
static ConstRouterEdgePairVector myViaSuccessors
An (internal) definition of a single lane of an edge.
double width
This lane's width.
StopOffset laneStopOffset
stopOffsets.second - The stop offset for vehicles stopping at the lane's end. Applies if vClass is in...
int turnSigns
turning signs printed on the road, bitset of LinkDirection (imported from OSM)
PositionVector customShape
A custom shape for this lane set by the user.
double endOffset
This lane's offset to the intersection begin.
std::string type
the type of this lane
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
double speed
The speed allowed on this lane.
std::string oppositeID
An opposite lane ID, if given.
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this lane.
double friction
The friction on this lane.
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this lane.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
bool connectionsDone
Whether connection information for this lane is already completed.
bool accelRamp
Whether this lane is an acceleration lane.
PositionVector shape
The lane's shape.