 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
66 virtual const std::string&
getID()
const = 0;
198 Connection(
int fromLane_,
NBEdge* toEdge_,
int toLane_,
bool mayDefinitelyPass_,
199 bool keepClear_ =
true,
203 bool haveVia_ =
false,
204 bool uncontrolled_ =
false,
299 throw ProcessError(
"NBEdge::Connection does not implement getNumericalID()");
370 NBEdge(
const std::string&
id,
372 double speed,
int nolanes,
int priority,
373 double width,
double endOffset,
374 const std::string& streetName =
"",
399 NBEdge(
const std::string&
id,
401 double speed,
int nolanes,
int priority,
402 double width,
double endOffset,
404 const std::string& streetName =
"",
405 const std::string& origID =
"",
407 bool tryIgnoreNodePositions =
false);
420 NBEdge(
const std::string&
id,
447 double speed,
int nolanes,
int priority,
449 const std::string& streetName,
451 bool tryIgnoreNodePositions =
false);
656 const std::vector<NBEdge::Lane>&
getLanes()
const {
791 void checkGeometry(
const double maxAngle,
const double minRadius,
bool fix,
bool silent);
834 bool mayUseSameDestination =
false,
835 bool mayDefinitelyPass =
false,
836 bool keepClear =
true,
862 NBEdge* dest,
int toLane,
int no,
864 bool mayDefinitelyPass =
false);
879 bool mayUseSameDestination =
false,
880 bool mayDefinitelyPass =
false,
881 bool keepClear =
true,
985 void removeFromConnections(
NBEdge* toEdge,
int fromLane = -1,
int toLane = -1,
bool tryLater =
false,
const bool adaptToLaneRemoval =
false,
const bool keepPossibleTurns =
false);
1128 void appendTurnaround(
bool noTLSControlled,
bool onlyDeadends,
bool noGeometryLike,
bool checkPermissions);
1212 void deleteLane(
int index,
bool recompute,
bool shiftIndices);
1215 void addLane(
int index,
bool recomputeShape,
bool recomputeConnections,
bool shiftIndices);
1254 void setLaneType(
int lane,
const std::string& type);
1260 void setSpeed(
int lane,
double speed);
1264 bool setStopOffsets(
int lane, std::map<int, double> offsets,
bool overwrite =
false);
1276 void setOrigID(
const std::string origID);
1289 assert(lane < (
int)
myLanes.size());
1296 assert(lane < (
int)
myLanes.size());
1332 bool isBidiRail(
bool ignoreSpread =
false)
const;
1408 void execute(
const int lane,
const int virtEdge);
1491 void init(
int noLanes,
bool tryIgnoreNodePositions,
const std::string& origID);
PositionVector cutAtIntersection(const PositionVector &old) const
cut shape at the intersection shapes
void append(NBEdge *continuation)
append another edge
std::string tlID
The id of the traffic light that controls this connection.
void reinitNodes(NBNode *from, NBNode *to)
Resets nodes but keeps all other values the same (used when joining)
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
#define UNUSED_PARAMETER(x)
static const double UNSPECIFIED_OFFSET
unspecified lane offset
@ LANES2LANES_RECHECK
Lanes to lanes - relationships are computed; should be recheked.
const bool myHasFromLane
check if has from lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
Lane(NBEdge *e, const std::string &_origID)
constructor
int operator()(const Connection &c1, const Connection &c2) const
comparing operation
void addStraightConnections(const EdgeVector *outgoing, const std::vector< int > &availableLanes, const std::vector< int > &priorities)
add some straight connections
NBEdge * toEdge
The edge the connections yields in.
double speed
The speed allowed on this lane.
PositionVector myFromBorder
intersection borders (because the node shape might be invalid)
void setOrigID(const std::string origID)
set origID for all lanes
double getLaneSpeed(int lane) const
get lane speed
bool isConnectedTo(const NBEdge *e) const
Returns the information whethe a connection to the given edge has been added (or computed)
void appendTurnaround(bool noTLSControlled, bool onlyDeadends, bool noGeometryLike, bool checkPermissions)
Add a connection to the previously computed turnaround, if wished.
bool haveVia
check if Connection have a Via
double length
computed length (average of all internal lane shape lengths that share an internal edge)
double vmax
maximum velocity
std::vector< Connection > & getConnections()
Returns the connections.
connections_finder & operator=(const connections_finder &s)
invalidated assignment operator
double myDistance
The mileage/kilometrage at the start of this edge in a linear coordination system.
An upper class for objects with additional parameters.
Base class for objects which have an id.
Storage for edges, including some functionality operating on multiple edges.
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
A class that being a bresenham-callback assigns the incoming lanes to the edges.
static double getTravelTimeStatic(const NBRouterEdge *const edge, const NBVehicle *const, double)
void shortenGeometryAtNode(const NBNode *node, double reduction)
linearly extend the geometry at the given node
void restoreBikelane(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added BikeLane
std::string type
the type of this lane
LaneSpreadFunction myLaneSpreadFunction
The information about how to spread the lanes.
virtual bool isInternal() const
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
Static storage of an output device and its base (abstract) implementation.
bool canMoveConnection(const Connection &con, int newFromLane) const
whether the connection can originate on newFromLane
EdgeBuildingStep getStep() const
The building step of this edge.
void mirrorX()
mirror coordinates along the x-axis
bool hasRestrictedLane(SUMOVehicleClass vclass) const
returns whether any lane already allows the given vclass exclusively
A class representing a single street sign.
void shiftPositionAtNode(NBNode *node, NBEdge *opposite)
shift geometry at the given node to avoid overlap
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 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.
bool uncontrolled
check if Connection is uncontrolled
int getNumericalID() const
Returns the index (numeric id) of the edge.
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
void buildInnerEdges(const NBNode &n, int noInternalNoSplits, int &linkIndex, int &splitIndex)
double getSignalOffset() const
Returns the offset of a traffic signal from the end of this edge.
NBNode * getSignalNode() const
Returns the node that (possibly) represents a traffic signal controlling at the end of this edge.
void setJunctionPriority(const NBNode *const node, int prio)
Sets the junction priority of the edge.
void sortOutgoingConnectionsByIndex()
sorts the outgoing connections by their from-lane-index and their to-lane-index
Position geometryPositionAtOffset(double offset) const
return position taking into account loaded length
void setStreetName(const std::string &name)
sets the street name of this edge
void setLaneType(int lane, const std::string &type)
set lane specific type (negative lane implies set for all lanes)
connections_toedgelane_finder & operator=(const connections_toedgelane_finder &s)
invalidated assignment operator
EdgeBuildingStep
Current state of the edge within the building process.
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
void markAsInLane2LaneState()
mark edge as in lane to state lane
std::vector< std::string > foeIncomingLanes
FOE Incomings lanes.
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...
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
void setNodeBorder(const NBNode *node, const Position &p, const Position &p2, bool rectangularCut)
Set Node border.
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
double contPos
custom position for internal junction on this connection
virtual double getSpeed() const =0
void copyConnectionsFrom(NBEdge *src)
copy connections from antoher edge
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
std::vector< std::pair< const NBRouterEdge *, const NBRouterEdge * > > ConstRouterEdgePairVector
void computeEdgeShape(double smoothElevationThreshold=-1)
Recomputeds the lane shapes to terminate at the node shape For every lane the intersection with the f...
void moveConnectionToRight(int lane)
int myFromJunctionPriority
The priority normalised for the node the edge is outgoing of.
double getCrossingAngle(NBNode *node)
return the angle for computing pedestrian crossings at the given node
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
@ EDGE2EDGES
The relationships between edges are computed/loaded.
void replaceInConnections(NBEdge *which, NBEdge *by, int laneOff)
replace in current connections of edge
connections_toedgelane_finder(NBEdge *const edge2find, int lane2find, int fromLane2find)
constructor
NBEdge * myEdge
the edge to compute the relative angle of
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
bool setControllingTLInformation(const NBConnection &c, const std::string &tlID)
Returns if the link could be set as to be controlled.
bool empty() const
returns the information whether no following street has a higher priority
int getPriority() const
Returns the priority of the edge.
std::vector< Direction > myDirs
list of the main direction within the following junction relative to the edge
void computeLaneShapes()
compute lane shapes
int getSpecialLane(SVCPermissions permissions) const
return index of the first lane that allows the given permissions
MainDirections(const MainDirections &)
Invalidated copy constructor.
void setDistance(double distance)
set lane specific speed (negative lane implies set for all lanes)
int myFromLane
index of from lane
double length() const
Returns the length.
NBEdge * myTurnDestination
The turn destination edge (if a connection exists)
double myStartAngle
The angles of the edge.
std::vector< int > foeInternalLinks
FOE Internal links.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
double getShapeStartAngle() const
Returns the angle at the start of the edge.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
ToEdgeConnectionsAdder(const EdgeVector &transitions)
constructor
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
void setLoadedLength(double val)
set loaded length
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
int myIndex
the index of the edge in the list of all edges. Set by NBEdgeCont and requires re-set whenever the li...
int tlLinkIndex
The index of this connection within the controlling traffic light.
static NBEdge DummyEdge
Dummy edge to use when a reference must be supplied in the no-arguments constructor (FOX technicality...
NBEdge & operator=(const NBEdge &s)
invalidated assignment operator
double mySpeed
The maximal speed.
@ L2L_USER
The connection was given by the user.
connections_fromlane_finder(int lane2find)
@briefconstructor
int myPriority
The priority of the edge.
bool hasDefaultGeometryEndpointAtNode(const NBNode *node) const
Returns whether the geometry is terminated by the node positions This default may be violated by init...
bool isRailDeadEnd() const
whether this edge is a railway edge that does not continue
void extendGeometryAtNode(const NBNode *node, double maxExtent)
linearly extend the geometry at the given node
void remapConnections(const EdgeVector &incoming)
Remaps the connection in a way that allows the removal of it.
static ConstRouterEdgePairVector myViaSuccessors
NBNode * tryGetNodeAtPosition(double pos, double tolerance=5.0) const
Returns the node at the given edges length (using an epsilon)
static const int UNSPECIFIED_INTERNAL_LANE_INDEX
internal lane computation not yet done
void setInsideTLS()
Marks this edge being within an intersection.
connections_toedge_finder & operator=(const connections_toedge_finder &s)
invalidated assignment operator
connections_conflict_finder & operator=(const connections_conflict_finder &s)
invalidated assignment operator
int myLane2Find
index of lane to find
void assignInternalLaneLength(std::vector< Connection >::iterator i, int numLanes, double lengthSum)
assign length to all lanes of an internal edge
Container for nodes during the netbuilding process.
int fromLane
The lane the connections starts at.
MainDirections & operator=(const MainDirections &)
Invalidated assignment operator.
void disallowVehicleClass(int lane, SUMOVehicleClass vclass)
set disallowed class for the given lane or for all lanes if -1 is given
PositionVector getCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going clock-wise around the given node
The representation of a single edge during network building.
bool joinLanes(SVCPermissions perms)
join adjacent lanes with the given permissions
PositionVector myGeom
The geometry for the edge.
void reshiftPosition(double xoff, double yoff)
Applies an offset to the edge.
int getFirstNonPedestrianLaneIndex(int direction, bool exclusive=false) const
return the first lane with permissions other than SVC_PEDESTRIAN and 0
double speed
custom speed for connection
A road/street connecting two junctions (netedit-version)
int myStraightest
the index of the straightmost among the given outgoing edges
NBEdge *const myEdge2Find
edge to find
int toLane
The lane the connections yields in.
bool includes(Direction d) const
returns the information whether the street in the given direction has a higher priority
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
bool lanesWereAssigned() const
Check if lanes were assigned.
void dismissVehicleClassInformation()
dimiss vehicle class information
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Class to sort edges by their angle.
bool operator()(const Connection &c) const
operator ()
NBNode * myFrom
The source and the destination node.
void clearControllingTLInformation()
clears tlID for all connections
bool isNearEnough2BeJoined2(NBEdge *e, double threshold) const
Check if edge is near enought to be joined to another edge.
Lane2LaneInfoType
Modes of setting connections between lanes.
NBNode * getToNode() const
Returns the destination node of the edge.
bool operator()(const Connection &c) const
operator ()
void setNumericalID(int index)
sets the index of the edge in the list of all network edges
double getMaxLaneOffset()
get max lane offset
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED)
Adds a connection to a certain lane of a certain edge.
PositionVector viaShape
shape of via
void decLaneNo(int by)
decrement lane
const PositionVector & getGeometry() const
Returns the geometry of the edge.
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
double getLaneWidth() const
Returns the default width of lanes of this edge.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
virtual const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const =0
connections_conflict_finder(int fromLane, NBEdge *const edge2find, bool checkRight)
constructor
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
int myLane2Find
lane to find
const std::map< int, double > & getStopOffsets() const
Returns the stopOffset to the end of the edge.
int myToJunctionPriority
The priority normalised for the node the edge is incoming in.
bool prohibits(const NBVehicle *const) const
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
void execute(const int lane, const int virtEdge)
executes a bresenham - step
std::string getDescription(const NBEdge *parent) const
get string describing this connection
std::string getLaneID(int lane) const
get lane ID
@ LANES2LANES_DONE
Lanes to lanes - relationships are computed; no recheck is necessary/wished.
bool recheckLanes()
recheck whether all lanes within the edge are all right and optimises the connections once again
void setAsMacroscopicConnector()
virtual int getNumericalID() const =0
void addCrossingPointsAsIncomingWithGivenOutgoing(NBEdge *o, PositionVector &into)
add crossing points as incoming with given outgoing
static int getLaneIndexFromLaneID(const std::string laneID)
bool isInsideTLS() const
Returns whether this edge was marked as being within an intersection.
PositionVector shape
shape of Connection
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
move outgoing connection
bool computeLanes2Edges()
computes the edge, step2: computation of which lanes approach the edges)
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...
int getNumLanes() const
Returns the number of lanes.
NBEdge()
constructor for dummy edge
bool hasLoadedLength() const
Returns whether a length was set explicitly.
@ L2L_COMPUTED
The connection was computed.
std::map< int, double > stopOffsets
stopOffsets.second - The stop offset for vehicles stopping at the lane's end. Applies if vClass is in...
std::vector< Connection > myConnectionsToDelete
List of connections marked for delayed removal.
bool myInvertEdge2find
invert edge to find
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
NBEdge * myPossibleTurnDestination
The edge that would be the turn destination if there was one.
void setTurningDestination(NBEdge *e, bool onlyPossible=false)
Sets the turing destination at the given edge.
void computeAngle()
computes the angle of this edge and stores it in myAngle
double myEndOffset
This edges's offset to the intersection begin (will be applied to all lanes)
bool hasAccelLane() const
whether one of the lanes is an acceleration lane
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
bool myAmInTLS
Information whether this is lies within a joined tls.
A point in 2D or 3D with translation and scaling methods.
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
A vehicle as used by router.
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
connections_relative_edgelane_sorter(NBEdge *e)
constructor
MainDirections(const EdgeVector &outgoing, NBEdge *parent, NBNode *to, const std::vector< int > &availableLanes)
constructor
double getTotalWidth() const
Returns the combined width of all lanes of this edge.
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
const std::vector< NBSign > & getSigns() const
get Signs
bool mayBeTLSControlled(int fromLane, NBEdge *toEdge, int toLane) const
return true if certain connection must be controlled by TLS
static const PositionVector EMPTY
empty Vector
static PositionVector startShapeAt(const PositionVector &laneShape, const NBNode *startNode, PositionVector nodeShape)
Connection(int fromLane_, NBEdge *toEdge_, int toLane_)
Constructor.
PositionVector myToBorder
Lane & getLaneStruct(int lane)
double width
This lane's width.
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
void reduceGeometry(const double minDist)
Removes points with a distance lesser than the given.
static const double UNSPECIFIED_SIGNAL_OFFSET
unspecified signal offset
Connection & getConnectionRef(int fromLane, const NBEdge *to, int toLane)
Returns reference to the specified connection This method goes through "myConnections" and returns th...
void addBikeLane(double width)
add a bicycle lane of the given width and shift existing connctions
void addSidewalk(double width)
add a pedestrian sidewalk of the given width and shift existing connctions
const EdgeVector * getConnectedSorted()
Returns the list of outgoing edges without the turnaround sorted in clockwise direction.
const std::string & getID() const
EdgeBuildingStep myStep
The building step.
void resetNodeBorder(const NBNode *node)
double getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
ConstRouterEdgePairVector myViaSuccessors
static const double UNSPECIFIED_SPEED
unspecified lane speed
void restoreSidewalk(std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore an previously added sidewalk
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)
@ INIT_REJECT_CONNECTIONS
The edge has been loaded and connections shall not be added.
@ L2L_VALIDATED
The connection was computed and validated.
JunctionPriority
junction priority values set by setJunctionPriority
bool restricts(const NBVehicle *const) const
double getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
Superclass for NBEdge and NBEdge::Connection to initialize Router.
std::vector< Connection > myConnections
List of connections to following edges.
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
bool myAmMacroscopicConnector
Information whether this edge is a (macroscopic) connector.
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
bool computeEdge2Edges(bool noLeftMovers)
computes the edge (step1: computation of approached edges)
const std::string & getStreetName() const
Returns the street name of this edge.
NBEdge::Lane getFirstNonPedestrianLane(int direction) const
@brif get first non-pedestrian lane
bool expandableBy(NBEdge *possContinuation, std::string &reason) const
Check if Node is expandable.
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
const NBEdge *const myEdge2Find
edge to find
EdgeVector getIncomingEdges() const
Returns the list of incoming edges unsorted.
int myFromLane2Find
from lane to find
void init(int noLanes, bool tryIgnoreNodePositions, const std::string &origID)
Initialization routines common to all constructors.
const ConstRouterEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
ToEdgeConnectionsAdder(const ToEdgeConnectionsAdder &)
Invalidated copy constructor.
double getLength() const
Returns the computed length of the edge.
double getEndOffset() const
Returns the offset to the destination node.
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
connections_toedge_finder(const NBEdge *const edge2find, bool hasFromLane=false)
constructor
PositionVector customShape
A custom shape for this lane set by the user.
void divideOnEdges(const EdgeVector *outgoing)
divides the lanes on the outgoing edges
static double firstIntersection(const PositionVector &v1, const PositionVector &v2, double width2, const std::string &error="")
compute the first intersection point between the given lane geometries considering their rspective wi...
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
void addGeometryPoint(int index, const Position &p)
Adds a further geometry point.
void shiftToLanesToEdge(NBEdge *to, int laneOff)
modifify the toLane for all connections to the given edge
void disableConnection4TLS(int fromLane, NBEdge *toEdge, int toLane)
disable connections for TLS
virtual const std::string & getID() const =0
NBEdge *const myEdge2Find
edge to find
void reinit(NBNode *from, NBNode *to, const std::string &type, double speed, int nolanes, int priority, PositionVector geom, double width, double endOffset, const std::string &streetName, LaneSpreadFunction spread=LANESPREAD_RIGHT, bool tryIgnoreNodePositions=false)
Resets initial values.
std::string id
id of Connection
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
bool operator()(const Connection &c) const
operator ()
double getSpeed() const
Returns the speed allowed on this edge.
std::string viaID
if Connection have a via, ID of it
void checkGeometry(const double maxAngle, const double minRadius, bool fix, bool silent)
Check the angles of successive geometry segments.
An (internal) definition of a single lane of an edge.
void addSign(NBSign sign)
add Sign
const std::map< NBEdge *, std::vector< int > > & getBuiltConnections() const
get built connections
double getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
bool keepClear
whether the junction must be kept clear when using this connection
std::string oppositeID
An opposite lane ID, if given.
double myLoadedLength
An optional length to use (-1 if not valid)
bool hasLaneSpecificType() const
whether lanes differ in type
NBEdge *const myEdge2Find
edge to find
bool hasPermissions() const
whether at least one lane has restrictions
std::vector< Lane > myLanes
Lane information.
double myLaneWidth
This width of this edge's lanes.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
const EdgeVector & myTransitions
the transition from the virtual lane to the edge it belongs to
std::string myType
The type of the edge.
std::vector< int > getConnectionLanes(NBEdge *currentOutgoing, bool withBikes=true) const
Returns the list of lanes that may be used to reach the given edge.
std::map< int, double > myStopOffsets
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
static const double UNSPECIFIED_WIDTH
unspecified lane width
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
PositionVector customShape
custom shape for connection
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
int myLane2Find
lane to find
void moveConnectionToLeft(int lane)
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Direction
enum of possible directions
void debugPrintConnections(bool outgoing=true, bool incoming=false) const
debugging helper to print all connections
connections_finder(int fromLane, NBEdge *const edge2find, int lane2find, bool invertEdge2find=false)
constructor
const std::string & getTypeID() const
get ID of type
bool accelRamp
Whether this lane is an acceleration lane.
std::string getSidewalkID()
get the lane id for the canonical sidewalk lane
double mySignalOffset
the offset of a traffic light signal from the end of this edge (-1 for None)
EdgeVector getConnectedEdges() const
Returns the list of outgoing edges unsorted.
int myFromLane
index of from lane
std::string getInternalLaneID() const
get ID of internal lane
const EdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges for the given vClass.
void divideSelectedLanesOnEdges(const EdgeVector *outgoing, const std::vector< int > &availableLanes)
divide selected lanes on edges
std::set< SVCPermissions > getPermissionVariants(int iStart, int iEnd) const
return all permission variants within the specified lane range [iStart, iEnd[
bool operator()(const Connection &c) const
operator ()
void preferVehicleClass(int lane, SUMOVehicleClass vclass)
prefer certain vehicle class
void addRestrictedLane(double width, SUMOVehicleClass vclass)
add a lane of the given width, restricted to the given class and shift existing connections
std::map< NBEdge *, std::vector< int > > myConnections
map of edges to this edge's lanes that reach them
static double getTravelTimeStatic(const NBEdge *const edge, const NBVehicle *const, double)
ToEdgeConnectionsAdder & operator=(const ToEdgeConnectionsAdder &)
Invalidated assignment operator.
void incLaneNo(int by)
increment lane
double endOffset
This lane's offset to the intersection begin.
bool bothLeftIntersect(const NBNode &n, const PositionVector &shape, LinkDirection dir, NBEdge *otherFrom, const NBEdge::Connection &otherCon, int numPoints, double width2, int shapeFlag=0) const
determine conflict between opposite left turns
PositionVector shape
The lane's shape.
Represents a single node (junction) during network building.
static bool connections_sorter(const Connection &c1, const Connection &c2)
connections_sorter sort by fromLane, toEdge and toLane
bool needsLaneSpecificOutput() const
whether at least one lane has values differing from the edges values
const Lane & getLaneStruct(int lane) const
void allowVehicleClass(int lane, SUMOVehicleClass vclass)
set allowed class for the given lane or for all lanes if -1 is given
bool hasConnectionTo(NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
PositionVector computeLaneShape(int lane, double offset) const
Computes the shape for the given lane.
bool hasLaneParams() const
whether one of the lanes has parameters set
double getShapeEndAngle() const
Returns the angle at the end of the edge.
A structure which describes a connection between edges or lanes.
std::string myStreetName
The street name (or whatever arbitrary string you wish to attach)
@ SVC_IGNORING
vehicles ignoring classes
~MainDirections()
destructor
double visibility
custom foe visiblity for connection
~ToEdgeConnectionsAdder()
destructor
bool hasSignalisedConnectionTo(const NBEdge *const e) const
Check if edge has signalised connections.
void sortOutgoingConnectionsByAngle()
sorts the outgoing connections by their angle relative to their junction
int getStraightest() const
returns the index of the straightmost among the given outgoing edges
Holds (- relative to the edge it is build from -!!!) the list of main directions a vehicle that drive...
int internalLaneIndex
The lane index of this internal lane within the internal edge.
const std::string & getID() const
Returns the id.
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
void setAverageLengthWithOpposite(double val)
patch average lane length in regard to the opposite edge
const PositionVector & getNodeBorder(const NBNode *node)
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions=SVC_UNSPECIFIED)
Adds a connection between the specified this edge's lane and an approached one.
const std::vector< Connection > & getConnections() const
Returns the connections.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
NBNode * getFromNode() const
Returns the origin node of the edge.
double getTotalAngle() const
Returns the angle at the start of the edge.
void setSignalOffset(double offset, NBNode *signalNode)
sets the offset of a traffic signal from the end of this edge
bool setStopOffsets(int lane, std::map< int, double > offsets, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes)
PositionVector getCCWBoundaryLine(const NBNode &n) const
get the outer boundary of this edge when going counter-clock-wise around the given node
NBEdge(const NBEdge &s)
invalidated copy constructor
connections_fromlane_finder & operator=(const connections_fromlane_finder &s)
invalidated assignment operator
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
std::vector< NBSign > mySigns
the street signs along this edge
@ LANES2LANES_USER
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
bool hasCustomLaneShape() const
whether one of the lanes has a custom shape
@ LANES2EDGES
Lanes to edges - relationships are computed/loaded.
double myLength
The length of the edge.
bool connectionsDone
Whether connection information for this lane is already completed.
double getDistance() const
virtual double getLength() const =0
bool myCheckRight
check if is right
@ INIT
The edge has been loaded, nothing is computed yet.
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
bool hasLaneSpecificWidth() const
whether lanes differ in width
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
operator ()
NBEdge * getTurnDestination(bool possibleDestination=false) const
const std::string & getID() const
int getNumericalID() const
void restoreRestrictedLane(SUMOVehicleClass vclass, std::vector< NBEdge::Lane > oldLanes, PositionVector oldGeometry, std::vector< NBEdge::Connection > oldConnections)
restore a restricted lane