223 NBEdge(
const std::string&
id,
225 SUMOReal speed,
unsigned int nolanes,
int priority,
227 const std::string& streetName =
"",
251 NBEdge(
const std::string&
id,
253 SUMOReal speed,
unsigned int nolanes,
int priority,
256 const std::string& streetName =
"",
258 bool tryIgnoreNodePositions =
false);
269 NBEdge(
const std::string&
id,
295 SUMOReal speed,
unsigned int nolanes,
int priority,
297 const std::string& streetName,
299 bool tryIgnoreNodePositions =
false);
334 return (
unsigned int)
myLanes.size();
481 const std::vector<NBEdge::Lane>&
getLanes()
const {
641 bool mayUseSameDestination =
false,
642 bool mayDefinitelyPass =
false);
663 NBEdge* dest,
unsigned int toLane,
unsigned int no,
665 bool mayDefinitelyPass =
false);
679 unsigned int destLane,
681 bool mayUseSameDestination =
false,
682 bool mayDefinitelyPass =
false);
934 std::string
getLaneID(
unsigned int lane)
const;
955 void decLaneNo(
unsigned int by,
int dir = 0);
1004 void buildInnerEdges(
const NBNode& n,
unsigned int noInternalNoSplits,
unsigned int& lno,
unsigned int& splitNo);
1038 void execute(
const unsigned int lane,
const unsigned int virtEdge);
1121 void init(
unsigned int noLanes,
bool tryIgnoreNodePositions);
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
void invalidateConnections(bool reallowSetting=false)
const PositionVector & getLaneShape(unsigned int i) const
Returns the shape of the nth lane.
std::vector< Lane > myLanes
Lane information.
bool includes(Direction d) const
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.
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::vector< unsigned int > * preparePriorities(const EdgeVector *outgoing)
std::string foeIncomingLanes
PositionVector shape
The lane's shape.
NBEdge *const myEdge2Find
std::vector< TLSDisabledConnection > myTLSDisabledConnections
connections_relative_edgelane_sorter(NBEdge *e)
constructor
std::string foeInternalLanes
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
const std::string & getTypeName() const
Returns the type name.
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.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
The relationships between edges are computed/loaded.
void appendTurnaround(bool noTLSControlled)
Add a connection to the previously computed turnaround, if wished.
connections_toedge_finder & operator=(const connections_toedge_finder &s)
invalidated assignment operator
bool operator()(const TLSDisabledConnection &e) const
PositionVector getCCWBoundaryLine(const NBNode &n, SUMOReal offset) const
std::vector< NBSign > mySigns
the street signs along this edge
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 setOffset(int lane, SUMOReal offset)
set lane specific end-offset (negative lane implies set for all lanes)
void moveOutgoingConnectionsFrom(NBEdge *e, unsigned int laneOff)
~ToEdgeConnectionsAdder()
destructor
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...
bool operator()(const Connection &c) const
void incLaneNo(unsigned int by)
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.
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
std::vector< Direction > myDirs
void markAsInLane2LaneState()
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.
Lanes to lanes - relationships are computed; should be recheked.
PositionVector computeLaneShape(unsigned int lane, SUMOReal offset)
Computes the shape for the given lane.
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 ...
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
void computeLaneShapes()
Computes the offset from the edge shape on the current segment.
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.
void buildInnerEdges(const NBNode &n, unsigned int noInternalNoSplits, unsigned int &lno, unsigned int &splitNo)
bool isTurningDirectionAt(const NBNode *n, const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
PositionVector getCWBoundaryLine(const NBNode &n, SUMOReal offset) const
std::vector< Connection > getConnectionsFromLane(unsigned int lane) const
Returns connections from a given lane.
MainDirections & operator=(const MainDirections &)
Invalidated assignment operator.
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
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.
void moveConnectionToRight(unsigned int lane)
void setTurningDestination(NBEdge *e)
bool operator()(const Connection &c) const
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.
const std::string & getID() const
Returns the id.
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.
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
NBEdge * myTurnDestination
The turn destination edge.
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.
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
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)
bool myAmLeftHand
Whether this edge is a left-hand edge.
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
tls_disable_finder & operator=(const tls_disable_finder &s)
invalidated assignment operator
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
bool lanesWereAssigned() const
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.
SUMOReal offset
This lane's offset to the intersection begin.
void setAsMacroscopicConnector()
Marks this edge as a macroscopic connector.
bool hasLoadedLength() const
Returns whether a length was set explicitly.
EdgeBuildingStep getStep() const
The building step of this edge.
void setLeftHanded()
Marks this edge to be left-handed.
SUMOReal myLaneWidth
This width of this edge's lanes.
int myPriority
The priority of the edge.
void init(unsigned int noLanes, bool tryIgnoreNodePositions)
Initialization routines common to all constructors.
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.
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)
Invalidated assignment operator.
EdgeBuildingStep myStep
The building step.
unsigned int computePrioritySum(std::vector< unsigned int > *priorities)
SUMOReal myOffset
This edges's offset to the intersection begin (will be applied to all lanes)
connections_toedge_finder(NBEdge *const edge2find)
constructor
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.
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
const SVCPermissions SVCFreeForAll
connections_toedgelane_finder & operator=(const connections_toedgelane_finder &s)
invalidated assignment operator
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 (.
bool hasRestrictions() const
whether at least one lane has restrictions
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
void decLaneNo(unsigned int by, int dir=0)
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 execute(const unsigned int lane, const unsigned int virtEdge)
executes a bresenham - step
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)
bool hasLaneSpecificOffset() const
whether lanes differ in offset
SUMOReal getMaxLaneOffset()
static bool connections_sorter(const Connection &c1, const Connection &c2)
static const SUMOReal UNSPECIFIED_LOADED_LENGTH
no length override given
std::vector< NBEdge * > EdgeVector
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.
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.
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
void append(NBEdge *continuation)
unsigned int tlLinkNo
The index of this connection within the controlling traffic light.
connections_finder & operator=(const connections_finder &s)
invalidated assignment operator
SUMOReal getLaneSpeed(unsigned int lane) const
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.
NBEdge * getTurnDestination() const
bool hasLaneSpecificWidth() const
whether lanes differ in width
Static storage of an output device and its base (abstract) implementation.
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.
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)
invalidated assignment operator
void computeAngle()
computes the angle of this edge and stores it in myAngle
bool hasConnectionTo(NBEdge *destEdge, unsigned int destLane) const
Retrieves info about a connection to a certain lane of a certain edge.
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Container for nodes during the netbuilding process.
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)
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.
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.
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find)
constructor
const std::vector< Connection > & getConnections() const
Returns the connections.
NBNode * myFrom
The source and the destination node.
bool expandableBy(NBEdge *possContinuation) const
SUMOReal getOffset() const
Returns the offset to the destination node.
~MainDirections()
destructor
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
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to)
constructor
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 anglen
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.