![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Container for nodes during the netbuilding process. More...
#include <NBNodeCont.h>
Public Types | |
typedef std::pair< NBNode *, double > | NodeAndDist |
typedef std::vector< NodeSet > | NodeClusters |
typedef std::set< NBNode *, ComparatorIdLess > | NodeSet |
Definition of a node cluster container. More... | |
Public Member Functions | |
void | analyzeCluster (NodeSet cluster, std::string &id, Position &pos, bool &hasTLS, TrafficLightType &type, SumoXMLNodeType &nodeType) |
void | clear () |
deletes all nodes More... | |
void | computeLanes2Lanes () |
divides the incoming lanes on outgoing lanes More... | |
void | computeLogics (const NBEdgeCont &ec) |
build the list of outgoing edges and lanes More... | |
void | computeLogics2 (const NBEdgeCont &ec, OptionsCont &oc) |
compute right-of-way logic for all lane-to-lane connections More... | |
void | computeNodeShapes (double mismatchThreshold=-1) |
Compute the junction shape for this node. More... | |
void | discardRailSignals () |
void | discardTrafficLights (NBTrafficLightLogicCont &tlc, bool geometryLike, bool guessSignals) |
std::vector< std::string > | getAllNames () const |
get all node names More... | |
std::string | getFreeID () |
generates a new node ID More... | |
const std::vector< std::set< std::string > > & | getJoinedClusters () const |
gets all joined clusters (see doc for myClusters2Join) More... | |
void | markAsSplit (const NBNode *node) |
mark a node as being created form a split More... | |
NBNodeCont () | |
Constructor. More... | |
void | printBuiltNodesStatistics () const |
Prints statistics about built nodes. More... | |
void | registerJoinedCluster (const NodeSet &cluster) |
gets all joined clusters (see doc for myClusters2Join) More... | |
int | remapIDs (bool numericaIDs, bool reservedIDs, const std::string &prefix) |
remap node IDs accoring to options –numerical-ids and –reserved-ids More... | |
void | rename (NBNode *node, const std::string &newID) |
Renames the node. Throws exception if newID already exists. More... | |
int | size () const |
Returns the number of nodes stored in this container. More... | |
bool | wasRemoved (std::string id) const |
Returns whether the node with the id was deleted explicitly. More... | |
~NBNodeCont () | |
Destructor. More... | |
Insertion/removal/retrieval of nodes | |
bool | insert (const std::string &id, const Position &position, NBDistrict *district=0) |
Inserts a node into the map. More... | |
bool | insert (NBNode *node) |
Inserts a node into the map. More... | |
bool | erase (NBNode *node) |
Removes the given node, deleting it. More... | |
bool | extract (NBNode *node, bool remember=false) |
Removes the given node but does not delete it. More... | |
NBNode * | retrieve (const std::string &id) const |
Returns the node with the given name. More... | |
NBNode * | retrieve (const Position &position, const double offset=0.) const |
Returns the node with the given coordinates. More... | |
std::map< std::string, NBNode * >::const_iterator | begin () const |
Returns the pointer to the begin of the stored nodes. More... | |
std::map< std::string, NBNode * >::const_iterator | end () const |
Returns the pointer to the end of the stored nodes. More... | |
Methods for for joining nodes | |
void | addJoinExclusion (const std::vector< std::string > &ids, bool check=false) |
void | addCluster2Join (std::set< std::string > cluster, NBNode *node) |
add ids of nodes which shall be joined into a single node More... | |
int | joinLoadedClusters (NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc) |
Joins loaded junction clusters (see NIXMLNodesHandler) More... | |
int | joinJunctions (double maxDist, NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, NBPTStopCont &sc) |
Joins junctions that are very close together. More... | |
void | pruneClusterFringe (NodeSet &cluster) const |
remove geometry-like fringe nodes from cluster More... | |
bool | feasibleCluster (const NodeSet &cluster, const NBEdgeCont &ec, const NBPTStopCont &sc, std::string &reason) const |
determine wether the cluster is not too complex for joining More... | |
bool | reduceToCircle (NodeSet &cluster, int circleSize, NodeSet startNodes, std::vector< NBNode * > cands=std::vector< NBNode * >()) const |
try to find a joinable subset (recursively) More... | |
NBEdge * | shortestEdge (const NodeSet &cluster, const NodeSet &startNodes, const std::vector< NBNode * > &exclude) const |
find closest neighbor for building circle More... | |
Adapting the input | |
void | removeSelfLoops (NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tc) |
Removes self-loop edges (edges where the source and the destination node are the same) More... | |
void | joinSimilarEdges (NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc) |
Joins edges connecting the same nodes. More... | |
void | avoidOverlap () |
fix overlap More... | |
void | removeIsolatedRoads (NBDistrictCont &dc, NBEdgeCont &ec) |
Removes sequences of edges that are not connected with a junction. Simple roads without junctions sometimes remain when converting from OpenStreetMap, but they make no sense. Remaining empty nodes are also deleted. More... | |
void | removeComponents (NBDistrictCont &dc, NBEdgeCont &ec, const int numKeep) |
Checks the network for weak connectivity and removes all but the largest components. The connectivity check is done regardless of edge direction and vclass. More... | |
int | removeUnwishedNodes (NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, NBPTStopCont &sc, NBPTLineCont &lc, NBParkingCont &pc, bool removeGeometryNodes) |
Removes "unwished" nodes. More... | |
Methods for guessing/computing traffic lights | |
void | guessTLs (OptionsCont &oc, NBTrafficLightLogicCont &tlc) |
Guesses which junctions or junction clusters shall be controlled by tls. More... | |
void | joinTLS (NBTrafficLightLogicCont &tlc, double maxdist) |
Builds clusters of tls-controlled junctions and joins the control if possible. More... | |
void | setAsTLControlled (NBNode *node, NBTrafficLightLogicCont &tlc, TrafficLightType type, std::string id="") |
Sets the given node as being controlled by a tls. More... | |
Private Types | |
typedef std::map< std::string, NBNode * > | NodeCont |
Definition of the map of names to nodes. More... | |
Private Member Functions | |
NBNodeCont (const NBNodeCont &s) | |
invalidated copy constructor More... | |
NBNodeCont & | operator= (const NBNodeCont &s) |
invalidated assignment operator More... | |
Helper methods for for joining nodes | |
void | generateNodeClusters (double maxDist, NodeClusters &into) const |
Builds node clusters. More... | |
void | joinNodeClusters (NodeClusters clusters, NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc) |
joins the given node clusters More... | |
void | joinNodeCluster (NodeSet clusters, NBDistrictCont &dc, NBEdgeCont &ec, NBTrafficLightLogicCont &tlc, NBNode *predefined=nullptr) |
Helper methods for guessing/computing traffic lights | |
bool | shouldBeTLSControlled (const NodeSet &c, double laneSpeedThreshold) const |
Returns whethe the given node cluster should be controlled by a tls. More... | |
bool | onlyCrossings (const NodeSet &c) const |
check wheter the set of nodes only contains pedestrian crossings More... | |
bool | customTLID (const NodeSet &c) const |
check wheter the set of nodes contains traffic lights with custom id More... | |
Private Attributes | |
std::vector< std::pair< std::set< std::string >, NBNode * > > | myClusters2Join |
loaded sets of node ids to join (cleared after use) More... | |
NodeCont | myExtractedNodes |
The extracted nodes which are kept for reference. More... | |
int | myInternalID |
The running internal id. More... | |
std::set< std::string > | myJoined |
ids found in loaded join clusters used for error checking More... | |
std::vector< std::set< std::string > > | myJoinedClusters |
sets of node ids which were joined More... | |
std::set< std::string > | myJoinExclusions |
set of node ids which should not be joined More... | |
NodeCont | myNodes |
The map of names to nodes. More... | |
NamedRTree | myRTree |
node positions for faster lookup More... | |
std::set< const NBNode * > | mySplit |
nodes that were created when splitting an edge More... | |
Container for nodes during the netbuilding process.
Definition at line 59 of file NBNodeCont.h.
typedef std::pair<NBNode*, double> NBNodeCont::NodeAndDist |
Definition at line 64 of file NBNodeCont.h.
typedef std::vector<NodeSet> NBNodeCont::NodeClusters |
Definition at line 63 of file NBNodeCont.h.
|
private |
Definition of the map of names to nodes.
Definition at line 364 of file NBNodeCont.h.
typedef std::set<NBNode*, ComparatorIdLess> NBNodeCont::NodeSet |
Definition of a node cluster container.
Definition at line 62 of file NBNodeCont.h.
NBNodeCont::NBNodeCont | ( | ) |
Constructor.
Definition at line 66 of file NBNodeCont.cpp.
NBNodeCont::~NBNodeCont | ( | ) |
|
private |
invalidated copy constructor
void NBNodeCont::addCluster2Join | ( | std::set< std::string > | cluster, |
NBNode * | node | ||
) |
add ids of nodes which shall be joined into a single node
[in] | cluster | The cluster to add |
Definition at line 580 of file NBNodeCont.cpp.
References StringTokenizer::getVector(), myClusters2Join, myJoined, myJoinExclusions, retrieve(), StringUtils::startsWith(), WRITE_ERROR, and WRITE_WARNINGF.
Referenced by NIXMLNodesHandler::addJoinCluster().
void NBNodeCont::addJoinExclusion | ( | const std::vector< std::string > & | ids, |
bool | check = false |
||
) |
Definition at line 564 of file NBNodeCont.cpp.
References myJoined, myJoinExclusions, retrieve(), and WRITE_WARNINGF.
Referenced by NIXMLNodesHandler::addJoinExclusion(), and NBNetBuilder::compute().
void NBNodeCont::analyzeCluster | ( | NodeSet | cluster, |
std::string & | id, | ||
Position & | pos, | ||
bool & | hasTLS, | ||
TrafficLightType & | type, | ||
SumoXMLNodeType & | nodeType | ||
) |
Definition at line 1269 of file NBNodeCont.cpp.
References Position::add(), StringBijection< T >::get(), OptionsCont::getOptions(), joinNamedToString(), Position::mul(), NODETYPE_NOJUNCTION, NODETYPE_PRIORITY, NODETYPE_TRAFFIC_LIGHT, NODETYPE_UNKNOWN, toString(), SUMOXMLDefinitions::TrafficLightTypes, and WRITE_WARNINGF.
Referenced by joinNodeCluster(), GNENet::joinSelectedJunctions(), and joinTLS().
void NBNodeCont::avoidOverlap | ( | ) |
fix overlap
Definition at line 443 of file NBNodeCont.cpp.
References myNodes.
Referenced by NBNetBuilder::compute().
|
inline |
Returns the pointer to the begin of the stored nodes.
Definition at line 115 of file NBNodeCont.h.
References myNodes.
Referenced by NBNetBuilder::compute(), NBNodeTypeComputer::computeNodeTypes(), NBRampsComputer::computeRamps(), NBTurningDirectionsComputer::computeTurnDirections(), NBNetBuilder::mirrorX(), NBNetBuilder::moveToOrigin(), removeUnwishedNodes(), NBTrafficLightLogicCont::setTLControllingInformation(), NBNodesEdgesSorter::sortNodesEdges(), NBNodeTypeComputer::validateRailCrossings(), NWWriter_DlrNavteq::writeConnectedLanes(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_Amitran::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_DlrNavteq::writeProhibitedManoeuvres(), and NWWriter_DlrNavteq::writeTrafficSignals().
void NBNodeCont::clear | ( | ) |
deletes all nodes
Definition at line 1682 of file NBNodeCont.cpp.
References myExtractedNodes, and myNodes.
Referenced by ~NBNodeCont().
void NBNodeCont::computeLanes2Lanes | ( | ) |
divides the incoming lanes on outgoing lanes
Definition at line 1645 of file NBNodeCont.cpp.
References myNodes.
Referenced by NBNetBuilder::compute().
void NBNodeCont::computeLogics | ( | const NBEdgeCont & | ec | ) |
build the list of outgoing edges and lanes
Definition at line 1654 of file NBNodeCont.cpp.
References myNodes.
Referenced by NBNetBuilder::compute().
void NBNodeCont::computeLogics2 | ( | const NBEdgeCont & | ec, |
OptionsCont & | oc | ||
) |
compute right-of-way logic for all lane-to-lane connections
Definition at line 1662 of file NBNodeCont.cpp.
References OptionsCont::getBool(), NBEdgeCont::getRoundabouts(), and myNodes.
Referenced by NBNetBuilder::compute().
void NBNodeCont::computeNodeShapes | ( | double | mismatchThreshold = -1 | ) |
Compute the junction shape for this node.
[in] | mismatchThreshold | The threshold for warning about shapes which are away from myPosition |
Definition at line 1709 of file NBNodeCont.cpp.
References myNodes.
Referenced by NBNetBuilder::compute().
|
private |
check wheter the set of nodes contains traffic lights with custom id
Definition at line 1369 of file NBNodeCont.cpp.
References StringUtils::startsWith().
Referenced by joinTLS().
void NBNodeCont::discardRailSignals | ( | ) |
Definition at line 1850 of file NBNodeCont.cpp.
References NBNode::getPosition(), NBNode::getType(), myNodes, NODETYPE_PRIORITY, NODETYPE_RAIL_SIGNAL, and NBNode::reinit().
Referenced by NILoader::load().
void NBNodeCont::discardTrafficLights | ( | NBTrafficLightLogicCont & | tlc, |
bool | geometryLike, | ||
bool | guessSignals | ||
) |
Definition at line 1820 of file NBNodeCont.cpp.
References NBTrafficLightLogicCont::extract(), NBNode::geometryLike(), NBNode::getControllingTLS(), NBNode::getOutgoingEdges(), NBNode::getPosition(), NBNodeTypeComputer::isRailwayNode(), NBNode::isTLControlled(), myNodes, NODETYPE_RAIL_SIGNAL, NODETYPE_UNKNOWN, NBNode::reinit(), and NBNode::removeTrafficLight().
Referenced by NILoader::load().
|
inline |
Returns the pointer to the end of the stored nodes.
Definition at line 120 of file NBNodeCont.h.
References myNodes.
Referenced by NBNetBuilder::compute(), NBNodeTypeComputer::computeNodeTypes(), NBRampsComputer::computeRamps(), NBTurningDirectionsComputer::computeTurnDirections(), NBNetBuilder::mirrorX(), NBNetBuilder::moveToOrigin(), NBTrafficLightLogicCont::setTLControllingInformation(), NBNodesEdgesSorter::sortNodesEdges(), NBNodeTypeComputer::validateRailCrossings(), NWWriter_DlrNavteq::writeConnectedLanes(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_Amitran::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_SUMO::writeNetwork(), NWWriter_XML::writeNodes(), NWWriter_DlrNavteq::writeNodesUnsplitted(), NWWriter_DlrNavteq::writeProhibitedManoeuvres(), and NWWriter_DlrNavteq::writeTrafficSignals().
bool NBNodeCont::erase | ( | NBNode * | node | ) |
Removes the given node, deleting it.
[in] | node | The node to delete and remove |
Definition at line 137 of file NBNodeCont.cpp.
References extract().
Referenced by joinNodeCluster(), NIVissimEdge::remapOneOfNodes(), removeComponents(), and removeIsolatedRoads().
bool NBNodeCont::extract | ( | NBNode * | node, |
bool | remember = false |
||
) |
Removes the given node but does not delete it.
[in] | node | The node to delete and remove |
[in] | remember | Whether to keep the node for future reference |
Definition at line 148 of file NBNodeCont.cpp.
References Named::getID(), NBNode::getPosition(), myExtractedNodes, myNodes, myRTree, NamedRTree::Remove(), NBNode::removeTrafficLights(), Position::x(), and Position::y().
Referenced by NIXMLNodesHandler::deleteNode(), GNENet::deleteSingleJunction(), erase(), and removeUnwishedNodes().
bool NBNodeCont::feasibleCluster | ( | const NodeSet & | cluster, |
const NBEdgeCont & | ec, | ||
const NBPTStopCont & | sc, | ||
std::string & | reason | ||
) | const |
determine wether the cluster is not too complex for joining
Definition at line 828 of file NBNodeCont.cpp.
References NBPTStopCont::begin(), DEBUGCOND, NBPTStopCont::end(), NBEdge::getAngleAtNode(), NBNode::getEdges(), NBEdge::getFromNode(), NBEdge::getID(), NBEdge::getIncomingEdges(), NBEdge::getLoadedLength(), OptionsCont::getOptions(), NBEdge::getPermissions(), NBEdge::getToNode(), joinNamedToString(), joinToString(), NBEdgeCont::retrieve(), SVC_PASSENGER, and toString().
Referenced by joinJunctions().
|
private |
Builds node clusters.
A node cluster is made up from nodes which are near by (distance<maxDist) and connected.
[in] | maxDist | The maximum distance between two nodes for clustering |
[in,filled] | into The container to store the clusters in |
Definition at line 451 of file NBNodeCont.cpp.
References DEBUGCOND, Position::distanceTo2D(), NBNode::geometryLike(), NBNode::getEdges(), Named::getID(), NBNode::getIncomingEdges(), NBNode::getPosition(), NBNode::getType(), NBNode::hasIncoming(), joinNamedToString(), myNodes, NODETYPE_RAIL_CROSSING, POSITION_EPS, SUMO_const_laneWidth, SVC_PASSENGER, SVC_PEDESTRIAN, SVC_RAIL_CLASSES, and SVC_TRAM.
Referenced by guessTLs(), joinJunctions(), and joinTLS().
std::vector< std::string > NBNodeCont::getAllNames | ( | ) | const |
get all node names
Definition at line 1799 of file NBNodeCont.cpp.
References myNodes.
Referenced by GNENet::initJunctionsAndEdges(), remapIDs(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
std::string NBNodeCont::getFreeID | ( | ) |
|
inline |
gets all joined clusters (see doc for myClusters2Join)
Definition at line 302 of file NBNodeCont.h.
References myJoinedClusters.
Referenced by NWWriter_XML::writeJoinedJunctions().
void NBNodeCont::guessTLs | ( | OptionsCont & | oc, |
NBTrafficLightLogicCont & | tlc | ||
) |
Guesses which junctions or junction clusters shall be controlled by tls.
[in] | oc | The options that steer the guessing process |
[filled] | tlc The traffic lights control into which new traffic light definitions shall be stored |
Definition at line 1386 of file NBNodeCont.cpp.
References OptionsCont::exists(), generateNodeClusters(), NBNode::geometryLike(), StringBijection< T >::get(), OptionsCont::getBool(), NBNode::getControllingTLS(), OptionsCont::getFloat(), Named::getID(), NBNode::getIncomingEdges(), NBEdge::getLength(), OptionsCont::getOptions(), NBNode::getOutgoingEdges(), NBEdge::getPermissions(), NBEdge::getSignalNode(), NBEdge::getSignalOffset(), OptionsCont::getStringVector(), NBEdge::getToNode(), NBNode::getType(), NBTrafficLightLogicCont::insert(), NBNode::isNearDistrict(), NBNodeTypeComputer::isRailwayNode(), OptionsCont::isSet(), NBNode::isTLControlled(), MIN2(), myNodes, NODETYPE_PRIORITY, NODETYPE_RAIL_CROSSING, NBTrafficLightLogicCont::removeFully(), NBNode::removeTrafficLights(), retrieve(), setAsTLControlled(), shouldBeTLSControlled(), SVC_TRAM, toString(), SUMOXMLDefinitions::TrafficLightTypes, NBEdge::UNSPECIFIED_SIGNAL_OFFSET, WRITE_WARNING, and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute().
bool NBNodeCont::insert | ( | const std::string & | id, |
const Position & | position, | ||
NBDistrict * | district = 0 |
||
) |
Inserts a node into the map.
[in] | id | The node's id |
[in] | position | The node's position |
[in] | A | district assigned to the node |
Definition at line 78 of file NBNodeCont.cpp.
References NamedRTree::Insert(), myNodes, myRTree, Position::x(), and Position::y().
Referenced by NIImporter_SUMO::addJunction(), NIImporter_VISUM::buildDistrictNode(), NIVissimEdge::buildNBEdge(), NIVissimNodeCluster::buildNBNode(), NBRampsComputer::buildOffRamp(), NBRampsComputer::buildOnRamp(), NIVissimDistrictConnection::dict_BuildDistrictNodes(), NIVissimEdge::getFromNode(), NIImporter_OpenDrive::getOrBuildNode(), NIVissimEdge::getToNode(), GNENet::insertJunction(), NIImporter_OpenStreetMap::insertNodeChecking(), joinNodeCluster(), NIImporter_ArcView::load(), NIImporter_OpenDrive::loadNetwork(), NIImporter_RobocupRescue::loadNodes(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_Nodes(), NIXMLNodesHandler::processNodeType(), NBEdgeCont::processSplits(), NIVissimEdge::remapOneOfNodes(), NIVissimEdge::resolveSameNode(), NBEdgeCont::splitGeometry(), and NGNet::toNB().
bool NBNodeCont::insert | ( | NBNode * | node | ) |
Inserts a node into the map.
[in] | node | The node to insert |
Definition at line 93 of file NBNodeCont.cpp.
References Named::getID(), NBNode::getPosition(), NamedRTree::Insert(), myNodes, myRTree, Position::x(), and Position::y().
int NBNodeCont::joinJunctions | ( | double | maxDist, |
NBDistrictCont & | dc, | ||
NBEdgeCont & | ec, | ||
NBTrafficLightLogicCont & | tlc, | ||
NBPTStopCont & | sc | ||
) |
Joins junctions that are very close together.
Definition at line 642 of file NBNodeCont.cpp.
References DEBUGCOND, feasibleCluster(), generateNodeClusters(), joinNamedToString(), joinNodeClusters(), myJoinExclusions, pruneClusterFringe(), reduceToCircle(), and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute().
int NBNodeCont::joinLoadedClusters | ( | NBDistrictCont & | dc, |
NBEdgeCont & | ec, | ||
NBTrafficLightLogicCont & | tlc | ||
) |
Joins loaded junction clusters (see NIXMLNodesHandler)
Definition at line 617 of file NBNodeCont.cpp.
References joinNodeCluster(), myClusters2Join, myJoinExclusions, retrieve(), and WRITE_ERROR.
Referenced by NBNetBuilder::compute().
|
private |
Definition at line 1088 of file NBNodeCont.cpp.
References analyzeCluster(), erase(), NBEdgeCont::extract(), OptionsCont::getBool(), NBEdge::getConnections(), NBEdge::getID(), NBNode::getIncomingEdges(), OptionsCont::getOptions(), NBNode::getOutgoingEdges(), NBEdge::getPermissions(), NBNode::getPosition(), NBEdge::getStep(), NBEdge::getToNode(), NBNode::getType(), NBEdgeCont::hasPostProcessConnection(), NBEdge::INIT, insert(), NBTrafficLightLogicCont::insert(), Position::INVALID, NBNode::isTLControlled(), joinNamedToString(), NBEdge::L2L_USER, NODETYPE_UNKNOWN, registerJoinedCluster(), NBNode::reinit(), retrieve(), Parameterised::setParameter(), Position::setx(), Position::sety(), Position::setz(), SVC_PEDESTRIAN, toString(), WRITE_WARNINGF, Position::x(), Position::y(), and Position::z().
Referenced by joinLoadedClusters(), and joinNodeClusters().
|
private |
joins the given node clusters
Definition at line 1079 of file NBNodeCont.cpp.
References joinNodeCluster().
Referenced by joinJunctions().
void NBNodeCont::joinSimilarEdges | ( | NBDistrictCont & | dc, |
NBEdgeCont & | ec, | ||
NBTrafficLightLogicCont & | tlc | ||
) |
Joins edges connecting the same nodes.
[in,opt. | changed] dc The districts container to update |
[in,opt. | changed] ec The edge container to remove the edges from |
[in,opt. | changed] tc The traffic lights container to update |
Definition at line 178 of file NBNodeCont.cpp.
References NBEdge::getLoadedLength(), NBEdge::getPermissions(), NBEdge::getSpeed(), NBEdge::isNearEnough2BeJoined2(), NBEdgeCont::joinSameNodeConnectingEdges(), and myNodes.
Referenced by NBNetBuilder::compute().
void NBNodeCont::joinTLS | ( | NBTrafficLightLogicCont & | tlc, |
double | maxdist | ||
) |
Builds clusters of tls-controlled junctions and joins the control if possible.
[changed] | tlc The traffic lights control for adding/removing new/prior tls | |
[in] | maxdist | The maximum distance between nodes for clustering |
Definition at line 1579 of file NBNodeCont.cpp.
References analyzeCluster(), customTLID(), generateNodeClusters(), IDSupplier::getNext(), NBTrafficLightLogicCont::getPrograms(), NBTrafficLightLogicCont::insert(), NODETYPE_UNKNOWN, onlyCrossings(), NBTrafficLightLogicCont::removeFully(), and WRITE_WARNING.
Referenced by NBNetBuilder::compute().
|
inline |
mark a node as being created form a split
Definition at line 316 of file NBNodeCont.h.
References mySplit.
Referenced by NBEdgeCont::processSplits().
|
private |
check wheter the set of nodes only contains pedestrian crossings
Definition at line 1339 of file NBNodeCont.cpp.
References NBEdge::getIncomingEdges(), and SVC_PEDESTRIAN.
Referenced by joinTLS().
|
private |
invalidated assignment operator
void NBNodeCont::printBuiltNodesStatistics | ( | ) | const |
Prints statistics about built nodes.
Goes through stored nodes, computes the numbers of unregulated, priority and right-before-left junctions and prints them.
Definition at line 1717 of file NBNodeCont.cpp.
References myNodes, NODETYPE_ALLWAY_STOP, NODETYPE_DEAD_END, NODETYPE_DISTRICT, NODETYPE_NOJUNCTION, NODETYPE_PRIORITY, NODETYPE_PRIORITY_STOP, NODETYPE_RAIL_CROSSING, NODETYPE_RAIL_SIGNAL, NODETYPE_RIGHT_BEFORE_LEFT, NODETYPE_TRAFFIC_LIGHT, NODETYPE_TRAFFIC_LIGHT_NOJUNCTION, NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED, NODETYPE_UNKNOWN, NODETYPE_ZIPPER, toString(), and WRITE_MESSAGE.
Referenced by NBNetBuilder::compute().
void NBNodeCont::pruneClusterFringe | ( | NodeSet & | cluster | ) | const |
remove geometry-like fringe nodes from cluster
Definition at line 750 of file NBNodeCont.cpp.
References DEBUGCOND, Position::distanceTo2D(), NBNode::getEdges(), Named::getID(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), NBNode::getPosition(), isRailway(), NBNode::isTLControlled(), joinNamedToString(), MIN2(), SUMO_const_laneWidth, and SVC_PASSENGER.
Referenced by joinJunctions().
bool NBNodeCont::reduceToCircle | ( | NodeSet & | cluster, |
int | circleSize, | ||
NodeSet | startNodes, | ||
std::vector< NBNode * > | cands = std::vector<NBNode*>() |
||
) | const |
try to find a joinable subset (recursively)
Definition at line 1011 of file NBNodeCont.cpp.
References NBEdge::getFromNode(), NBEdge::getToNode(), and shortestEdge().
Referenced by joinJunctions().
void NBNodeCont::registerJoinedCluster | ( | const NodeSet & | cluster | ) |
gets all joined clusters (see doc for myClusters2Join)
Definition at line 1259 of file NBNodeCont.cpp.
References myJoinedClusters.
Referenced by joinNodeCluster(), and GNENet::joinSelectedJunctions().
int NBNodeCont::remapIDs | ( | bool | numericaIDs, |
bool | reservedIDs, | ||
const std::string & | prefix | ||
) |
remap node IDs accoring to options –numerical-ids and –reserved-ids
Definition at line 1861 of file NBNodeCont.cpp.
References getAllNames(), OptionsCont::getBool(), IDSupplier::getNext(), OptionsCont::getOptions(), NBHelpers::loadPrefixedIDsFomFile(), myNodes, rename(), StringUtils::startsWith(), SUMO_PARAM_ORIGID, and StringUtils::toLong().
Referenced by NBNetBuilder::compute().
void NBNodeCont::removeComponents | ( | NBDistrictCont & | dc, |
NBEdgeCont & | ec, | ||
const int | numKeep | ||
) |
Checks the network for weak connectivity and removes all but the largest components. The connectivity check is done regardless of edge direction and vclass.
[in,opt. | changed] dc The district container needed if edges shall be removed | |
[in,opt. | changed] ec The container with the edge to be tested | |
[in] | numKeep | The number of components to keep |
Definition at line 311 of file NBNodeCont.cpp.
References NBEdgeCont::begin(), NBEdgeCont::end(), NBEdgeCont::erase(), erase(), NBEdgeCont::getByID(), NBEdge::getFromNode(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), and NBEdge::getToNode().
Referenced by NBNetBuilder::compute().
void NBNodeCont::removeIsolatedRoads | ( | NBDistrictCont & | dc, |
NBEdgeCont & | ec | ||
) |
Removes sequences of edges that are not connected with a junction. Simple roads without junctions sometimes remain when converting from OpenStreetMap, but they make no sense. Remaining empty nodes are also deleted.
[in,opt. | changed] dc The district container needed if edges shall be removed |
[in,opt. | changed] ec The container with the edge to be tested |
Definition at line 223 of file NBNodeCont.cpp.
References NBEdgeCont::erase(), erase(), NBEdgeCont::getAllNames(), NBEdge::getFromNode(), NBEdge::getID(), NBNode::getIncomingEdges(), NBNode::getOutgoingEdges(), NBEdge::getToNode(), NBEdgeCont::retrieve(), and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute().
void NBNodeCont::removeSelfLoops | ( | NBDistrictCont & | dc, |
NBEdgeCont & | ec, | ||
NBTrafficLightLogicCont & | tc | ||
) |
Removes self-loop edges (edges where the source and the destination node are the same)
[in,opt. | changed] dc The districts container to update |
[in,opt. | changed] ec The edge container to remove the edges from |
[in,opt. | changed] tc The traffic lights container to update |
Definition at line 166 of file NBNodeCont.cpp.
References myNodes, toString(), and WRITE_WARNING.
Referenced by NBNetBuilder::compute().
int NBNodeCont::removeUnwishedNodes | ( | NBDistrictCont & | dc, |
NBEdgeCont & | ec, | ||
NBTrafficLightLogicCont & | tlc, | ||
NBPTStopCont & | sc, | ||
NBPTLineCont & | lc, | ||
NBParkingCont & | pc, | ||
bool | removeGeometryNodes | ||
) |
Removes "unwished" nodes.
Removes nodes if a) no incoming/outgoing edges exist or b) if the node is a "geometry" node. In the second case, edges that participate at the node will be joined. Whether the node is a geometry node or not, is determined by a call to NBNode::checkIsRemovable. The node is removed from the list of tls-controlled nodes.
[in,opt. | changed] dc The district container needed if a node shall be removed | |
[in,opt. | changed] ec The edge container needed for joining edges | |
[in,opt. | changed] tlc The traffic lights container to remove nodes from | |
[in] | removeGeometryNodes | Whether geometry nodes shall also be removed |
Definition at line 369 of file NBNodeCont.cpp.
References NBParkingCont::addEdges2Keep(), NBPTStopCont::addEdges2Keep(), begin(), NBNode::checkIsRemovable(), NBEdgeCont::extract(), extract(), NBNode::getEdges(), NBNode::getEdgesToJoin(), NBNode::getIncomingEdges(), OptionsCont::getOptions(), NBNode::getOutgoingEdges(), OptionsCont::getString(), OptionsCont::getStringVector(), NBEdge::getToNode(), OptionsCont::isSet(), NBHelpers::loadEdgesFromFile(), myNodes, mySplit, NBNode::replaceIncoming(), NBTrafficLightLogicCont::replaceRemoved(), and UNUSED_PARAMETER.
Referenced by NBNetBuilder::compute().
void NBNodeCont::rename | ( | NBNode * | node, |
const std::string & | newID | ||
) |
Renames the node. Throws exception if newID already exists.
Definition at line 1809 of file NBNodeCont.cpp.
References Named::getID(), myNodes, and Named::setID().
Referenced by remapIDs(), and GNENet::renameJunction().
Returns the node with the given coordinates.
[in] | position | The position at which the node to retrieve lies |
[in] | offset | An offset which can be applied in the case positions are blurred |
Definition at line 117 of file NBNodeCont.cpp.
References NBNode::getPosition(), myNodes, myRTree, POSITION_EPS, NamedRTree::Search(), Position::x(), and Position::y().
NBNode * NBNodeCont::retrieve | ( | const std::string & | id | ) | const |
Returns the node with the given name.
[in] | id | The id of the node to retrieve |
Definition at line 107 of file NBNodeCont.cpp.
References myNodes.
Referenced by NIImporter_SUMO::_loadNetwork(), addCluster2Join(), NIXMLConnectionsHandler::addCrossing(), addJoinExclusion(), NIXMLNodesHandler::addNode(), NIXMLEdgesHandler::addSplit(), NIVissimDisturbance::addToNode(), NIImporter_VISUM::buildDistrictNode(), NGEdge::buildNBEdge(), NBNetBuilder::compute(), NIXMLNodesHandler::deleteNode(), NIVissimNodeCluster::dict_addDisturbances(), NIVissimDistrictConnection::dict_BuildDistricts(), getFreeID(), NIImporter_VISUM::getNamedNode(), NIImporter_VISUM::getNamedNodeSecure(), NIImporter_OpenDrive::getOrBuildNode(), guessTLs(), GNENet::initJunctionsAndEdges(), NIImporter_OpenStreetMap::insertNodeChecking(), joinLoadedClusters(), joinNodeCluster(), NIImporter_ArcView::load(), NIImporter_RobocupRescue::loadEdges(), NIImporter_OpenDrive::loadNetwork(), NIImporter_VISUM::parse_NodesToTrafficLights(), NIImporter_OpenStreetMap::reconstructLayerElevation(), NIVissimEdge::resolveSameNode(), NIXMLEdgesHandler::setNodes(), NIImporter_OpenDrive::setNodeSecure(), NBEdgeCont::splitGeometry(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
void NBNodeCont::setAsTLControlled | ( | NBNode * | node, |
NBTrafficLightLogicCont & | tlc, | ||
TrafficLightType | type, | ||
std::string | id = "" |
||
) |
Sets the given node as being controlled by a tls.
[in] | node | The node that shall be controlled by a tls |
[in] | tlc | The traffic lights control into which the new traffic light definition shall be stored |
[in] | type | The type of the new tls |
[in] | id | The id of the tls to add |
Definition at line 1628 of file NBNodeCont.cpp.
References Named::getID(), NBTrafficLightLogicCont::insert(), and WRITE_WARNINGF.
Referenced by NBNetBuilder::compute(), and guessTLs().
NBEdge * NBNodeCont::shortestEdge | ( | const NodeSet & | cluster, |
const NodeSet & | startNodes, | ||
const std::vector< NBNode * > & | exclude | ||
) | const |
find closest neighbor for building circle
Definition at line 1058 of file NBNodeCont.cpp.
References Position::distanceTo2D(), and NBNode::getPosition().
Referenced by reduceToCircle().
|
private |
Returns whethe the given node cluster should be controlled by a tls.
[in] | c | The node cluster |
[in] | laneSpeedThreshold | threshold for determining whether a node or cluster should be tls controlled |
Definition at line 1311 of file NBNodeCont.cpp.
Referenced by guessTLs().
|
inline |
Returns the number of nodes stored in this container.
Definition at line 263 of file NBNodeCont.h.
References myNodes.
Referenced by NILoader::load(), main(), NWWriter_OpenDrive::writeNetwork(), and NWWriter_DlrNavteq::writeNodesUnsplitted().
|
inline |
Returns whether the node with the id was deleted explicitly.
Definition at line 245 of file NBNodeCont.h.
References myExtractedNodes.
Referenced by NIXMLConnectionsHandler::addCrossing().
|
private |
loaded sets of node ids to join (cleared after use)
Definition at line 376 of file NBNodeCont.h.
Referenced by addCluster2Join(), and joinLoadedClusters().
|
private |
The extracted nodes which are kept for reference.
Definition at line 370 of file NBNodeCont.h.
Referenced by clear(), extract(), and wasRemoved().
|
private |
The running internal id.
Definition at line 361 of file NBNodeCont.h.
|
private |
ids found in loaded join clusters used for error checking
Definition at line 382 of file NBNodeCont.h.
Referenced by addCluster2Join(), and addJoinExclusion().
|
private |
sets of node ids which were joined
Definition at line 379 of file NBNodeCont.h.
Referenced by getJoinedClusters(), and registerJoinedCluster().
|
private |
set of node ids which should not be joined
Definition at line 373 of file NBNodeCont.h.
Referenced by addCluster2Join(), addJoinExclusion(), joinJunctions(), and joinLoadedClusters().
|
private |
The map of names to nodes.
Definition at line 367 of file NBNodeCont.h.
Referenced by avoidOverlap(), begin(), clear(), computeLanes2Lanes(), computeLogics(), computeLogics2(), computeNodeShapes(), discardRailSignals(), discardTrafficLights(), end(), extract(), generateNodeClusters(), getAllNames(), guessTLs(), insert(), joinSimilarEdges(), printBuiltNodesStatistics(), remapIDs(), removeSelfLoops(), removeUnwishedNodes(), rename(), retrieve(), and size().
|
private |
node positions for faster lookup
Definition at line 388 of file NBNodeCont.h.
Referenced by extract(), insert(), and retrieve().
|
private |
nodes that were created when splitting an edge
Definition at line 385 of file NBNodeCont.h.
Referenced by markAsSplit(), and removeUnwishedNodes().