![]() |
SUMO - Simulation of Urban MObility
|
Instance responsible for building networks. More...
#include <NBNetBuilder.h>
Data Structures | |
class | by_id_sorter |
Sorts nodes by their ids. More... | |
Public Member Functions | |
void | applyOptions (OptionsCont &oc) |
Initialises the storage by applying given options. More... | |
void | compute (OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool mayAddOrRemove=true) |
Performs the network building steps. More... | |
void | computeSingleNode (NBNode *node, OptionsCont &oc, const std::set< std::string > &explicitTurnarounds=std::set< std::string >(), bool mayAddOrRemove=true) |
Performs the network building steps only for a single Node. More... | |
void | haveLoadedNetworkWithoutInternalEdges () |
notify about style of loaded network (Without internal edges More... | |
bool | haveNetworkCrossings () |
notify about style of loaded network (Without Crossings) More... | |
NBNetBuilder () | |
Constructor. More... | |
~NBNetBuilder () | |
Destructor. More... | |
Retrieval of subcontainers | |
Returns a reference to edge container | |
NBEdgeCont & | getEdgeCont () |
NBNodeCont & | getNodeCont () |
Returns a reference to the node container. More... | |
NBTypeCont & | getTypeCont () |
Returns a reference to the type container. More... | |
NBTrafficLightLogicCont & | getTLLogicCont () |
Returns a reference to the traffic light logics container. More... | |
NBDistrictCont & | getDistrictCont () |
Returns a reference the districts container. More... | |
NBPTStopCont & | getPTStopCont () |
Returns a reference to the pt stop container. More... | |
Static Public Member Functions | |
static bool | transformCoordinate (Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0) |
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height data (using NBHeightMapper) More... | |
static bool | transformCoordinates (PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0) |
Protected Attributes | |
NBDistrictCont | myDistrictCont |
The used container for districts. More... | |
NBEdgeCont | myEdgeCont |
The used container for edges. More... | |
bool | myHaveLoadedNetworkWithoutInternalEdges |
whether a .net.xml without internal edges was loaded More... | |
bool | myNetworkHaveCrossings |
flag to indicate that network has crossings More... | |
NBNodeCont | myNodeCont |
The used container for nodes. More... | |
NBPTStopCont | myPTStopCont |
The used container for pt stops. More... | |
NBTrafficLightLogicCont | myTLLCont |
The used container for traffic light logics. More... | |
NBTypeCont | myTypeCont |
The used container for street types. More... | |
Private Member Functions | |
void | mirrorX () |
mirror the network along the X-axis More... | |
void | moveToOrigin (GeoConvHelper &geoConvHelper, bool lefthand) |
shift network so its lower left corner is at 0,0 More... | |
NBNetBuilder (const NBNetBuilder &s) | |
invalidated copy constructor More... | |
NBNetBuilder & | operator= (const NBNetBuilder &s) |
invalidated assignment operator More... | |
Friends | |
class | GNENet |
Instance responsible for building networks.
The class' - and the netbuild module's - functionality is embedded within the compute() method.
Definition at line 114 of file NBNetBuilder.h.
NBNetBuilder::NBNetBuilder | ( | ) |
Constructor.
Definition at line 62 of file NBNetBuilder.cpp.
NBNetBuilder::~NBNetBuilder | ( | ) |
Destructor.
Definition at line 69 of file NBNetBuilder.cpp.
|
private |
invalidated copy constructor
void NBNetBuilder::applyOptions | ( | OptionsCont & | oc | ) |
Initialises the storage by applying given options.
Options, mainly steering the acceptance of edges, are parsed and the according internal variables are set.
[in] | oc | The options container to read options from |
ProcessError | If something fails (message is included) |
Definition at line 73 of file NBNetBuilder.cpp.
References NBTrafficLightLogicCont::applyOptions(), NBEdgeCont::applyOptions(), OptionsCont::getFloat(), OptionsCont::getInt(), OptionsCont::getString(), myEdgeCont, myTLLCont, myTypeCont, parseVehicleClasses(), and NBTypeCont::setDefaults().
Referenced by main().
void NBNetBuilder::compute | ( | OptionsCont & | oc, |
const std::set< std::string > & | explicitTurnarounds = std::set<std::string>() , |
||
bool | mayAddOrRemove = true |
||
) |
Performs the network building steps.
[in] | oc | Container that contains options for building |
[in] | explicitTurnarounds | List of edge ids for which turn-arounds should be added (used by NETEDIT) |
[in] | mayAddOrRemove | whether processing steps which cause nodes and edges to be added or removed shall be triggered (used by netedit) |
ProcessError | (recheck) |
Definition at line 85 of file NBNetBuilder.cpp.
References Boundary::add(), NBNodeCont::addJoinExclusion(), NBEdgeCont::appendTurnarounds(), NBNodeCont::avoidOverlap(), NBNodeCont::begin(), NBEdgeCont::begin(), NBEdgeCont::checkGeometries(), NBEdgeCont::checkGrade(), NBEdgeCont::checkOverlap(), NBEdgeCont::computeEdge2Edges(), NBEdgePriorityComputer::computeEdgePriorities(), NBEdgeCont::computeEdgeShapes(), GeoConvHelper::computeFinal(), NBEdgeCont::computeLanes2Edges(), NBNodeCont::computeLanes2Lanes(), NBEdgeCont::computeLaneShapes(), NBTrafficLightLogicCont::computeLogics(), NBNodeCont::computeLogics(), NBNodeCont::computeNodeShapes(), NBNodeTypeComputer::computeNodeTypes(), NBRampsComputer::computeRamps(), NBTurningDirectionsComputer::computeTurnDirections(), DEG2RAD, NBNodeCont::end(), NBEdgeCont::end(), OptionsCont::exists(), NBEdgeCont::generateStreetSigns(), StringBijection< T >::get(), OptionsCont::getBool(), GeoConvHelper::getConvBoundary(), SysUtils::getCurrentMillis(), OptionsCont::getFloat(), GeoConvHelper::getOffsetBase(), GeoConvHelper::getOrigBoundary(), GeoConvHelper::getProcessing(), NBEdgeCont::getRoundabouts(), OptionsCont::getString(), OptionsCont::getStringVector(), Boundary::getZRange(), NBEdgeCont::guessOpposites(), NBEdgeCont::guessRoundabouts(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), OptionsCont::isDefault(), OptionsCont::isSet(), NBNodeCont::joinJunctions(), NBNodeCont::joinLoadedClusters(), NBNodeCont::joinSimilarEdges(), NBNodeCont::joinTLS(), NBEdgeCont::markRoundabouts(), MAX2(), MIN2(), mirrorX(), moveToOrigin(), myDistrictCont, myEdgeCont, myHaveLoadedNetworkWithoutInternalEdges, myNetworkHaveCrossings, myNodeCont, myPTStopCont, myTLLCont, NBNodeCont::printBuiltNodesStatistics(), NBPTStopCont::process(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, PROGRESS_TIME_MESSAGE, NBEdgeCont::recheckLanes(), NBEdgeCont::recheckPostProcessConnections(), NBEdgeCont::reduceGeometries(), NBNodeCont::remapIDs(), NBEdgeCont::remapIDs(), NBNodeCont::removeIsolatedRoads(), NBNodeCont::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBRequest::reportWarnings(), OptionsCont::resetWritable(), NBNodeCont::retrieve(), OptionsCont::set(), NBNodeCont::setAsTLControlled(), GeoConvHelper::setConvBoundary(), NBTrafficLightLogicCont::setTLControllingInformation(), NBNodesEdgesSorter::sortNodesEdges(), NBEdgeCont::sortOutgoingLanesConnections(), NBEdgeCont::splitGeometry(), toString(), SUMOXMLDefinitions::TrafficLightTypes, WRITE_MESSAGE, WRITE_WARNING, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by GNENet::computeAndUpdate(), and main().
void NBNetBuilder::computeSingleNode | ( | NBNode * | node, |
OptionsCont & | oc, | ||
const std::set< std::string > & | explicitTurnarounds = std::set<std::string>() , |
||
bool | mayAddOrRemove = true |
||
) |
Performs the network building steps only for a single Node.
[in] | oc | Container that contains options for building |
[in] | explicitTurnarounds | List of edge ids for which turn-arounds should be added (used by NETEDIT) |
[in] | mayAddOrRemove | whether processing steps which cause nodes and edges to be added or removed shall be triggered (used by netedit) |
ProcessError | (recheck) |
Definition at line 508 of file NBNetBuilder.cpp.
References Boundary::add(), NBNodeCont::addJoinExclusion(), NBEdgeCont::appendTurnarounds(), NBNode::avoidOverlap(), NBEdgeCont::begin(), NBNode::buildCrossingsAndWalkingAreas(), NBNode::buildInnerEdges(), NBEdgeCont::checkGeometries(), NBEdgeCont::checkGrade(), NBEdgeCont::checkOverlap(), NBEdgeCont::computeEdge2Edges(), NBEdgePriorityComputer::computeEdgePrioritiesSingleNode(), NBEdgeCont::computeEdgeShapes(), GeoConvHelper::computeFinal(), NBEdgeCont::computeLanes2Edges(), NBNode::computeLanes2Lanes(), NBEdgeCont::computeLaneShapes(), NBNode::computeLogic(), NBTrafficLightLogicCont::computeLogics(), NBNode::computeNodeShape(), NBRampsComputer::computeRamps(), NBNodeTypeComputer::computeSingleNodeType(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), DEG2RAD, NBEdgeCont::end(), OptionsCont::exists(), NBEdgeCont::generateStreetSigns(), StringBijection< T >::get(), OptionsCont::getBool(), GeoConvHelper::getConvBoundary(), NBNode::getCrossings(), OptionsCont::getFloat(), NBNode::getPosition(), GeoConvHelper::getProcessing(), NBEdgeCont::getRoundabouts(), OptionsCont::getString(), OptionsCont::getStringVector(), Boundary::getZRange(), NBNode::guessCrossings(), NBEdgeCont::guessOpposites(), NBEdgeCont::guessRoundabouts(), NBEdgeCont::guessSidewalks(), NBNodeCont::guessTLs(), OptionsCont::isDefault(), OptionsCont::isSet(), NBNodeCont::joinJunctions(), NBNodeCont::joinLoadedClusters(), NBNodeCont::joinSimilarEdges(), NBNodeCont::joinTLS(), NBEdgeCont::markRoundabouts(), MAX2(), mirrorX(), moveToOrigin(), myDistrictCont, myEdgeCont, myHaveLoadedNetworkWithoutInternalEdges, myNetworkHaveCrossings, myNodeCont, myPTStopCont, myTLLCont, NBPTStopCont::process(), NBEdgeCont::recheckLanes(), NBEdgeCont::recheckPostProcessConnections(), NBEdgeCont::reduceGeometries(), NBNodeCont::remapIDs(), NBEdgeCont::remapIDs(), NBNodeCont::removeIsolatedRoads(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), OptionsCont::resetWritable(), OptionsCont::set(), NBNodeCont::setAsTLControlled(), GeoConvHelper::setConvBoundary(), NBTrafficLightLogicCont::setTLControllingInformation(), NBNode::sortEdges(), NBEdgeCont::sortOutgoingLanesConnections(), NBEdgeCont::splitGeometry(), toString(), and SUMOXMLDefinitions::TrafficLightTypes.
|
inline |
Returns a reference the districts container.
Definition at line 175 of file NBNetBuilder.h.
References myDistrictCont.
Referenced by NIImporter_SUMO::_loadNetwork(), NIImporter_VISUM::buildDistrictNode(), NBRampsComputer::computeRamps(), GNENet::deleteSingleEdge(), NILoader::load(), NIImporter_DlrNavteq::loadNetwork(), NILoader::loadXML(), NIImporter_VISUM::parse_Connectors(), NIImporter_VISUM::parse_Districts(), NIImporter_VISUM::parse_Lanes(), NIImporter_Vissim::postLoadBuild(), and NWWriter_SUMO::writeNetwork().
|
inline |
Definition at line 155 of file NBNetBuilder.h.
References myEdgeCont.
Referenced by NIImporter_SUMO::_loadNetwork(), NBRampsComputer::computeRamps(), GNENet::deleteSingleEdge(), NIImporter_VISUM::getNamedEdge(), NIImporter_VISUM::getNamedEdgeContinuating(), NIImporter_VISUM::getReversedContinuating(), GNENet::GNENet(), NIImporter_OpenStreetMap::insertEdge(), GNENet::insertEdge(), NILoader::load(), NIImporter_VISUM::load(), NIImporter_RobocupRescue::loadNetwork(), NIImporter_ArcView::loadNetwork(), NIImporter_DlrNavteq::loadNetwork(), NIImporter_MATSim::loadNetwork(), NIImporter_OpenDrive::loadNetwork(), NILoader::loadXML(), main(), NIImporter_ITSUMO::Handler::myEndElement(), NIImporter_VISUM::parse_Connectors(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIImporter_Vissim::postLoadBuild(), NIImporter_OpenStreetMap::reconstructLayerElevation(), GNENet::renameEdge(), NGNet::toNB(), NWWriter_Amitran::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_DlrNavteq::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_XML::writeNetwork(), and NWWriter_SUMO::writeNetwork().
|
inline |
Returns a reference to the node container.
Definition at line 160 of file NBNetBuilder.h.
References myNodeCont.
Referenced by NIImporter_VISUM::buildDistrictNode(), NGEdge::buildNBEdge(), NBRampsComputer::computeRamps(), GNENet::deleteSingleJunction(), NIImporter_VISUM::getNamedNode(), GNENet::GNENet(), NIImporter_OpenStreetMap::insertEdge(), GNENet::insertJunction(), GNENet::joinSelectedJunctions(), NILoader::load(), NIImporter_OpenStreetMap::load(), NIImporter_RobocupRescue::loadNetwork(), NIImporter_ArcView::loadNetwork(), NIImporter_DlrNavteq::loadNetwork(), NIImporter_MATSim::loadNetwork(), NIImporter_OpenDrive::loadNetwork(), NILoader::loadXML(), main(), NIImporter_ITSUMO::Handler::myEndElement(), GNENet::netHasCrossings(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_Nodes(), NIImporter_VISUM::parse_NodesToTrafficLights(), NIImporter_Vissim::postLoadBuild(), NIImporter_OpenStreetMap::reconstructLayerElevation(), GNENet::renameJunction(), GNENet::saveJoined(), NGNet::toNB(), NWWriter_Amitran::writeNetwork(), NWWriter_OpenDrive::writeNetwork(), NWWriter_DlrNavteq::writeNetwork(), NWWriter_MATSim::writeNetwork(), NWWriter_XML::writeNetwork(), and NWWriter_SUMO::writeNetwork().
|
inline |
Returns a reference to the pt stop container.
Definition at line 181 of file NBNetBuilder.h.
References myPTStopCont.
Referenced by NIImporter_OpenStreetMap::insertEdge(), and NWWriter_XML::writeNetwork().
|
inline |
Returns a reference to the traffic light logics container.
Definition at line 170 of file NBNetBuilder.h.
References myTLLCont.
Referenced by NGNode::buildNBNode(), GNENet::getTLLogicCont(), NIImporter_OpenStreetMap::insertEdge(), NILoader::load(), NIImporter_VISUM::load(), NIImporter_OpenStreetMap::load(), NIImporter_DlrNavteq::loadNetwork(), NIImporter_OpenDrive::loadNetwork(), NILoader::loadXML(), NIImporter_Vissim::postLoadBuild(), NWWriter_XML::writeNetwork(), and NWWriter_SUMO::writeNetwork().
|
inline |
Returns a reference to the type container.
Definition at line 165 of file NBNetBuilder.h.
References myTypeCont.
Referenced by NIImporter_SUMO::_loadNetwork(), NGEdge::buildNBEdge(), NIImporter_OpenStreetMap::insertEdge(), NILoader::load(), NIImporter_ArcView::loadNetwork(), NIImporter_DlrNavteq::loadNetwork(), NIImporter_OpenDrive::loadNetwork(), NILoader::loadXML(), NIImporter_VISUM::parse_Edges(), NIImporter_VISUM::parse_Types(), NGNet::toNB(), NWWriter_XML::writeNetwork(), and NWWriter_SUMO::writeNetwork().
|
inline |
notify about style of loaded network (Without internal edges
Definition at line 187 of file NBNetBuilder.h.
References myHaveLoadedNetworkWithoutInternalEdges.
Referenced by NIImporter_SUMO::_loadNetwork().
|
inline |
notify about style of loaded network (Without Crossings)
Definition at line 192 of file NBNetBuilder.h.
References myNetworkHaveCrossings, transformCoordinate(), and transformCoordinates().
Referenced by GNEJunction::rebuildGNECrossings().
|
private |
mirror the network along the X-axis
Definition at line 810 of file NBNetBuilder.cpp.
References NBDistrictCont::begin(), NBNodeCont::begin(), NBEdgeCont::begin(), NBDistrictCont::end(), NBNodeCont::end(), NBEdgeCont::end(), myDistrictCont, myEdgeCont, and myNodeCont.
Referenced by compute(), and computeSingleNode().
|
private |
shift network so its lower left corner is at 0,0
Definition at line 783 of file NBNetBuilder.cpp.
References NBPTStopCont::begin(), NBDistrictCont::begin(), NBNodeCont::begin(), NBEdgeCont::begin(), NBPTStopCont::end(), NBDistrictCont::end(), NBNodeCont::end(), NBEdgeCont::end(), GeoConvHelper::getConvBoundary(), SysUtils::getCurrentMillis(), GeoConvHelper::moveConvertedBy(), myDistrictCont, myEdgeCont, myNodeCont, myPTStopCont, PROGRESS_BEGIN_MESSAGE, PROGRESS_TIME_MESSAGE, Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
Referenced by compute(), and computeSingleNode().
|
private |
invalidated assignment operator
|
static |
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height data (using NBHeightMapper)
[in,out] | from | The coordinate to be transformed |
[in] | includeInBoundary | Whether to patch the convex boundary of the GeoConvHelper default instance |
[in] | from_srs | The spatial reference system of the input coordinate These methods are located outside of GeoConvHelper to avoid linker-dependencies on GDAL for libgeom |
Definition at line 825 of file NBNetBuilder.cpp.
References GeoConvHelper::cartesian2geo(), NBHeightMapper::get(), GeoConvHelper::getProcessing(), NBHeightMapper::getZ(), NBHeightMapper::ready(), GeoConvHelper::usingGeoProjection(), Position::x(), GeoConvHelper::x2cartesian(), and Position::y().
Referenced by NIImporter_SUMO::addJunction(), NIXMLNodesHandler::addNode(), haveNetworkCrossings(), NIImporter_OpenStreetMap::insertEdge(), NIImporter_OpenStreetMap::insertNodeChecking(), NIImporter_ArcView::load(), NIImporter_RobocupRescue::loadNodes(), NIImporter_ITSUMO::Handler::myEndElement(), NIImporter_MATSim::NodesHandler::myStartElement(), NIVissimAbstractEdge::NIVissimAbstractEdge(), NIImporter_VISUM::parse_Districts(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Nodes(), NIImporter_VISUM::parse_Point(), NIImporter_DlrNavteq::NodesHandler::report(), and transformCoordinates().
|
static |
Definition at line 843 of file NBNetBuilder.cpp.
References OptionsCont::getFloat(), OptionsCont::getOptions(), and transformCoordinate().
Referenced by NIImporter_SUMO::addEdge(), NIImporter_SUMO::addLane(), NIImporter_OpenDrive::computeShapes(), haveNetworkCrossings(), NBEdgeCont::ignoreFilterMatch(), NIImporter_OpenStreetMap::insertEdge(), and NIXMLEdgesHandler::tryGetShape().
|
friend |
Definition at line 115 of file NBNetBuilder.h.
|
protected |
The used container for districts.
Definition at line 238 of file NBNetBuilder.h.
Referenced by compute(), computeSingleNode(), getDistrictCont(), mirrorX(), and moveToOrigin().
|
protected |
The used container for edges.
Definition at line 232 of file NBNetBuilder.h.
Referenced by applyOptions(), compute(), computeSingleNode(), getEdgeCont(), mirrorX(), and moveToOrigin().
|
protected |
whether a .net.xml without internal edges was loaded
Definition at line 244 of file NBNetBuilder.h.
Referenced by compute(), computeSingleNode(), and haveLoadedNetworkWithoutInternalEdges().
|
protected |
flag to indicate that network has crossings
Definition at line 247 of file NBNetBuilder.h.
Referenced by compute(), computeSingleNode(), and haveNetworkCrossings().
|
protected |
The used container for nodes.
Definition at line 226 of file NBNetBuilder.h.
Referenced by compute(), computeSingleNode(), getNodeCont(), mirrorX(), and moveToOrigin().
|
protected |
The used container for pt stops.
Definition at line 241 of file NBNetBuilder.h.
Referenced by compute(), computeSingleNode(), getPTStopCont(), and moveToOrigin().
|
protected |
The used container for traffic light logics.
Definition at line 235 of file NBNetBuilder.h.
Referenced by applyOptions(), compute(), computeSingleNode(), and getTLLogicCont().
|
protected |
The used container for street types.
Definition at line 229 of file NBNetBuilder.h.
Referenced by applyOptions(), and getTypeCont().