59 #ifdef CHECK_MEMORY_LEAKS 61 #endif // CHECK_MEMORY_LEAKS 70 myVehicleClasses2Keep(0),
71 myVehicleClasses2Remove(0),
72 myNeedGeoTransformedPrunningBoundary(false) {
87 if (oc.
isSet(
"keep-edges.input-file")) {
90 if (oc.
isSet(
"remove-edges.input-file")) {
93 if (oc.
isSet(
"keep-edges.explicit")) {
94 const std::vector<std::string> edges = oc.
getStringVector(
"keep-edges.explicit");
97 if (oc.
isSet(
"remove-edges.explicit")) {
98 const std::vector<std::string> edges = oc.
getStringVector(
"remove-edges.explicit");
101 if (oc.
exists(
"keep-edges.by-vclass") && oc.
isSet(
"keep-edges.by-vclass")) {
104 if (oc.
exists(
"remove-edges.by-vclass") && oc.
isSet(
"remove-edges.by-vclass")) {
107 if (oc.
exists(
"keep-edges.by-type") && oc.
isSet(
"keep-edges.by-type")) {
108 const std::vector<std::string> types = oc.
getStringVector(
"keep-edges.by-type");
111 if (oc.
exists(
"remove-edges.by-type") && oc.
isSet(
"remove-edges.by-type")) {
112 const std::vector<std::string> types = oc.
getStringVector(
"remove-edges.by-type");
116 if (oc.
isSet(
"keep-edges.in-boundary") || oc.
isSet(
"keep-edges.in-geo-boundary")) {
118 "keep-edges.in-boundary" :
"keep-edges.in-geo-boundary");
120 std::vector<SUMOReal> poly;
121 for (std::vector<std::string>::iterator i = polyS.begin(); i != polyS.end(); ++i) {
124 if (poly.size() < 4) {
125 throw ProcessError(
"Invalid boundary: need at least 2 coordinates");
126 }
else if (poly.size() % 2 != 0) {
127 throw ProcessError(
"Invalid boundary: malformed coordinate");
128 }
else if (poly.size() == 4) {
135 for (std::vector<SUMOReal>::iterator j = poly.begin(); j != poly.end();) {
148 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
173 if (oc.
exists(
"dismiss-vclasses") && oc.
getBool(
"dismiss-vclasses")) {
231 WRITE_ERROR(
"Cannot prune edges using a geo-boundary because no projection has been loaded");
248 EdgeCont::const_iterator i =
myEdges.find(
id);
250 if (retrieveExtracted) {
291 if (downstream ==
true) {
315 hints.push_back(hintedge);
318 for (EdgeVector::iterator i = hints.begin(); i != hints.end(); i++) {
320 for (EdgeVector::iterator j = candidates.begin(); j != candidates.end(); j++) {
321 NBEdge* poss_searched = (*j);
323 ? poss_searched->
myTo : poss_searched->
myFrom;
326 if (find(cont.begin(), cont.end(), hintedge) != cont.end()) {
327 return poss_searched;
343 std::string tid =
id +
"[";
344 for (EdgeCont::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
345 if ((*i).first.find(tid) == 0) {
346 maxLength =
MAX2(maxLength, (
int)(*i).first.length());
351 std::vector<std::string> names;
352 names.push_back(
id +
"[1]");
353 names.push_back(
id +
"[0]");
354 while (names.size() > 0) {
356 std::string cid = names.back();
362 if ((
int)cid.length() + 3 < maxLength) {
363 names.push_back(cid +
"[1]");
364 names.push_back(cid +
"[0]");
401 if (
myEdges.count(newID) != 0) {
402 throw ProcessError(
"Attempt to rename edge using existing id '" + newID +
"'");
420 const std::string& firstEdgeName,
421 const std::string& secondEdgeName,
422 int noLanesFirstEdge,
int noLanesSecondEdge,
424 const int changedLeft) {
435 return splitAt(dc, edge, pos, node, firstEdgeName, secondEdgeName,
436 noLanesFirstEdge, noLanesSecondEdge, speed, changedLeft);
443 const std::string& firstEdgeName,
444 const std::string& secondEdgeName,
445 int noLanesFirstEdge,
int noLanesSecondEdge,
447 const int changedLeft
450 assert(changedLeft > -((
int)noLanesFirstEdge));
451 assert(changedLeft < (
int)noLanesSecondEdge);
454 std::pair<PositionVector, PositionVector> geoms =
457 geoms.first.pop_back();
465 NBEdge* one =
new NBEdge(firstEdgeName, edge->
myFrom, node, edge, geoms.first, noLanesFirstEdge);
466 NBEdge* two =
new NBEdge(secondEdgeName, node, edge->
myTo, edge, geoms.second, noLanesSecondEdge);
476 for (std::set<NBTrafficLightDefinition*>::iterator i = fromTLS.begin(); i != fromTLS.end(); ++i) {
477 (*i)->replaceRemoved(edge, -1, one, -1);
480 for (std::set<NBTrafficLightDefinition*>::iterator i = toTLS.begin(); i != toTLS.end(); ++i) {
481 (*i)->replaceRemoved(edge, -1, two, -1);
492 for (
int i2 = 0; i2 < (int)two->
getNumLanes(); i2++) {
519 std::vector<std::string>
521 std::vector<std::string> ret;
522 for (EdgeCont::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
523 ret.push_back((*i).first);
533 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
534 NBEdge* edge = (*i).second;
538 toRemove.push_back(edge);
541 for (EdgeVector::iterator j = toRemove.begin(); j != toRemove.end(); ++j) {
549 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
550 if ((*i).second->getGeometry().size() < 3) {
553 (*i).second->splitGeometry(*
this, nc);
560 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
561 (*i).second->reduceGeometry(minDist);
568 if (maxAngle > 0 || minRadius > 0) {
569 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
570 (*i).second->checkGeometry(maxAngle, minRadius, fix);
579 for (EdgeCont::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
580 (*i).second->clearControllingTLInformation();
587 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
588 (*i).second->sortOutgoingConnectionsByAngle();
595 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
596 (*i).second->computeEdge2Edges(noLeftMovers);
603 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
604 (*i).second->computeLanes2Edges();
611 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
612 i->second->recheckLanes();
614 if (i->second->getNumLanes() > 0) {
615 const std::string& oppositeID = i->second->getLanes().back().oppositeID;
616 if (oppositeID !=
"" && oppositeID !=
"-") {
617 const NBEdge* oppEdge =
retrieve(oppositeID.substr(0, oppositeID.rfind(
"_")));
619 throw ProcessError(
"Unknown opposite lane '" + oppositeID +
"' for edge '" + i->second->getID() +
"'!");
622 throw ProcessError(
"Opposite lane '" + oppositeID +
"' differs in length from edge '" + i->second->getID() +
"'!");
624 if (oppEdge->
getFromNode() != i->second->getToNode() || oppEdge->
getToNode() != i->second->getFromNode()) {
625 throw ProcessError(
"Opposite lane '" + oppositeID +
"' does not connect the same nodes as edge '" + i->second->getID() +
"'!");
635 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
636 (*i).second->appendTurnaround(noTLSControlled,
true);
643 for (std::set<std::string>::const_iterator it = ids.begin(); it != ids.end(); it++) {
644 myEdges[*it]->appendTurnaround(noTLSControlled,
false);
651 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); i++) {
652 (*i).second->computeEdgeShape();
659 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
660 (*i).second->computeLaneShapes();
681 NBEdge* tpledge = *(edges.begin());
682 NBNode* from = tpledge->getFromNode();
683 NBNode* to = tpledge->getToNode();
684 EdgeVector::const_iterator i;
685 for (i = edges.begin(); i != edges.end(); i++) {
687 assert((*i)->getFromNode() == from);
688 assert((*i)->getToNode() == to);
690 nolanes += (*i)->getNumLanes();
692 if (i != edges.begin()) {
697 speed += (*i)->getSpeed();
699 priority =
MAX2(priority, (*i)->getPriority());
701 speed /= edges.size();
703 NBEdge* newEdge =
new NBEdge(
id, from, to,
"", speed, nolanes, priority,
705 tpledge->getStreetName(), tpledge->myLaneSpreadFunction);
708 for (i = edges.begin(); i != edges.end(); ++i) {
709 const std::vector<NBEdge::Lane>& lanes = (*i)->
getLanes();
710 for (
int j = 0; j < (int)lanes.size(); ++j) {
724 for (i = edges.begin(); i != edges.end(); i++) {
726 for (EdgeVector::iterator j = ev.begin(); j != ev.end(); j++) {
732 for (i = edges.begin(); i != edges.end(); i++) {
734 currLane += (*i)->getNumLanes();
738 for (i = edges.begin(); i != edges.end(); i++) {
739 int noLanes = (*i)->getNumLanes();
740 for (
int j = 0; j < noLanes; j++, currLane++) {
746 for (i = edges.begin(); i != edges.end(); i++) {
755 const SUMOReal distanceThreshold = 7;
756 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
765 if ((*j)->getToNode() == edge->
getFromNode() && !(*j)->getLanes().empty()) {
767 if (distance < distanceThreshold) {
784 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
785 std::string oppositeID;
786 if ((*i).first[0] ==
'-') {
787 oppositeID = (*i).first.substr(1);
789 oppositeID =
"-" + (*i).first;
814 if (from == 0 || to == 0 ||
816 WRITE_ERROR(
"Could not insert connection between '" + (*i).from +
"' and '" + (*i).to +
"' after build.");
821 for (EdgeCont::iterator it =
myEdges.begin(); it !=
myEdges.end(); ++it) {
822 NBEdge* edge = it->second;
825 std::vector<NBEdge::Connection> connections = edge->
getConnections();
826 for (std::vector<NBEdge::Connection>::iterator it_con = connections.begin(); it_con != connections.end(); ++it_con) {
830 "' to edge '" + c.
toEdge->
getID() +
"' via junction '" + to->
getID() +
"'.");
840 int len = (int)
id.length();
842 for (EdgeCont::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
843 std::string curr = (*i).first;
846 if ((
int)curr.length() <= len) {
851 if (curr.substr(0, len) ==
id && curr[len] ==
'[') {
852 ret.push_back((*i).second);
856 std::string::size_type pos = curr.find(
id);
858 if (pos == std::string::npos) {
863 if (curr[pos - 1] !=
']' && curr[pos - 1] !=
'+') {
868 if (pos +
id.length() < curr.length()) {
869 if (curr[pos +
id.length()] !=
'[' && curr[pos +
id.length()] !=
'+') {
874 ret.push_back((*i).second);
883 std::set<NBEdge*> loadedRoundaboutEdges;
885 loadedRoundaboutEdges.insert(it->begin(), it->end());
889 std::set<NBEdge*> candidates;
890 for (EdgeCont::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
894 candidates.insert(e);
899 std::set<NBEdge*> visited;
900 for (std::set<NBEdge*>::const_iterator i = candidates.begin(); i != candidates.end(); ++i) {
907 if (visited.count(e) > 0) {
911 loopEdges.push_back(e);
916 if (edges.size() < 2) {
925 EdgeVector::const_iterator me = find(edges.begin(), edges.end(), e);
934 EdgeVector::const_iterator loopClosed = find(loopEdges.begin(), loopEdges.end(), left);
935 const int loopSize = (int)(loopEdges.end() - loopClosed);
940 }
else if (loopSize < (
int)loopEdges.size()) {
942 EdgeVector(loopEdges.begin() + (loopEdges.size() - loopSize), loopEdges.end()).swap(loopEdges);
946 for (EdgeVector::const_iterator j = loopEdges.begin(); j != loopEdges.end(); ++j) {
947 if ((*j)->getToNode()->getEdges().size() > 2) {
951 if (attachments < 3) {
956 if (visited.count(left) > 0) {
960 loopEdges.push_back(left);
979 for (EdgeVector::const_iterator it = loopEdges.begin(); it != loopEdges.end(); ++it) {
980 points.
append((*it)->getGeometry());
983 return 4 *
M_PI * points.
area() / (circumference * circumference);
987 const std::set<EdgeSet>
997 if (roundabout.size() > 0) {
1010 for (std::set<EdgeSet>::const_iterator it = roundabouts.begin(); it != roundabouts.end(); ++it) {
1011 const EdgeSet roundaboutSet = *it;
1012 for (std::set<NBEdge*>::const_iterator j = roundaboutSet.begin(); j != roundaboutSet.end(); ++j) {
1014 NBNode* node = (*j)->getToNode();
1016 for (EdgeVector::const_iterator k = incoming.begin(); k != incoming.end(); ++k) {
1018 if (roundaboutSet.count(inEdge) > 0) {
1027 (*j)->setJunctionPriority(node, 1000);
1035 for (EdgeCont::iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
1073 int sidewalksCreated = 0;
1075 std::set<std::string> exclude(edges.begin(), edges.end());
1076 for (EdgeCont::iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
1077 NBEdge* edge = it->second;
1079 exclude.count(edge->
getID()) == 0
1086 || (!fromPermissions && edge->
getSpeed() > minSpeed && edge->
getSpeed() <= maxSpeed)
1089 sidewalksCreated += 1;
1092 return sidewalksCreated;
1100 for (EdgeCont::iterator it =
myEdges.begin(); it !=
myEdges.end(); it++) {
1104 toChange.push_back(it->second);
1107 for (EdgeVector::iterator it = toChange.begin(); it != toChange.end(); ++it) {
1113 return (
int)toChange.size();
int guessSidewalks(SUMOReal width, SUMOReal minSpeed, SUMOReal maxSpeed, bool fromPermissions)
add sidwalks to edges within the given limits or permissions and return the number of edges affected ...
std::vector< Lane > myLanes
Lane information.
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
const std::string & getTypeID() const
A structure which describes a connection between edges or lanes.
void sortOutgoingLanesConnections()
Sorts all lanes of all edges within the container by their direction.
void markRoundabouts()
mark edge priorities and prohibit turn-arounds for all roundabout edges
void setRoundabout()
update the type of this node as a roundabout
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
static const SUMOReal UNSPECIFIED_WIDTH
unspecified lane width
A class representing a single street sign.
PositionVector shape
The lane's shape.
bool x2cartesian_const(Position &from) const
Converts the given coordinate into a cartesian using the previous initialisation. ...
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
std::vector< std::string > getAllNames() const
Returns all ids of known edges.
static bool transformCoordinates(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
void addSign(NBSign sign)
NBEdge * toEdge
The edge the connections yields in.
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
static SUMOReal _2SUMOReal(const E *const data)
converts a char-type array into the SUMOReal value described by it
bool myNeedGeoTransformedPrunningBoundary
whether a geo transform has been applied to the pruning boundary
A container for traffic light definitions and built programs.
int guessRoundabouts()
Determines which edges belong to roundabouts and increases their priority.
void setLaneWidth(int lane, SUMOReal width)
set lane specific width (negative lane implies set for all lanes)
bool myRemoveEdgesAfterJoining
Whether edges shall be joined first, then removed.
void setSpeed(int lane, SUMOReal speed)
set lane specific speed (negative lane implies set for all lanes)
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
void addSidewalk(SUMOReal width)
add a pedestrian sidewalk of the given width and shift existing connctions
static GeoConvHelper & getProcessing()
the coordinate transformation to use for input conversion and processing
void removeEdge(NBEdge *edge, bool removeFromConnections=true)
Removes edge from this node and optionally removes connections as well.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The representation of a single edge during network building.
void guessOpposites()
Sets opposite lane information for geometrically close edges.
A container for districts.
static GeoConvHelper & getLoaded()
the coordinate transformation that was loaded fron an input file
void clearControllingTLInformation() const
Clears information about controlling traffic lights for all connenections of all edges.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given ...
void generateStreetSigns()
assigns street signs to edges based on toNode types
void rename(NBEdge *edge, const std::string &newID)
Renames the edge. Throws exception if newID already exists.
bool splitAt(NBDistrictCont &dc, NBEdge *edge, NBNode *node)
Splits the edge at the position nearest to the given node.
void recheckPostProcessConnections()
Try to set any stored connections.
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
Lane & getLaneStruct(int lane)
static const SUMOReal UNSPECIFIED_OFFSET
unspecified lane offset
static void loadEdgesFromFile(const std::string &file, std::set< std::string > &into)
Add edge ids defined in file (either ID or edge::ID per line) into the given set. ...
int mapToNumericalIDs()
ensure that all edge ids are integers
void computeLanes2Edges()
Computes for each edge which lanes approach the next edges.
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, SUMOReal contPos=UNSPECIFIED_CONTPOS)
Adds a connection between the specified this edge's lane and an approached one.
std::vector< PostProcessConnection > myConnections
The list of connections to recheck.
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...
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
void checkGeometries(const SUMOReal maxAngle, const SUMOReal minRadius, bool fix)
NBEdgeCont(NBTypeCont &tc)
Constructor.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
SUMOReal getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
An (internal) definition of a single lane of an edge.
const std::string & getID() const
Returns the id.
SUMOReal length2D() const
Returns the length.
std::vector< SUMOReal > distances(const PositionVector &s, bool perpendicular=false) const
distances of all my points to s and all of s points to myself
bool addEdge2EdgeConnection(NBEdge *dest)
Adds a connection to another edge.
bool overlapsWith(const AbstractPoly &poly, SUMOReal offset=0) const
Returns whether the boundary overlaps with the given polygon.
SVCPermissions myVehicleClasses2Keep
Set of vehicle types which must be allowed on edges in order to keep them.
const Position & getPosition() const
Returns the position of this node.
void reduceGeometries(const SUMOReal minDist)
Lanes to lanes - relationships are loaded; no recheck is necessary/wished.
std::set< NBEdge * > EdgeSet
std::string getNext()
Returns the next id.
bool usingGeoProjection() const
Returns whether a transformation from geo to metric coordinates will be performed.
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
void removeUnwishedEdges(NBDistrictCont &dc)
Removes unwished edges (not in keep-edges)
void extract(NBDistrictCont &dc, NBEdge *edge, bool remember=false)
Removes the given edge from the container like erase but does not delete it.
A point in 2D or 3D with translation and scaling methods.
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
void moveOutgoingConnectionsFrom(NBEdge *e, int laneOff)
static int _str2int(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter...
std::set< std::string > myEdges2Keep
Set of ids of edges which shall explicitly be kept.
SumoXMLNodeType getType() const
Returns the type of this node.
void computeEdge2Edges(bool noLeftMovers)
Computes for each edge the approached edges.
void computeLaneShapes()
Computes the shapes of all lanes of all edges stored in the container.
int getNumLanes() const
Returns the number of lanes.
const EdgeVector & getEdges() const
Returns all edges which participate in this node.
void splitGeometry(NBNodeCont &nc)
Splits edges into multiple if they have a complex geometry.
EdgeCont myEdges
The instance of the dictionary (id->edge)
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
void clear()
Deletes all edges.
EdgeCont myExtractedEdges
The extracted nodes which are kept for reference.
bool knows(const std::string &type) const
Returns whether the named type is in the container.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
The connection was given by the user.
std::set< EdgeSet > myGuessedRoundabouts
Edges marked as belonging to a roundabout after guessing.
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false)
Removes the specified connection(s)
std::set< EdgeSet > myRoundabouts
Edges marked as belonging to a roundabout by the user (each EdgeVector is a roundabout) ...
NBEdge * getConnectionTo(NBNode *n) const
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
void joinSameNodeConnectingEdges(NBDistrictCont &dc, NBTrafficLightLogicCont &tlc, EdgeVector edges)
Joins the given edges because they connect the same nodes.
static SUMOReal formFactor(const EdgeVector &loopEdges)
compute the form factor for a loop of edges
std::pair< PositionVector, PositionVector > splitAt(SUMOReal where) const
Returns the two lists made when this list vector is splitted at the given point.
SVCPermissions myVehicleClasses2Remove
Set of vehicle types which need not be supported (edges which allow ONLY these are removed) ...
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
PositionVector myPrunningBoundary
Boundary within which an edge must be located in order to be kept.
SUMOReal length() const
Returns the length.
std::set< std::string > myTypes2Keep
Set of edges types which shall be kept.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
NBNode * getToNode() const
Returns the destination node of the edge.
SUMOReal myEdgesMinSpeed
The minimum speed an edge may have in order to be kept (default: -1)
void setID(const std::string &newID)
resets the id
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
std::string oppositeID
An opposite lane ID, if given.
void appendTurnarounds(bool noTLSControlled)
Appends turnarounds to all edges stored in the container.
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...
std::vector< NBEdge * > EdgeVector
bool getShallBeDiscarded(const std::string &type) const
Returns the information whether edges of this type shall be discarded.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
A storage for options typed value containers)
static SUMOReal nearest_offset_on_line_to_point2D(const Position &lineStart, const Position &lineEnd, const Position &p, bool perpendicular=true)
void erase(NBDistrictCont &dc, NBEdge *edge)
Removes the given edge from the container (deleting it)
A structure representing a connection between two lanes.
void computeEdgeShapes()
Computes the shapes of all edges stored in the container.
The connection was computed.
Represents a single node (junction) during network building.
void dismissVehicleClassInformation()
NBTypeCont & myTypeCont
The network builder; used to obtain type information.
void recheckLaneSpread()
Rechecks whether the lane spread is proper.
void setEndOffset(int lane, SUMOReal offset)
set lane specific end-offset (negative lane implies set for all lanes)
static SUMOReal relAngle(SUMOReal angle1, SUMOReal angle2)
std::string getLaneID(int lane) const
void removeFromSinksAndSources(NBEdge *const e)
Removes the given edge from the lists of sources and sinks in all stored districts.
std::set< std::string > myTypes2Remove
Set of edges types which shall be removed.
void recheckLanes()
Rechecks whether all lanes have a successor for each of the stored edges.
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Container for nodes during the netbuilding process.
static T maxValue(const std::vector< T > &v)
std::set< std::string > myIgnoredEdges
The ids of ignored edges.
EdgeVector getGeneratedFrom(const std::string &id) const
Returns the edges which have been built by splitting the edge of the given id.
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces occurences of the removed edge/lane in all definitions by the given edge.
SUMOReal area() const
Returns the area (0 for non-closed)
void addRoundabout(const EdgeSet &roundabout)
add user specified roundabout
void addPostProcessConnection(const std::string &from, int fromLane, const std::string &to, int toLane, bool mayDefinitelyPass, bool keepClear, SUMOReal contPos)
Adds a connection which could not be set during loading.
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
const std::vector< Connection > & getConnections() const
Returns the connections.
NBNode * myFrom
The source and the destination node.
NBEdge * getTurnDestination(bool possibleDestination=false) const
bool exists(const std::string &name) const
Returns the information whether the named option is known.
void append(const PositionVector &v, SUMOReal sameThreshold=2.0)
void copyConnectionsFrom(NBEdge *src)
bool ignoreFilterMatch(NBEdge *edge)
Returns true if this edge matches one of the removal criteria.
A storage for available types of edges.
SUMOReal getLength() const
Returns the computed length of the edge.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
SUMOReal getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
int myEdgesSplit
the number of splits of edges during the building
std::set< std::string > myEdges2Remove
Set of ids of edges which shall explicitly be removed.
NBNode * getFromNode() const
Returns the origin node of the edge.