/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file NBEdgeCont.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Tue, 20 Nov 200118///19// Storage for edges, including some functionality operating on multiple edges20/****************************************************************************/21#pragma once22#include <config.h>2324#include <map>25#include <iostream>26#include <string>27#include <vector>28#include <set>29#include "NBCont.h"30#include <utils/common/SUMOVehicleClass.h>31#include <utils/common/UtilExceptions.h>32#include <utils/geom/PositionVector.h>33#include <utils/common/NamedRTree.h>343536// ===========================================================================37// class declarations38// ===========================================================================39class OptionsCont;40class OutputDevice;41class NBNodeCont;42class NBTypeCont;43class NBEdge;44class NBNode;45class NBDistrictCont;46class NBTrafficLightLogicCont;47class NBPTStopCont;48class NBPTLineCont;495051// ===========================================================================52// class definitions53// ===========================================================================54/**55* @class NBEdgeCont56* @brief Storage for edges, including some functionality operating on multiple edges57*/58class NBEdgeCont {5960public:61/** @brief Constructor62* @param[in] tc The net builded; used to obtain types63*/64NBEdgeCont(NBTypeCont& tc);6566/// @brief Destructor67~NBEdgeCont();6869/** @brief Initialises the storage by applying given options70*71* Options, mainly steering the acceptance of edges, are parsed72* and the according internal variables are set.73*74* @param[in] oc The options container to read options from75* @todo Recheck exceptions76*/77void applyOptions(OptionsCont& oc);7879/** @brief Deletes all edges */80void clear();8182/// @name edge access methods83/// @{8485/** @brief Adds an edge to the dictionary86*87* First, it is determined whether the edge shall not be discarded due to any88* reasons (being outside a boundary, or not in the optional list of edges to89* import, etc.). If so, the edge is deleted and "true" is returned.90* "true" is also returned if the edge is accepted - no edge with the same91* name exists within this container. If another edge with the same name92* exists, false is returned.93*94* @param[in] edge The edge to add95* @param[in] ignorePrunning Whether this edge must not be prunned96* @return Whether the edge was valid (no edge with the same id is already known)97*/98bool insert(NBEdge* edge, bool ignorePrunning = false);99100/** @brief Returns the edge that has the given id101*102* If no edge that has the given id is known, 0 is returned.103*104* @param[in] id The id of the edge to retrieve105* @param[in] bool Whether extracted edges shall be retrieved as well106* @return The edge with the given id, 0 if no such edge exists107*/108NBEdge* retrieve(const std::string& id, bool retrieveExtracted = false) const;109110/** @brief Tries to retrieve an edge, even if it is splitted111*112* The edge given with the id should exist and is followed downstream or upstream,113* depending on the parameter to the last edge still starting with the id.114*115* @param[in] id The id of the edge to retrieve116* @param[in] downstream search direction117* @return The searched edge118* @todo Recheck usage119*/120NBEdge* retrievePossiblySplit(const std::string& id, bool downstream) const;121122/** @brief Tries to retrieve an edge, even if it is splitted123*124* To describe which part of the edge shall be returned, the125* id of a second edge, participating at the node and the information126* whether to return the outgoing or the incoming is needed.127*128* @param[in] id The id of the edge to retrieve129* @param[in] hint An additional information which helps to retrieve the correct edge130* @param[in] incoming Whether the edge to find is an incoming edge at the node "hint" participates131* @return The searched edge132* @todo Recheck usage133*/134NBEdge* retrievePossiblySplit(const std::string& id, const std::string& hint, bool incoming) const;135136/** @brief Tries to retrieve an edge, even if it is splitted137*138* To describe which part of the edge shall be returned, a139* position hint is supplied.140*141* @param[in] id The id of the edge to retrieve142* @param[in] pos An additional about the position of the basic edge's subpart143* @return The searched edge144* @todo Recheck usage145*/146NBEdge* retrievePossiblySplit(const std::string& id, double pos) const;147148/** @brief Removes the given edge from the container (deleting it)149*150* @param[in] dc The district container, in order to remove the edge from sources/sinks151* @param[in] edge The edge to remove152* @todo Recheck whether the district cont is needed - if districts are processed using an external tool153*/154void erase(NBDistrictCont& dc, NBEdge* edge);155156/** @brief Removes the given edge from the container like erase but does not157* delete it158*159* @param[in] dc The district container, in order to remove the edge from sources/sinks160* @param[in] edge The edge to remove161* @param[in] remember Whether to keep this edge for future reference162* @todo Recheck whether the district cont is needed - if districts are processed using an external tool163* @todo Recheck whether this is used at all and why164*/165void extract(NBDistrictCont& dc, NBEdge* edge, bool remember = false);166167/** @brief Returns the pointer to the begin of the stored edges168* @return The iterator to the beginning of stored edges169*/170std::map<std::string, NBEdge*>::const_iterator begin() const {171return myEdges.begin();172}173174/** @brief Returns the pointer to the end of the stored edges175* @return The iterator to the end of stored edges176*/177std::map<std::string, NBEdge*>::const_iterator end() const {178return myEdges.end();179}180/// @}181182/// @name explicit edge manipulation methods183/// @{184185/** @struct Split186* @brief A structure which describes changes of lane number or speed along the road187*/188struct Split {189/// @brief The lanes after this change190std::vector<int> lanes;191/// @brief The position of this change192double pos = INVALID_DOUBLE;193/// @brief The speed after this change194double speed = INVALID_DOUBLE;195/// @brief The friction after this change196double friction = INVALID_DOUBLE;197/// @brief The new node that is created for this split198NBNode* node = nullptr;199/// @brief The id for the edge before the split200std::string idBefore;201/// @brief The id for the edge after the split202std::string idAfter;203/// @brief the default node id204std::string nameID;205/// @brief lateral offset to edge geometry206double offset = 0.;207/// @brief direction in which to apply the offset (used by netgenerate for lefthand networks)208int offsetFactor = 1;209};210211/// @brief process splits212void processSplits(NBEdge* e, std::vector<Split> splits,213NBNodeCont& nc, NBDistrictCont& dc, NBTrafficLightLogicCont& tlc);214215/** @brief Splits the edge at the position nearest to the given node216*217* Uses "splitAt(NBDistrictCont &, NBEdge *, NBNode *, const std::string &, const std::string &, int , int)"218* to perform the split; the edge names are built by appending "[0]" and "[1]",219* respectively. Both edges will have the same number of lanes.220*221* @param[in] dc The district container, in order to remove/add the edge from/to sources/sinks222* @param[in] edge The edge to split223* @param[in] node The node to split the edge at224* @return Whether the edge could be split225* @exception ProcessError If connections between the edges can not be built226* @see NBEdge::splitAt(NBDistrictCont &, NBEdge *, NBNode *, const std::string &, const std::string &, int , int)227*/228bool splitAt(NBDistrictCont& dc, NBEdge* edge, NBNode* node);229230/** @brief Splits the edge at the position nearest to the given node using the given modifications231*232* Determines the position of the split by finding the nearest position on the233* edge to the given node. If this position is too near to the edges begin/end,234* false is returned.235*236* Otherwise, "splitAt(NBDistrictCont &, NBEdge *, double, NBNode *, const std::string &, const std::string &, int , int)"237* is used to perform the split.238*239* @param[in] nb The net builder containing all nodes, edges etc.240* @param[in] edge The edge to split241* @param[in] node The node to split the edge at242* @param[in] firstEdgeName The id the first part of the split edge shall have243* @param[in] secondEdgeName The id the second part of the split edge shall have244* @param[in] noLanesFirstEdge The number of lanes the second part of the split edge shall have245* @param[in] noLanesSecondEdge The number of lanes the second part of the split edge shall have246* @param[in] speed The speed for the edge after the split247* @param[in] friction The friction for the edge after the split248* @param[in] changedLeft The number of lanes that is added or removed on the left side of the edge249* (By default all added/removed lanes are assumed to be on the right when computing connections)250* @return Whether the edge could be split251* @exception ProcessError If connections between the edges can not be built252* @see NBEdge::splitAt(NBDistrictCont &, NBEdge *, double, NBNode *, const std::string &, const std::string &, int , int)253*/254bool splitAt(NBDistrictCont& dc, NBEdge* edge, NBNode* node,255const std::string& firstEdgeName, const std::string& secondEdgeName,256int noLanesFirstEdge, int noLanesSecondEdge,257const double speed = -1., const double friction = 1., const int changedLeft = 0);258259/** @brief Splits the edge at the position nearest to the given node using the given modifications260*261* @param[in] dc The district container, in order to remove/add the edge from/to sources/sinks262* @param[in] edge The edge to split263* @param[in] node The node to split the edge at264* @param[in] firstEdgeName The id the first part of the split edge shall have265* @param[in] secondEdgeName The id the second part of the split edge shall have266* @param[in] noLanesFirstEdge The number of lanes the second part of the split edge shall have267* @param[in] noLanesSecondEdge The number of lanes the second part of the split edge shall have268* @param[in] speed The speed for the edge after the split269* @param[in] changedLeft The number of lanes that is added or removed on the left side of the edge270* (By default all added/removed lanes are assumed to be on the right when computing connections)271* @return Whether the edge could be split272* @exception ProcessError If connections between the edges can not be built273*/274bool splitAt(NBDistrictCont& dc, NBEdge* edge, double edgepos, NBNode* node,275const std::string& firstEdgeName, const std::string& secondEdgeName,276int noLanesFirstEdge, int noLanesSecondEdge,277const double speed = -1., const double friction = 1., const int changedLeft = 0);278/// @}279280/// @name container access methods281/// @{282283/** @brief Returns the number of edges284* @return The number of edges stored in this container285*/286int size() const {287return (int) myEdges.size();288}289290/** @brief Returns all ids of known edges291* @return All ids of known edges292* @todo Recheck usage, probably, filling a given vector would be better...293*/294std::vector<std::string> getAllNames() const;295296/** @brief Returns the edge split if the edge has been split, nullptr otherwise297* @return the pair of edges after the split298*/299const std::pair<NBEdge*, NBEdge*>* getSplit(const NBEdge* const origEdge) const {300const auto& split = myEdgesSplit.find(origEdge);301if (split == myEdgesSplit.end()) {302return nullptr;303}304return &split->second;305}306307NBEdge* getSplitBase(const std::string& edgeID) const;308309/** @brief Returns the number of edge splits310* @return How often an edge was split311*/312int getNumEdgeSplits() const {313return (int)myEdgesSplit.size();314}315/// @}316317/// @name Adapting the input318/// @{319320/** @brief Removes unwished edges (not in keep-edges)321* @param[in, opt. changed] dc The district container needed to remove edges322* @todo Recheck usage; check whether keep-edges.postload is really useful323* @return The number of removed edges324*/325int removeUnwishedEdges(NBDistrictCont& dc);326327/** @brief Splits edges into multiple if they have a complex geometry328*329* Calls "NBEdge::splitGeometry" for all edges within the container which330* have more than three positions in their geometry.331*332* @param[in] nc The node container needed to build (geometry) nodes333* @see NBEdge::splitGeometry334*/335void splitGeometry(NBDistrictCont& dc, NBNodeCont& nc);336337/** @brief338* @param[in] nc The node container needed to build (geometry) nodes339* @see NBEdge::reduceGeometry340*/341void reduceGeometries(const double minDist);342343/** @brief344* @param[in] maxAngle The maximum geometry angle allowed345* @param[in] minRadius The minimum turning radius allowed at the start and end346* @param[in] fix Whether to prune geometry points to avoid sharp turns at start and end347* @see NBEdge::checkGeometry348*/349void checkGeometries(const double maxAngle, bool fixAngle, const double minRadius, bool fix, bool fixRailways, bool silent = false);350/// @}351352/// @name processing methods353/// @{354355/** @brief Sorts all lanes of all edges within the container by their direction356*357* Calls "NBEdge::sortOutgoingLanesConnections" for all edges within the container.358*359* @todo Recheck whether a visitor-pattern should be used herefor360* @see NBEdge::sortOutgoingLanesConnections361*/362void sortOutgoingLanesConnections();363364/** @brief Computes for each edge the approached edges365*366* Calls "NBEdge::computeEdge2Edges" for all edges within the container.367*368* @param[in] noLeftMovers Whether left-moving connections shall be omitted369* @todo Recheck whether a visitor-pattern should be used herefor370* @see NBEdge::computeEdge2Edges371*/372void computeEdge2Edges(bool noLeftMovers);373374/** @brief Computes for each edge which lanes approach the next edges375*376* Calls "NBEdge::computeLanes2Edges" for all edges within the container.377*378* @todo Recheck whether a visitor-pattern should be used herefor379* @see NBEdge::computeLanes2Edges380*/381void computeLanes2Edges();382383/** @brief Rechecks whether all lanes have a successor for each of the stored edges384*385* Calls "NBEdge::recheckLanes" for all edges within the container.386*387* @todo Recheck whether a visitor-pattern should be used herefor388* @see NBEdge::recheckLanes389*/390void recheckLanes();391392/** @brief Appends turnarounds to all edges stored in the container393*394* Calls "NBEdge::appendTurnaround" for all edges within the container.395*396* @param[in] noTLSControlled Whether the turnaround shall not be connected if the edge is controlled by a tls397* @param[in] noFringe Whether the turnaround shall not be connected if the junction is at the (outer) fringe398* @param[in] onlyDeadends Whether the turnaround shall only be built at deadends399* @param[in] onlyTurnlane Whether the turnaround shall only be built when there is an exclusive (left) turn lane400* @param[in] noGeometryLike Whether the turnaround shall be built at geometry-like nodes401* @see NBEdge::appendTurnaround402*/403void appendTurnarounds(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike);404405/** @brief Appends turnarounds to all edges stored in the container406* Calls "NBEdge::appendTurnaround" for edges with the given ids407* @param[in] ids The list of ids for which to append a turnaround408* @param[in] noTLSControlled Whether the turnaround shall not be connected if the edge is controlled by a tls409* @see NBEdge::appendTurnaround410*/411void appendTurnarounds(const std::set<std::string>& ids, bool noTLSControlled);412413/// @brief Appends turnarounds to all bidiRail edges with stops414void appendRailwayTurnarounds(const NBPTStopCont& sc);415416/** @brief Computes the shapes of all edges stored in the container417*418* Calls "NBEdge::computeEdgeShape" for all edges within the container.419*420* @todo Recheck whether a visitor-pattern should be used herefor421* @todo Recheck usage422* @see NBEdge::computeEdgeShape423*/424void computeEdgeShapes(double smoothElevationThreshold = -1);425426/** @brief Computes the shapes of all lanes of all edges stored in the container427*428* Calls "NBEdge::computeLaneShapes" for all edges within the container.429*430* @todo Recheck whether a visitor-pattern should be used herefor431* @todo Recheck usage432* @see NBEdge::computeLaneShapes433*/434void computeLaneShapes();435436/// @brief Clears information about controlling traffic lights for all connenections of all edges437void clearControllingTLInformation() const;438439/** @brief Joins the given edges because they connect the same nodes440*441* @param[in] dc The district container needed to remove edges442* @param[in] tlc The tls container needed to remove edges443* @param[in] edges The edges to join444* @todo Recheck and describe usage445*/446void joinSameNodeConnectingEdges(NBDistrictCont& dc,447NBTrafficLightLogicCont& tlc, EdgeVector edges);448449/// @brief Sets opposite lane information for geometrically close edges450void guessOpposites();451452/** @brief Rechecks whether the lane spread is proper453*454* @todo Recheck usage; check whether this is really needed and whether it works at all455*/456void recheckLaneSpread();457458/// @}459460/// @brief Returns the edge with negated id if it exists461NBEdge* getOppositeByID(const std::string& edgeID) const;462463/// @brief Returns the edge with id if it exists464NBEdge* getByID(const std::string& edgeID) const;465466/** @brief Determines which edges belong to roundabouts and increases their priority467* @return The number of guessed roundabouts468*/469int guessRoundabouts();470471/** @brief Determines which edges have been marked as roundabouts and stores them internally472* @return The number of found roundabouts473*/474int extractRoundabouts();475476// brief ensure myRoundabouts only holds valid edges477void cleanupRoundabouts();478479/** @brief Returns whether the edge with the id was ignored during parsing480* @return Whether the edge with the id was ignored during parsing481*/482bool wasIgnored(std::string id) const {483return myIgnoredEdges.count(id) != 0;484}485486/// @brief mark the given edge id as ignored487void ignore(std::string id) {488myIgnoredEdges.insert(id);489}490491/// @brief Returns whether the edge with the id was deleted explicitly492bool wasRemoved(std::string id) const {493return myExtractedEdges.count(id) != 0;494}495496/// @brief Renames the edge. Throws exception if newID already exists497void rename(NBEdge* edge, const std::string& newID);498499/// @name Connections handling500/// @{501502/** @brief Adds a connection which could not be set during loading503* @param[in] from The id of the edge the connection starts at504* @param[in] fromLane The number of the lane the connection starts at505* @param[in] to The id of the edge the connection ends at506* @param[in] toLane The number of the lane the connection ends at507* @param[in] mayDefinitelyPass Whether the connection may be passed without braking508* @param[in] keepClear Whether the connection must check to keep the junction clear509* @param[in] contPos Custom position for internal junction510* @param[in] visibility Custom foe visiblity connection511* @param[in] speed Custom speed512* @param[in] friction Custom friction513* @param[in] customShape Custom shape514* @param[in] warnOnly Whether a failure to set this connection should only result in a warning515*/516void addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass,517KeepClear keepClear, double contPos, double visibility,518double speed, double friction, double length,519const PositionVector& customShape,520bool uncontrolled,521bool warnOnly,522SVCPermissions permissions = SVC_UNSPECIFIED,523bool indirectLeft = false,524const std::string& edgeType = "",525SVCPermissions changeLeft = SVC_UNSPECIFIED,526SVCPermissions changeRight = SVC_UNSPECIFIED);527528/// @brief add post process connections529bool hasPostProcessConnection(const std::string& from, const std::string& to = "");530531/// @brief Try to set any stored connections532void recheckPostProcessConnections();533/// @}534535/// @brief assigns street signs to edges based on toNode types536void generateStreetSigns();537538/// @brief add sidwalks to edges within the given limits or permissions and return the number of edges affected539int guessSpecialLanes(SUMOVehicleClass svc, double width, double minSpeed, double maxSpeed, bool fromPermissions, const std::string& excludeOpt,540NBTrafficLightLogicCont& tlc);541542/** @brief Returns the determined roundabouts543* @return The list of roundabout edges544*/545const std::set<EdgeSet> getRoundabouts() const;546547/// @brief check if there is guessed roundabouts548bool hasGuessedRoundabouts() const {549return myGuessedRoundabouts.size() > 0;550}551552/// @brief add user specified roundabout553void addRoundabout(const EdgeSet& roundabout);554555/// @brief remove roundabout that contains the given node556void removeRoundabout(const NBNode* node);557/// @brief remove edges from all stored roundabouts558void removeRoundaboutEdges(const EdgeSet& toRemove);559560/// @brief mark edge priorities and prohibit turn-arounds for all roundabout edges561void markRoundabouts();562563/// @brief fix roundabout information after splitting an edge564void patchRoundabouts(NBEdge* orig, NBEdge* part1, NBEdge* part2, std::set<EdgeSet>& roundabouts);565566/// @brief Returns true if this edge matches one of the removal criteria567bool ignoreFilterMatch(NBEdge* edge);568569/// @brief remap node IDs accoring to options --numerical-ids and --reserved-ids570int remapIDs(bool numericaIDs, bool reservedIDs, bool keptIDs, const std::string& prefix, NBPTStopCont& sc);571572/// @brief check whether edges overlap573void checkOverlap(double threshold, double zThreshold) const;574575/// @brief check whether edges are to steep576void checkGrade(double threshold) const;577578/** @brief Returns the edges which have been built by splitting the edge of the given id579*580* @param[in] id The id of the original edge581* @return List of all edges which have been built by splitting the original edge582* @todo Recheck usage583*/584EdgeVector getGeneratedFrom(const std::string& id) const;585586/// @brief join adjacent lanes with the given permissions587int joinLanes(SVCPermissions perms);588589/// @brief join tram edges into adjacent lanes590int joinTramEdges(NBDistrictCont& dc, NBPTStopCont& sc, NBPTLineCont& lc, double maxDist);591592/// @brief return all edges593EdgeVector getAllEdges() const;594595/// @brief return all router edges596RouterEdgeVector getAllRouterEdges() const;597598/// @brief ensure that all edges have valid nodes599bool checkConsistency(const NBNodeCont& nc);600601/// @brief modify all restrictions on lane changing for edges and connections602void updateAllChangeRestrictions(SVCPermissions ignoring);603604/// @brief add prefix to all edges605void addPrefix(const std::string& prefix);606607/// @brief adapt custom lengths of split edges to account for intersection size608void fixSplitCustomLength();609610/// @brief compute all edge angles611void computeAngles();612613/// @brief return all edge types in used614std::set<std::string> getUsedTypes() const;615616/// @brief return number of edges removed617int removeEdgesBySpeed(NBDistrictCont& dc);618int removeEdgesByPermissions(NBDistrictCont& dc);619int removeLanesByWidth(NBDistrictCont& dc, const double minWidth);620621/// @brief return number of edges split622int attachRemoved(NBNodeCont& nc, NBDistrictCont& dc, const double maxDist);623624private:625/// @brief compute the form factor for a loop of edges626static double formFactor(const EdgeVector& loopEdges);627628/// @brief remove roundabout edges629void removeRoundaboutEdges(const EdgeSet& toRemove, std::set<EdgeSet>& roundabouts);630631/// @brief The network builder; used to obtain type information632NBTypeCont& myTypeCont;633634/** @struct PostProcessConnection635* @brief A structure representing a connection between two lanes636*/637struct PostProcessConnection {638639public:640/** @brief Constructor641* @param[in] from The id of the edge the connection starts at642* @param[in] fromLane The number of the lane the connection starts at643* @param[in] to The id of the edge the connection ends at644* @param[in] toLane The number of the lane the connection ends at645* @param[in] mayDefinitelyPass Whether the connection may be passed without braking646*/647PostProcessConnection(const std::string& from_, int fromLane_, const std::string& to_, int toLane_,648bool mayDefinitelyPass_, KeepClear keepClear_, double contPos_, double visibility_, double speed_,649double friction_, double length_,650const PositionVector& customShape_,651bool uncontrolled_,652bool warnOnly_,653SVCPermissions permissions_,654bool indirectLeft_,655const std::string& edgeType_,656SVCPermissions changeLeft_,657SVCPermissions changeRight_) :658from(from_), fromLane(fromLane_), to(to_), toLane(toLane_), mayDefinitelyPass(mayDefinitelyPass_), keepClear(keepClear_), contPos(contPos_),659visibility(visibility_),660speed(speed_),661friction(friction_),662customLength(length_),663customShape(customShape_),664uncontrolled(uncontrolled_),665permissions(permissions_),666indirectLeft(indirectLeft_),667edgeType(edgeType_),668changeLeft(changeLeft_),669changeRight(changeRight_),670warnOnly(warnOnly_)671{}672673/// @brief The id of the edge the connection starts at674std::string from;675676/// @brief The number of the lane the connection starts at677int fromLane;678679/// @brief The id of the edge the connection ends at680std::string to;681682/// @brief The number of the lane the connection ends at683int toLane;684685/// @brief Whether the connection may be passed without braking686bool mayDefinitelyPass;687688/// @brief Whether the connection may be passed without braking689KeepClear keepClear;690691/// @brief custom position for internal junction on this connection692double contPos;693694/// @brief custom foe visiblity for connection695double visibility;696697/// @brief custom speed for connection698double speed;699700/// @brief custom friction for connection701double friction;702703/// @brief custom length for connection704double customLength;705706/// @brief custom shape for connection707PositionVector customShape;708709/// @brief whether this connection shall not be controlled by a traffic light710bool uncontrolled;711712/// @brief custom permissions for connection713SVCPermissions permissions;714715/// @brief whether this connection is an indirect left turn716bool indirectLeft;717718/// @brief custom edge type719std::string edgeType;720721/// @brief custom lane changing permissions for connection722SVCPermissions changeLeft;723724/// @brief custom lane changing permissions for connection725SVCPermissions changeRight;726727/// @brief whether a failure to set this connection is a warning or an error728bool warnOnly;729};730731struct MinLaneComparatorIdLess {732bool operator()(const std::pair<NBEdge*, int>& a, const std::pair<NBEdge*, int>& b) const;733};734735/// @brief The list of connections to recheck736std::map<std::string, std::vector<PostProcessConnection> > myConnections;737738/// @brief The type of the dictionary where an edge may be found by its id739typedef std::map<std::string, NBEdge*> EdgeCont;740741/// @brief The instance of the dictionary (id->edge)742EdgeCont myEdges;743744/// @brief The extracted edges which are kept for reference745EdgeCont myExtractedEdges;746747/// @brief The edges which got extracted twice but may still be referenced somewhere TODO smart_ptr?748std::set<NBEdge*> myEdgeCemetery;749750/// @brief The ids of ignored edges751std::set<std::string> myIgnoredEdges;752753/// @brief the number of splits of edges during the building754std::map<const NBEdge*, std::pair<NBEdge*, NBEdge*> > myEdgesSplit;755/// @brief the edges that were created as result of splitting756std::set<const NBEdge*> myWasSplit;757758/// @name Settings for accepting/dismissing edges759/// @{760761/// @brief The minimum speed an edge may have in order to be kept (default: -1)762double myEdgesMinSpeed;763764/// @brief Whether edges shall be joined and patched first, then removed765bool myRemoveEdgesAfterLoading;766767/// @brief Set of ids of edges which shall explicitly be kept768std::set<std::string> myEdges2Keep;769770/// @brief Set of ids of edges which shall explicitly be removed771std::set<std::string> myEdges2Remove;772773/// @brief Set of vehicle types which must be allowed on edges in order to keep them774SVCPermissions myVehicleClasses2Keep;775776/// @brief Set of vehicle types which need not be supported (edges which allow ONLY these are removed)777SVCPermissions myVehicleClasses2Remove;778779/// @brief Set of edges types which shall be kept780std::set<std::string> myTypes2Keep;781782/// @brief Set of edges types which shall be removed783std::set<std::string> myTypes2Remove;784785/// @brief Boundary within which an edge must be located in order to be kept786PositionVector myPruningBoundary;787788/// @brief whether a geo transform has been applied to the pruning boundary789bool myNeedGeoTransformedPruningBoundary;790/// @}791792/// @brief Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout)793std::set<EdgeSet> myRoundabouts;794795/// @brief Edges marked as belonging to a roundabout after guessing796std::set<EdgeSet> myGuessedRoundabouts;797798/** @class split_sorter799* @brief Sorts splits by their position (increasing)800*/801class split_sorter {802public:803/// @brief Constructor804explicit split_sorter() { }805806/// @brief Comparing operator807int operator()(const Split& e1, const Split& e2) const {808return e1.pos < e2.pos;809}810};811812/// @brief invalidated copy constructor813NBEdgeCont(const NBEdgeCont& s) = delete;814815/// @brief invalidated assignment operator816NBEdgeCont& operator=(const NBEdgeCont& s) = delete;817};818819820