117 return (
int)myAvailableLanes.size();
121 void execute(
const int src,
const int dest);
124 std::deque<int>*
spread(
const std::vector<int>& approachingLanes,
int dest)
const;
174 minNextCrossingEdges(std::numeric_limits<int>::max()),
175 minPrevCrossingEdges(std::numeric_limits<int>::max()) {
236 bool updateEdgeGeometries =
false);
418 bool mustBrake(
const NBEdge*
const from,
const NBEdge*
const to,
int fromLane,
int toLane,
bool includePedCrossings)
const;
430 const NBEdge* prohibitorFrom,
const NBEdge* prohibitorTo,
int prohibitorFromLane,
431 bool lefthand =
false);
442 const NBEdge*
const possProhibitedFrom,
const NBEdge*
const possProhibitedTo,
443 bool regardNonSignalisedLowerPriority)
const;
453 const NBEdge*
const from2,
const NBEdge*
const to2)
const;
465 int fromLane,
int toLane,
bool mayDefinitelyPass,
const std::string& tlID)
const;
532 bool isTurnaround,
double extrapolateBeg,
double extrapolateEnd,
533 NBNode* recordError = 0)
const;
536 bool isTurnaround,
double extrapolateBeg,
double extrapolateEnd,
537 bool& ok,
NBNode* recordError = 0,
double straightThresh =
DEG2RAD(5));
bool getKeepClear() const
Returns the keepClear flag.
static const PositionVector EMPTY
empty Vector
int operator()(NBEdge *e1, NBEdge *e2) const
operator of selection
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
A structure which describes a connection between edges or lanes.
std::vector< WalkingAreaCustomShape > myWalkingAreaCustomShapes
Vector of custom walking areas shapes.
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
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) ...
WalkingArea(const std::string &_id, double _width)
constructor
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.
ApproachingDivider(EdgeVector *approaching, NBEdge *currentOutgoing)
Constructor.
int buildCrossings()
build pedestrian crossings
void shiftTLConnectionLaneIndex(NBEdge *edge, int offset)
patches loaded signal plans by modifying lane indices
std::string id
the (edge)-id of this crossing
PositionVector myPoly
the (outer) shape of the junction
void execute(const int src, const int dest)
the bresenham-callback
const NBConnectionProhibits & getProhibitions()
get prohibitions (BLocked connections)
bool isDistrict() const
check if node is a district
SumoXMLNodeType myType
The type of the junction.
A container for traffic light definitions and built programs.
void reinit(const Position &position, SumoXMLNodeType type, bool updateEdgeGeometries=false)
Resets initial values.
int minPrevCrossingEdges
minimum number of edges crossed by incoming crossings
PositionVector computeInternalLaneShape(NBEdge *fromE, const NBEdge::Connection &con, int numPoints, NBNode *recordError=0) const
Compute the shape for an internal lane.
int myCrossingsLoadedFromSumoNet
number of crossings loaded from a sumo net
This class computes shapes of junctions.
std::vector< Crossing * > getCrossings() const
return this junctions pedestrian crossings
double length
This lane's width.
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
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.
void addIncomingEdge(NBEdge *edge)
adds an incoming edge
bool hasCustomShape() const
return whether the shape was set by the user
The representation of a single edge during network building.
static const double UNSPECIFIED_RADIUS
unspecified lane width
Used for sorting the cells by the begin time they describe.
A container for districts.
The base class for traffic light logic definitions.
static bool isLongEnough(NBEdge *out, double minLength)
check if is long enough
void removeDoubleEdges()
remove duble edges
bool hasCustomShape
whether this walkingArea has a custom shape
bool rightOnRedConflict(int index, int foeIndex) const
whether the given index must yield to the foeIndex while turing right on a red light ...
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
PositionVector shape
The crossing's shape.
edge_by_direction_sorter(NBNode *n)
constructor
void buildWalkingAreas(int cornerDetail)
build pedestrian walking areas and set connections from/to walkingAreas
std::string id
the (edge)-id of this walkingArea
const std::string & getID() const
Returns the id.
void mirrorX()
mirror coordinates along the x-axis
int numCrossingsFromSumoNet() const
get num of crossings from sumo net
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
Removes the given traffic light from this node.
void setCustomShape(const PositionVector &shape)
set the junction shape
NBConnectionProhibits myBlockedConnections
The container for connection block dependencies.
void addOutgoingEdge(NBEdge *edge)
adds an outgoing edge
#define UNUSED_PARAMETER(x)
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...
void sortEdges(bool useNodeShape)
sort all edge containers for this node
Position getCenter() const
Returns a position that is guaranteed to lie within the node shape.
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...
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
bool priority
whether the pedestrians have priority
NBRequest * myRequest
Node requests.
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
NBDistrict * myDistrict
The district the node is the centre of.
A class representing a single district.
NBEdge * getConnectionTo(NBNode *n) const
get connection to certain node
EdgeVector myAllEdges
Vector of incoming and outgoing edges.
void invalidateTLS(NBTrafficLightLogicCont &tlCont, bool removedConnections, bool addedConnections)
causes the traffic light to be computed anew
void computeLanes2Lanes()
computes the connections of lanes to edges
void setRadius(double radius)
set the turning radius
bool isTLControlled() const
Returns whether this node is controlled by any tls.
bool writeLogic(OutputDevice &into, const bool checkLaneFoes) const
writes the XML-representation of the logic as a bitset-logic XML representation
void invalidateIncomingConnections()
invalidate incoming connections
void removeCrossing(const EdgeVector &edges)
remove a pedestrian crossing from this node (identified by its edges)
void setPriorityJunctionPriorities()
sets the priorites in case of a priority junction
void computeNodeShape(double mismatchThreshold)
Compute the junction shape for this node.
std::set< const NBEdge * > edges
std::string prevWalkingArea
the lane-id of the previous walkingArea
NBEdge * getPossiblySplittedIncoming(const std::string &edgeid)
get possibly splitted incoming edge
int checkCrossing(EdgeVector candidates)
static const int FORWARD
edge directions (for pedestrian related stuff)
void setCrossingTLIndices(const std::string &tlID, int startIndex)
set tl indices of this nodes crossing starting at the given index
int minNextCrossingEdges
minimum number of edges crossed by nextCrossings
A point in 2D or 3D with translation and scaling methods.
void buildCrossingsAndWalkingAreas()
build crossings, and walkingareas. Also removes invalid loaded crossings if wished ...
bool crossingBetween(const NBEdge *e1, const NBEdge *e2) const
return true if the given edges are connected by a crossing
void invalidateOutgoingConnections()
invalidate outgoing connections
void removeJoinedTrafficLights()
remove all traffic light definitions that are part of a joined tls
int operator()(NBNode *n1, NBNode *n2) const
Comparing operator.
const EdgeVector & getEdges() const
Returns all edges which participate in this node (Edges that start or end at this node) ...
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
void removeTrafficLights()
Removes all references to traffic lights that control this tls.
EdgeVector * getEdgesThatApproach(NBEdge *currentOutgoing)
returns a list of edges which are connected to the given outgoing edge
bool geometryLike() const
whether this is structurally similar to a geometry node
std::set< NBTrafficLightDefinition * > myTrafficLights
traffic lights of node
Storage for edges, including some functionality operating on multiple edges.
bool hasOutgoing(const NBEdge *const e) const
Returns whether the given edge starts at this node.
bool myDiscardAllCrossings
whether to discard all pedestrian crossings
NBNode * myNode
The node to compute the relative angle of.
void discardAllCrossings(bool rejectAll)
discard all current (and optionally future) crossings
void replaceInConnectionProhibitions(NBEdge *which, NBEdge *by, int whichLaneOff, int byLaneOff)
replace incoming connections prohibitions
An upper class for objects with additional parameters.
double myRadius
the turning radius (for all corners) at this node in m.
void addCrossing(EdgeVector edges, double width, bool priority, int tlIndex=-1, const PositionVector &customShape=PositionVector::EMPTY, bool fromSumoNet=false)
add a pedestrian crossing to this node
EdgeVector myIncomingEdges
Vector of incoming edges.
void setKeepClear(bool keepClear)
set the keepClear flag
bool checkIsRemovableReporting(std::string &reason) const
check if node is removable and return reason if not
Base class for objects which have an id.
bool hasIncoming(const NBEdge *const e) const
Returns whether the given edge ends at this node.
double getDisplacementError() const
compute the displacement error during s-curve computation
void avoidOverlap()
fix overlap
PositionVector computeSmoothShape(const PositionVector &begShape, const PositionVector &endShape, int numPoints, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, NBNode *recordError=0) const
Compute a smooth curve between the given geometries.
NBEdge * getPossiblySplittedOutgoing(const std::string &edgeid)
get possibly splitted outgoing edge
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
const PositionVector & getShape() const
retrieve the junction shape
EdgeVector myOutgoingEdges
Vector of outgoing edges.
std::vector< Crossing * > myCrossings
Vector of crossings.
void addWalkingAreaShape(EdgeVector edges, const PositionVector &shape)
add custom shape for walkingArea
NBEdge * myCurrentOutgoing
The approached current edge.
double myDisplacementError
geometry error after computation of internal lane shapes
static const int BACKWARD
nodes_by_id_sorter()
Constructor.
void addTrafficLight(NBTrafficLightDefinition *tlDef)
Adds a traffic light to the list of traffic lights that control this node.
double width
This crossing's width.
bool myHaveCustomPoly
whether this nodes shape was set by the user
int customTLIndex
the custom traffic light index of this crossing (if controlled)
Position myPosition
The position the node lies at.
bool checkCrossingDuplicated(EdgeVector edges)
return true if already exist a crossing with the same edges as the input
std::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
int removeSelfLoops(NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc)
Removes edges which are both incoming and outgoing into this node.
double getRadius() const
Returns the turning radius of this node.
~ApproachingDivider()
Destructor.
std::vector< WalkingArea > myWalkingAreas
Vector of walking areas.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
PositionVector customShape
optional customShape for this crossing
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...
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
bool isNearDistrict() const
if node is near district
bool myKeepClear
whether the junction area must be kept clear
std::vector< int > myAvailableLanes
The available lanes to which connections shall be built.
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node) ...
Sorts outgoing before incoming edges.
int tlLinkNo
the traffic light index of this crossing (if controlled)
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
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.
void buildInnerEdges()
build internal lanes, pedestrian crossings and walking areas
NBNode & operator=(const NBNode &s)
invalidated assignment operator
double customWidth
This crossing's width.
A definition of a pedestrian walking area.
EdgeVector * myApproaching
The list of edges that approach the current edge.
A storage for options typed value containers)
const NBNode * node
The parent node of this crossing.
SumoXMLNodeType getType() const
Returns the type of this node.
Position getEmptyDir() const
Returns something like the most unused direction Should only be used to add source or sink nodes...
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
int numAvailableLanes() const
@ get number of avaliable lanes
EdgeVector getEdgesSortedByAngleAtNodeCenter() const
returns the list of all edges sorted clockwise by getAngleAtNodeToCenter
const Position & getPosition() const
EdgeVector edges
The edges being crossed.
Represents a single node (junction) during network building.
int guessCrossings()
guess pedestrian crossings and return how many were guessed
A definition of a pedestrian crossing.
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
add shorted link FOES
Static storage of an output device and its base (abstract) implementation.
Computes lane-2-lane connections.
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.
std::string tlID
The id of the traffic light that controls this connection.
NBEdge * getOppositeIncoming(NBEdge *e) const
returns the opposite incoming edge of certain edge
const std::vector< Crossing * > & getCrossingsIncludingInvalid() const
std::vector< std::string > nextCrossings
the lane-id of the next crossing(s)
bool isLeftMover(const NBEdge *const from, const NBEdge *const to) const
Computes whether the given connection is a left mover across the junction.
NBNode * getFromNode() const
Returns the origin node of the edge.
void computeLogic(const NBEdgeCont &ec, OptionsCont &oc)
computes the node's type, logic and traffic light
Container for nodes during the netbuilding process.
std::string nextWalkingArea
the lane-id of the next walkingArea
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...
bool checkIsRemovable() const
check if node is removable
NBNode(const std::string &id, const Position &position, SumoXMLNodeType type)
Constructor.
std::vector< std::pair< NBEdge *, NBEdge * > > getEdgesToJoin() const
get edges to join
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, bool &ok, NBNode *recordError=0, double straightThresh=DEG2RAD(5))
get bezier control points
std::vector< std::string > prevSidewalks
the lane-id of the previous sidewalk lane or ""
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
bool valid
whether this crossing is valid (and can be written to the net.xml). This is needed for netedit becaus...
std::vector< std::string > nextSidewalks
the lane-id of the next sidewalk lane or ""
bool isSimpleContinuation(bool checkLaneNumbers=true) const
check if node is a simple continuation
void reshiftPosition(double xoff, double yoff)
Applies an offset to the node.
void remapRemoved(NBTrafficLightLogicCont &tc, NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
remap removed
PositionVector shape
The polygonal shape.
A storage for available types of edges.
double width
This lane's width.
bool forbidsPedestriansAfter(std::vector< std::pair< NBEdge *, bool > > normalizedLanes, int startIndex)
return whether there is a non-sidewalk lane after the given index;
EdgeVector edgesBetween(const NBEdge *e1, const NBEdge *e2) const
return all edges that lie clockwise between the given edges
static std::string getNodeIDFromInternalLane(const std::string id)
returns the node id for internal lanes, crossings and walkingareas