 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
104 void execute(
const int src,
const int dest);
107 std::deque<int>*
spread(
const std::vector<int>& approachingLanes,
int dest)
const;
199 std::set<const NBEdge*, ComparatorIdLess>
edges;
242 bool updateEdgeGeometries =
false);
376 const std::string
getFoes(
int linkIndex)
const;
377 const std::string
getResponse(
int linkIndex)
const;
440 bool mustBrake(
const NBEdge*
const from,
const NBEdge*
const to,
int fromLane,
int toLane,
bool includePedCrossings)
const;
452 const NBEdge* prohibitorFrom,
const NBEdge* prohibitorTo,
int prohibitorFromLane,
453 bool lefthand =
false);
458 bool lefthand =
false)
const;
469 const NBEdge*
const possProhibitedFrom,
const NBEdge*
const possProhibitedTo,
470 bool regardNonSignalisedLowerPriority)
const;
480 const NBEdge*
const from2,
const NBEdge*
const to2)
const;
492 int fromLane,
int toLane,
bool mayDefinitelyPass,
const std::string& tlID)
const;
574 bool isTurnaround,
double extrapolateBeg,
double extrapolateEnd,
575 NBNode* recordError = 0,
int shapeFlag = 0)
const;
578 bool isTurnaround,
double extrapolateBeg,
double extrapolateEnd,
579 bool& ok,
NBNode* recordError = 0,
double straightThresh =
DEG2RAD(5),
683 Crossing*
getCrossing(
const std::string&
id)
const;
772 std::vector<std::pair<Position, std::string> >
getEndPoints()
const;
803 static bool includes(
const std::set<NBEdge*, ComparatorIdLess>& super,
804 const std::set<const NBEdge*, ComparatorIdLess>& sub);
edge_by_direction_sorter(NBNode *n)
constructor
~ApproachingDivider()
Destructor.
const std::string getResponse(int linkIndex) const
#define UNUSED_PARAMETER(x)
static const int FORWARD
edge directions (for pedestrian related stuff)
int minPrevCrossingEdges
minimum number of edges crossed by incoming crossings
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
void getEdgesThatApproach(NBEdge *currentOutgoing, EdgeVector &approaching)
returns a list of edges which are connected to the given outgoing edge
bool foes(const NBEdge *const from1, const NBEdge *const to1, const NBEdge *const from2, const NBEdge *const to2) const
Returns the information whether the given flows cross.
FringeType
algorithms for computing right of way
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
PositionVector shape
The polygonal shape.
An upper class for objects with additional parameters.
void computeLogic2(bool checkLaneFoes)
compute right-of-way logic for all lane-to-lane connections
void replaceOutgoing(NBEdge *which, NBEdge *by, int laneOff)
Replaces occurences of the first edge within the list of outgoing by the second Connections are remap...
ApproachingDivider(const EdgeVector &approaching, NBEdge *currentOutgoing)
Constructor.
bool checkIsRemovableReporting(std::string &reason) const
check if node is removable and return reason if not
Base class for objects which have an id.
Storage for edges, including some functionality operating on multiple edges.
std::set< NBTrafficLightDefinition * > myTrafficLights
traffic lights of node
Used for sorting the cells by the begin time they describe.
A container for traffic light definitions and built programs.
bool mustBrakeForCrossing(const NBEdge *const from, const NBEdge *const to, const Crossing &crossing) const
Returns the information whether the described flow must brake for the given crossing.
Static storage of an output device and its base (abstract) implementation.
void setRightOfWay(RightOfWay rightOfWay)
set method for computing right-of-way
SumoXMLNodeType myType
The type of the junction.
static bool includes(const std::set< NBEdge *, ComparatorIdLess > &super, const std::set< const NBEdge *, ComparatorIdLess > &sub)
returns whether sub is a subset of super
bool isLeftMover(const NBEdge *const from, const NBEdge *const to) const
Computes whether the given connection is a left mover across the junction.
NBConnectionProhibits myBlockedConnections
The container for connection block dependencies.
ApproachingDivider & operator=(const ApproachingDivider &)=delete
Invalidated assignment operator.
NBEdge * getConnectionTo(NBNode *n) const
get connection to certain node
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, bool &ok, NBNode *recordError=0, double straightThresh=DEG2RAD(5), int shapeFlag=0)
get bezier control points
NBNode * myNode
The node to compute the relative angle of.
const std::vector< WalkingAreaCustomShape > & getWalkingAreaCustomShapes() const
bool forbidsPedestriansAfter(std::vector< std::pair< NBEdge *, bool > > normalizedLanes, int startIndex)
return whether there is a non-sidewalk lane after the given index;
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
bool hasCustomShape
whether this walkingArea has a custom shape
PositionVector shape
The crossing's shape.
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, NBNode *recordError=0, int shapeFlag=0) const
Compute a smooth curve between the given geometries.
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
NBRequest * myRequest
Node requests.
double getDisplacementError() const
compute the displacement error during s-curve computation
int checkCrossing(EdgeVector candidates)
SumoXMLNodeType getType() const
Returns the type of this node.
void addWalkingAreaShape(EdgeVector edges, const PositionVector &shape)
add custom shape for walkingArea
Crossing(const NBNode *_node, const EdgeVector &_edges, double _width, bool _priority, int _customTLIndex, int _customTLIndex2, const PositionVector &_customShape)
constructor
std::string id
the (edge)-id of this crossing
void removeCrossing(const EdgeVector &edges)
remove a pedestrian crossing from this node (identified by its edges)
static std::string getNodeIDFromInternalLane(const std::string id)
returns the node id for internal lanes, crossings and walkingareas
int buildCrossings()
build pedestrian crossings
bool getKeepClear() const
Returns the keepClear flag.
bool isBentPriority() const
return whether a priority road turns at this node
bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turing right on a red light
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
std::vector< int > myAvailableLanes
The available lanes to which connections shall be built.
int operator()(NBEdge *e1, NBEdge *e2) const
operator of selection
bool isConstantWidthTransition() const
detects whether a given junction splits or merges lanes while keeping constant road width
A definition of a pedestrian walking area.
void execute(const int src, const int dest)
the bresenham-callback
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
add shorted link FOES
A container for districts.
bool writeLogic(OutputDevice &into) const
writes the XML-representation of the logic as a bitset-logic XML representation
PositionVector computeInternalLaneShape(NBEdge *fromE, const NBEdge::Connection &con, int numPoints, NBNode *recordError=0, int shapeFlag=0) const
Compute the shape for an internal lane.
bool turnFoes(const NBEdge *from, const NBEdge *to, int fromLane, const NBEdge *from2, const NBEdge *to2, int fromLane2, bool lefthand=false) const
return whether the given laneToLane connection originate from the same edge and are in conflict due t...
Container for nodes during the netbuilding process.
The representation of a single edge during network building.
bool needsCont(const NBEdge *fromE, const NBEdge *otherFromE, const NBEdge::Connection &c, const NBEdge::Connection &otherC) const
whether an internal junction should be built at from and respect other
void replaceInConnectionProhibitions(NBEdge *which, NBEdge *by, int whichLaneOff, int byLaneOff)
replace incoming connections prohibitions
nodes_by_id_sorter()
Constructor.
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
const EdgeVector & myApproaching
The list of edges that approach the current edge.
const Position & getPosition() const
bool checkIsRemovable() const
check if node is removable
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
get edges to join
const NBConnectionProhibits & getProhibitions()
get prohibitions (BLocked connections)
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
NBEdge * getNextCompatibleOutgoing(const NBEdge *incoming, SVCPermissions vehPerm, EdgeVector::const_iterator start, bool clockwise) const
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
void computeLanes2Lanes()
computes the connections of lanes to edges
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
get possibly splitted outgoing edge
bool isTLControlled() const
Returns whether this node is controlled by any tls.
std::set< const NBEdge *, ComparatorIdLess > edges
NBEdge * getOppositeIncoming(NBEdge *e) const
returns the opposite incoming edge of certain edge
void reshiftPosition(double xoff, double yoff)
Applies an offset to the node.
int myCrossingsLoadedFromSumoNet
number of crossings loaded from a sumo net
void discardAllCrossings(bool rejectAll)
discard all current (and optionally future) crossings
WalkingArea(const std::string &_id, double _width)
constructor
std::string prevWalkingArea
the lane-id of the previous walkingArea
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void invalidateIncomingConnections()
invalidate incoming connections
void computeLogic(const NBEdgeCont &ec)
computes the node's type, logic and traffic light
bool typeWasGuessed() const
return whether a priority road turns at this node
std::vector< std::string > nextSidewalks
the lane-id of the next sidewalk lane or ""
void displaceShapeAtWidthChange(const NBEdge *from, const NBEdge::Connection &con, PositionVector &fromShape, PositionVector &toShape) const
displace lane shapes to account for change in lane width at this node
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
double getRadius() const
Returns the turning radius of this node.
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
std::vector< std::pair< Position, std::string > > getEndPoints() const
return list of unique endpoint coordinates of all edges at this node
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset, int threshold=-1)
patches loaded signal plans by modifying lane indices above threshold by the given offset
void mirrorX()
mirror coordinates along the x-axis
bool setCrossingTLIndices(const std::string &tlID, int startIndex)
FringeType myFringeType
fringe type of this node
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
bool myKeepClear
whether the junction area must be kept clear
Sorts outgoing before incoming edges.
bool priority
whether the pedestrians have priority
void setRoundabout()
update the type of this node as a roundabout
int numNormalConnections() const
return the number of lane-to-lane connections at this junction (excluding crossings)
double myDisplacementError
geometry error after computation of internal lane shapes
A point in 2D or 3D with translation and scaling methods.
void removeTrafficLights()
Removes all references to traffic lights that control this tls.
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
static bool rightTurnConflict(const NBEdge *from, const NBEdge *to, int fromLane, const NBEdge *prohibitorFrom, const NBEdge *prohibitorTo, int prohibitorFromLane, bool lefthand=false)
return whether the given laneToLane connection is a right turn which must yield to a bicycle crossing...
bool myHaveCustomPoly
whether this nodes shape was set by the user
void invalidateOutgoingConnections()
invalidate outgoing connections
A storage for options typed value containers)
static const PositionVector EMPTY
empty Vector
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node)
void setCustomShape(const PositionVector &shape)
set the junction shape
static const int SCURVE_IGNORE
std::vector< std::string > prevSidewalks
the lane-id of the previous sidewalk lane or ""
void setRadius(double radius)
set the turning radius
const std::vector< Crossing * > & getCrossingsIncludingInvalid() const
int minNextCrossingEdges
minimum number of edges crossed by nextCrossings
std::vector< Crossing * > getCrossings() const
return this junctions pedestrian crossings
bool myDiscardAllCrossings
whether to discard all pedestrian crossings
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
bool hasCustomShape() const
return whether the shape was set by the user
int customTLIndex
the custom traffic light index of this crossing (if controlled)
int numAvailableLanes() const
@ get number of avaliable lanes
NBDistrict * myDistrict
The district the node is the centre of.
EdgeVector myOutgoingEdges
Vector of outgoing edges.
std::vector< Crossing * > myCrossings
Vector of crossings.
bool myTypeWasGuessed
whether the node type was guessed rather than loaded
std::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
void avoidOverlap()
fix overlap
void discardWalkingareas()
discard previously built walkingareas (required for repeated computation by netedit)
const PositionVector & getShape() const
retrieve the junction shape
NBNode::Crossing * addCrossing(EdgeVector edges, double width, bool priority, int tlIndex=-1, int tlIndex2=-1, const PositionVector &customShape=PositionVector::EMPTY, bool fromSumoNet=false)
add a pedestrian crossing to this node
double width
This crossing's width.
bool crossingBetween(const NBEdge *e1, const NBEdge *e2) const
return true if the given edges are connected by a crossing
Position myPosition
The position the node lies at.
int tlLinkIndex
the traffic light index of this crossing (if controlled)
PositionVector customShape
optional customShape for this crossing
void removeJoinedTrafficLights()
remove all traffic light definitions that are part of a joined tls
void remapRemoved(NBTrafficLightLogicCont &tc, NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
remap removed
A storage for available types of edges.
void buildWalkingAreas(int cornerDetail)
build pedestrian walking areas and set connections from/to walkingAreas
bool geometryLike() const
whether this is structurally similar to a geometry node
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
bool mustBrake(const NBEdge *const from, const NBEdge *const to, int fromLane, int toLane, bool includePedCrossings) const
Returns the information whether the described flow must let any other flow pass.
bool forbids(const NBEdge *const possProhibitorFrom, const NBEdge *const possProhibitorTo, const NBEdge *const possProhibitedFrom, const NBEdge *const possProhibitedTo, bool regardNonSignalisedLowerPriority) const
Returns the information whether "prohibited" flow must let "prohibitor" flow pass.
static const int AVOID_INTERSECTING_LEFT_TURNS
FringeType getFringeType() const
Returns fringe type.
RightOfWay
algorithms for computing right of way
double width
This lane's width.
std::vector< WalkingArea > myWalkingAreas
Vector of walking areas.
int numCrossingsFromSumoNet() const
get num of crossings from sumo net
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
NBNode(const std::string &id, const Position &position, SumoXMLNodeType type)
Constructor.
static const double UNSPECIFIED_RADIUS
unspecified lane width
const double INVALID_DOUBLE
static bool isLongEnough(NBEdge *out, double minLength)
check if is long enough
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
static const int FOUR_CONTROL_POINTS
NBNode & operator=(const NBNode &s)
invalidated assignment operator
bool isSimpleContinuation(bool checkLaneNumbers=true, bool checkWidth=false) const
check if node is a simple continuation
const NBNode * node
The parent node of this crossing.
void removeDoubleEdges()
remove duble edges
double myRadius
the turning radius (for all corners) at this node in m.
int operator()(NBNode *n1, NBNode *n2) const
Comparing operator.
void sortEdges(bool useNodeShape)
sort all edge containers for this node
EdgeVector edges
The edges being crossed.
bool myIsBikeEdge
whether the outgoing edge is exclusively used by bikes
static const int AVOID_WIDE_LEFT_TURN
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
double length
This lane's width.
Position getEmptyDir() const
Returns something like the most unused direction Should only be used to add source or sink nodes.
EdgeVector myIncomingEdges
Vector of incoming edges.
void setKeepClear(bool keepClear)
set the keepClear flag
void setFringeType(FringeType fringeType)
set method for computing right-of-way
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
int guessCrossings()
guess pedestrian crossings and return how many were guessed
EdgeVector getEdgesSortedByAngleAtNodeCenter() const
returns the list of all edges sorted clockwise by getAngleAtNodeToCenter
bool tlsContConflict(const NBEdge *from, const NBEdge::Connection &c, const NBEdge *foeFrom, const NBEdge::Connection &foe) const
whether the connection must yield if the foe remains on the intersection after its phase ends
std::string nextWalkingArea
the lane-id of the next walkingArea
PositionVector myPoly
the (outer) shape of the junction
void invalidateTLS(NBTrafficLightLogicCont &tlCont, bool removedConnections, bool addedConnections)
causes the traffic light to be computed anew
static const int BACKWARD
void setPriorityJunctionPriorities()
sets the priorites in case of a priority junction
std::vector< WalkingAreaCustomShape > myWalkingAreaCustomShapes
Vector of custom walking areas shapes.
Represents a single node (junction) during network building.
Computes lane-2-lane connections.
int removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes edges which are both incoming and outgoing into this node.
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
get possibly splitted incoming edge
A definition of a pedestrian crossing.
static const int AVOID_WIDE_RIGHT_TURN
flags for controlling shape generation
A structure which describes a connection between edges or lanes.
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
RightOfWay myRightOfWay
how to compute right of way for this node
RightOfWay getRightOfWay() const
Returns hint on how to compute right of way.
void buildInnerEdges()
build internal lanes, pedestrian crossings and walking areas
const std::string & getID() const
Returns the id.
std::string tlID
The id of the traffic light that controls this connection.
std::deque< int > * spread(const std::vector< int > &approachingLanes, int dest) const
the method that spreads the wished number of lanes from the the lane given by the bresenham-call to b...
A class representing a single district.
NBNode * getFromNode() const
Returns the origin node of the edge.
std::string id
the (edge)-id of this walkingArea
bool valid
whether this crossing is valid (and can be written to the net.xml). This is needed for netedit becaus...
const std::string getFoes(int linkIndex) const
void buildCrossingsAndWalkingAreas()
build crossings, and walkingareas. Also removes invalid loaded crossings if wished
std::vector< std::string > nextCrossings
the lane-id of the next crossing(s)
NBEdge * myCurrentOutgoing
The approached current edge.
double customWidth
This crossing's width.
bool isDistrict() const
check if node is a district
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
The base class for traffic light logic definitions.
EdgeVector edgesBetween(const NBEdge *e1, const NBEdge *e2) const
return all edges that lie clockwise between the given edges
void computeNodeShape(double mismatchThreshold)
Compute the junction shape for this node.
void markBentPriority(bool isBent)
mark whether a priority road turns at this node
void replaceIncoming(NBEdge *which, NBEdge *by, int laneOff)
Replaces occurences of the first edge within the list of incoming by the second Connections are remap...
This class computes shapes of junctions.
bool isNearDistrict() const
@chech if node is near district