155 : fromLane(fromLane_), toEdge(toEdge_), toLane(toLane_),
156 mayDefinitelyPass(false), keepClear(true), haveVia(false) { }
196 std::string getInternalLaneID()
const;
235 NBEdge(
const std::string&
id,
239 const std::string& streetName =
"",
264 NBEdge(
const std::string&
id,
269 const std::string& streetName =
"",
270 const std::string&
origID =
"",
272 bool tryIgnoreNodePositions =
false);
285 NBEdge(
const std::string&
id,
315 const std::string& streetName,
317 bool tryIgnoreNodePositions =
false);
346 return (
unsigned int)
myLanes.size();
502 const std::vector<NBEdge::Lane>&
getLanes()
const {
674 bool mayUseSameDestination =
false,
675 bool mayDefinitelyPass =
false,
676 bool keepClear =
true,
677 SUMOReal contPos = UNSPECIFIED_CONTPOS);
698 NBEdge* dest,
unsigned int toLane,
unsigned int no,
700 bool mayDefinitelyPass =
false);
714 unsigned int destLane,
716 bool mayUseSameDestination =
false,
717 bool mayDefinitelyPass =
false,
718 bool keepClear =
true,
719 SUMOReal contPos = UNSPECIFIED_CONTPOS);
992 std::string
getLaneID(
unsigned int lane)
const;
1026 void deleteLane(
unsigned int index,
bool recompute =
true);
1028 void addLane(
unsigned int index,
bool recompute =
true);
1088 void buildInnerEdges(
const NBNode& n,
unsigned int noInternalNoSplits,
unsigned int& linkIndex,
unsigned int& splitIndex);
1118 : myTransitions(transitions) { }
1124 void execute(
const unsigned int lane,
const unsigned int virtEdge);
1150 enum Direction { DIR_RIGHTMOST, DIR_LEFTMOST, DIR_FORWARD };
1205 void init(
unsigned int noLanes,
bool tryIgnoreNodePositions,
const std::string&
origID);
1211 const std::vector<unsigned int>* priorities);
1357 if (e.
to != myDefinition.to) {
1360 if (e.
fromLane != myDefinition.fromLane) {
1363 if (e.
toLane != myDefinition.toLane) {
1387 myHasFromLane(hasFromLane),
1388 myEdge2Find(edge2find) { }
1391 return c.
toEdge == myEdge2Find && (!myHasFromLane || c.
fromLane != -1);
1411 myEdge2Find(edge2find),
1412 myLane2Find(lane2find),
1413 myFromLane2Find(fromLane2find) { }
1416 return c.
toEdge == myEdge2Find && c.
toLane == myLane2Find && (myFromLane2Find < 0 || c.
fromLane == myFromLane2Find);
1437 connections_finder(
int fromLane,
NBEdge*
const edge2find,
int lane2find) : myFromLane(fromLane), myEdge2Find(edge2find), myLane2Find(lane2find) { }
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
void invalidateConnections(bool reallowSetting=false)
int tlLinkNo
The index of this connection within the controlling traffic light.
const PositionVector & getLaneShape(unsigned int i) const
Returns the shape of the nth lane.
std::vector< Lane > myLanes
Lane information.
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
bool hasConnectionTo(NBEdge *destEdge, unsigned int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
const std::string & getTypeID() const
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
SUMOReal endOffset
This lane's offset to the intersection begin.
void divideOnEdges(const EdgeVector *outgoing)
A structure which describes a connection between edges or lanes.
int toLane
The lane the connections yields in.
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
A class representing a single street sign.
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find)
constructor
std::string foeIncomingLanes
PositionVector shape
The lane's shape.
NBEdge *const myEdge2Find
SUMOReal myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
std::vector< TLSDisabledConnection > myTLSDisabledConnections
connections_relative_edgelane_sorter(NBEdge *e)
constructor
static const SUMOReal UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
void addSign(NBSign sign)
NBEdge * toEdge
The edge the connections yields in.
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
void mirrorX()
mirror coordinates along the x-axis
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
The relationships between edges are computed/loaded.
bool operator()(const TLSDisabledConnection &e) const
std::vector< NBSign > mySigns
the street signs along this edge
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
void setLaneWidth(int lane, SUMOReal width)
set lane specific width (negative lane implies set for all lanes)
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
void moveOutgoingConnectionsFrom(NBEdge *e, unsigned int laneOff)
~ToEdgeConnectionsAdder()
destructor
void addSidewalk(SUMOReal width)
add a pedestrian sidewalk of the given width and shift existing connctions
SUMOReal getEndAngle() const
Returns the angle at the end of the edge The angle is computed in computeAngle()
The representation of a single edge during network building.
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
void clearControllingTLInformation()
clears tlID for all connections
Lane2LaneInfoType
Modes of setting connections between lanes.
void declareConnectionsAsLoaded()
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
bool hasDefaultGeometryEndpoints() const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
Lane(NBEdge *e, const std::string &_origID)
bool operator()(const Connection &c) const
void incLaneNo(unsigned int by)
PositionVector getCCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going counter-clock-wise around the given node ...
bool addLane2LaneConnection(unsigned int fromLane, NBEdge *dest, unsigned int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, SUMOReal contPos=UNSPECIFIED_CONTPOS)
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 setStreetName(const std::string &name)
sets the street name of this edge
static const SUMOReal UNSPECIFIED_SPEED
unspecified lane speed
std::vector< Direction > myDirs
void buildInnerEdges(const NBNode &n, unsigned int noInternalNoSplits, unsigned int &linkIndex, unsigned int &splitIndex)
void markAsInLane2LaneState()
SUMOReal getTotalWidth() const
Returns the combined width of all lanes of this edge.
Lanes to lanes - relationships are computed; should be recheked.
SUMOReal getLaneWidth() const
Returns the default width of lanes of this edge.
std::string getLaneIDInsecure(unsigned int lane) const
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given ...
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
tls_disable_finder(const TLSDisabledConnection &tpl)
constructor
bool isInnerEdge() const
Returns whether this edge was marked as being within an intersection.
PositionVector myGeom
The geometry for the edge.
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
static const SUMOReal UNSPECIFIED_CONTPOS
unspecified internal junction position
bool setConnection(unsigned int lane, NBEdge *destEdge, unsigned int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, SUMOReal contPos=UNSPECIFIED_CONTPOS)
Adds a connection to a certain lane of a certain edge.
const SVCPermissions SVCAll
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
std::vector< Connection > getConnectionsFromLane(unsigned int lane) const
Returns connections from a given lane.
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
static SUMOReal firstIntersection(const PositionVector &v1, const PositionVector &v2, SUMOReal width2)
void setSignalOffset(SUMOReal offset)
sets the offset of a traffic signal from the end of this edge
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
The connection was computed and validated.
PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode) const
const std::vector< NBSign > & getSigns() const
The edge has been loaded, nothing is computed yet.
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
SUMOReal speed
The speed allowed on this lane.
bool keepClear
whether the junction must be kept clear when using this connection
void moveConnectionToRight(unsigned int lane)
bool operator()(const Connection &c) const
bool hasPermissions() const
whether at least one lane has restrictions
SUMOReal getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
An (internal) definition of a single lane of an edge.
connections_toedge_finder(NBEdge *const edge2find, bool hasFromLane=false)
constructor
SUMOReal mySpeed
The maximal speed.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
bool isConnectedTo(NBEdge *e)
Returns the information whethe a connection to the given edge has been added (or computed) ...
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the edge.
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< unsigned int > *priorities)
static unsigned int computePrioritySum(const std::vector< unsigned int > &priorities)
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
const std::map< NBEdge *, std::vector< unsigned int > > & getBuiltConnections() const
const Lane & getLaneStruct(unsigned int lane) const
friend class NBEdgeSuccessorBuilder
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
Connection getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection This method goes through "myConnections" and returns the specified o...
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
int getPriority() const
Returns the priority of the edge.
void checkGeometry(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
Check the angles of successive geometry segments.
std::string getLaneID(unsigned int lane) const
void moveConnectionToLeft(unsigned int lane)
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
std::string tlID
The id of the traffic light that controls this connection.
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
int fromLane
The lane the connections starts at.
A point in 2D or 3D with translation and scaling methods.
TLSDisabledConnection myDefinition
NBEdge & operator=(const NBEdge &s)
invalidated assignment operator
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
bool lanesWereAssigned() const
static bool connections_sorter(const Connection &c1, const Connection &c2)
std::vector< unsigned int > foeInternalLinks
std::vector< Connection > & getConnections()
Returns the connections.
unsigned int getNumLanes() const
Returns the number of lanes.
EdgeBuildingStep
Current state of the edge within the building process.
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
void setAsMacroscopicConnector()
Marks this edge as a macroscopic connector.
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
bool hasLoadedLength() const
Returns whether a length was set explicitly.
EdgeBuildingStep getStep() const
The building step of this edge.
bool canMoveConnection(const Connection &con, unsigned int newFromLane) const
whether the connection can originate on newFromLane
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
SUMOReal contPos
custom position for internal junction on this connection
SUMOReal myLaneWidth
This width of this edge's lanes.
int myPriority
The priority of the edge.
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
Storage for edges, including some functionality operating on multiple edges.
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
Connection(int fromLane_, NBEdge *toEdge_, int toLane_)
Constructor.
EdgeBuildingStep myStep
The building step.
SUMOReal getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
std::vector< Connection > myConnections
List of connections to following edges.
void setLoadedLength(SUMOReal val)
connections_fromlane_finder(int lane2find)
constructor
The connection was given by the user.
An upper class for objects with additional parameters.
SUMOReal getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
SUMOReal getEndOffset() const
Returns the offset to the destination node.
bool myAmInnerEdge
Information whether this is a junction-inner edge.
Base class for objects which have an id.
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
SUMOReal myLoadedLength
An optional length to use (-1 if not valid)
std::string origID
An original ID, if given (.
A road/street connecting two junctions (netedit-version)
std::map< NBEdge *, std::vector< unsigned int > > myConnections
map of edges to this edge's lanes that reach them
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
SUMOReal getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
void addRestrictedLane(SUMOReal width, SUMOVehicleClass vclass)
add a lane of the given width, restricted to the given class and shift existing connctions ...
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
void addBikeLane(SUMOReal width)
add a bicycle lane of the given width and shift existing connctions
void decLaneNo(unsigned int by)
NBNode * getToNode() const
Returns the destination node of the edge.
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing) const
Returns the list of lanes that may be used to reach the given edge.
void computeEdgeShape()
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
SUMOReal getMaxLaneOffset()
static const SUMOReal UNSPECIFIED_LOADED_LENGTH
no length override given
void deleteLane(unsigned int index, bool recompute=true)
std::vector< NBEdge * > EdgeVector
std::vector< unsigned int > * prepareEdgePriorities(const EdgeVector *outgoing)
NBEdge * myEdge
the edge to compute the relative angle of
SUMOReal myLength
The length of the edge.
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
const PositionVector & getGeometry() const
Returns the geometry of the edge.
The edge has been loaded and connections shall not be added.
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
PositionVector computeLaneShape(unsigned int lane, SUMOReal offset) const
Computes the shape for the given lane.
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
void reduceGeometry(const SUMOReal minDist)
Removes points with a distance lesser than the given.
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
void replaceInConnections(NBEdge *which, NBEdge *by, unsigned int laneOff)
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
NBEdge *const myEdge2Find
void setIsInnerEdge()
Marks this edge being within an intersection.
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
NBEdge *const myEdge2Find
std::string myType
The type of the edge.
SUMOReal mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
void append(NBEdge *continuation)
SUMOReal getLaneSpeed(unsigned int lane) const
void shiftToLanesToEdge(NBEdge *to, unsigned int laneOff)
modifify the toLane for all connections to the given edge
NBNode * 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 p...
The connection was computed.
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
SUMOReal myStartAngle
The angles of the edge.
SUMOReal getTotalAngle() const
get the angle as measure from the start to the end of this edge
Represents a single node (junction) during network building.
void dismissVehicleClassInformation()
Lane & getLaneStruct(unsigned int lane)
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
bool hasLaneSpecificWidth() const
whether lanes differ in width
Static storage of an output device and its base (abstract) implementation.
void setEndOffset(int lane, SUMOReal offset)
set lane specific end-offset (negative lane implies set for all lanes)
void appendTurnaround(bool noTLSControlled, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
Direction
enum of possible directions
bool isNearEnough2BeJoined2(NBEdge *e, SUMOReal threshold) const
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
void computeAngle()
computes the angle of this edge and stores it in myAngle
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Container for nodes during the netbuilding process.
SUMOReal getFinalLength() const
length that will be assigned to the lanes in the final network
SUMOReal getStartAngle() const
Returns the angle at the start of the edge The angle is computed in computeAngle() ...
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
unsigned int internalLaneIndex
The lane index of this internal lane within the internal edge.
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
bool operator()(const Connection &c) const
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.
Lanes to edges - relationships are computed/loaded.
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
const std::string & getStreetName() const
Returns the street name of this edge.
void addLane(unsigned int index, bool recompute=true)
const std::vector< Connection > & getConnections() const
Returns the connections.
NBNode * myFrom
The source and the destination node.
bool expandableBy(NBEdge *possContinuation) const
NBEdge * getTurnDestination(bool possibleDestination=false) const
void init(unsigned int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
bool operator()(const Connection &c) const
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
SUMOReal width
This lane's width.
void copyConnectionsFrom(NBEdge *src)
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.
static const SUMOReal ANGLE_LOOKAHEAD
the distance at which to take the default angle
SUMOReal getLength() const
Returns the computed length of the edge.
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
NBNode * getFromNode() const
Returns the origin node of the edge.
bool splitGeometry(NBEdgeCont &ec, NBNodeCont &nc)
Splits this edge at geometry points.