68 myNodeCont(nb.getNodeCont()),
69 myTLLCont(nb.getTLLogicCont()),
70 myTypesHandler(nb.getTypeCont()),
71 myCurrentEdge(nullptr),
72 myCurrentLane(nullptr),
75 myNetworkVersion(0, 0),
76 myHaveSeenInternalEdge(false),
78 myChangeLefthand(false),
82 myWalkingAreas(false),
84 myCheckLaneFoesAll(false),
85 myCheckLaneFoesRoundabout(true),
86 myTlsIgnoreInternalJunctionJam(false),
88 myGeomAvoidOverlap(true),
89 myJunctionsHigherSpeed(false),
90 myInternalJunctionsVehicleWidth(
OptionsCont::getOptions().getFloat(
"internal-junctions.vehicle-width")),
91 myJunctionsMinimalShape(
OptionsCont::getOptions().getBool(
"junctions.minimal-shape")),
92 myJunctionsEndpointShape(
OptionsCont::getOptions().getBool(
"junctions.endpoint-shape")) {
97 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
99 for (std::vector<LaneAttrs*>::const_iterator j = ed->
lanes.begin(); j != ed->
lanes.end(); ++j) {
114 const std::vector<std::string> discardableParams = oc.
getStringVector(
"discard-params");
117 const std::vector<std::string> files = oc.
getStringVector(
"sumo-net-file");
118 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
129 const double maxSegmentLength = oc.
getFloat(
"geometry.max-segment-length");
130 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
139 if (from ==
nullptr) {
151 if (ed->
shape.size() == 0 && maxSegmentLength > 0) {
160 (
int) ed->
lanes.size(),
179 const bool dismissVclasses = oc.
getBool(
"dismiss-vclasses");
180 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
183 if (nbe ==
nullptr) {
187 for (
int fromLaneIndex = 0; fromLaneIndex < (int) ed->
lanes.size(); ++fromLaneIndex) {
190 const std::vector<Connection>& connections = lane->
connections;
192 if (
myEdges.count(c.toEdgeID) == 0) {
193 WRITE_ERRORF(
TL(
"Unknown edge '%' given in connection."), c.toEdgeID);
197 if (toEdge ==
nullptr) {
205 bool uncontrolled = c.uncontrolled;
214 c.contPos, c.visibility, c.speed, c.friction, c.customLength, c.customShape, uncontrolled, c.permissions, c.indirectLeft, c.edgeType, c.changeLeft, c.changeRight);
215 if (c.getParametersMap().size() > 0) {
220 const std::map<std::string, NBTrafficLightDefinition*>& programs =
myTLLCont.
getPrograms(c.tlID);
221 if (programs.size() > 0) {
222 std::map<std::string, NBTrafficLightDefinition*>::const_iterator it;
223 for (it = programs.begin(); it != programs.end(); it++) {
226 tlDef->
addConnection(nbe, toEdge, fromLaneIndex, c.toLaneIdx, c.tlLinkIndex, c.tlLinkIndex2,
false);
228 throw ProcessError(
"Corrupt traffic light definition '" + c.tlID +
"' (program '" + it->first +
"')");
237 if (!dismissVclasses) {
254 bool stopOffsetSet =
false;
259 if (!stopOffsetSet) {
277 toRemove.push_back(nbe);
280 for (EdgeVector::iterator i = toRemove.begin(); i != toRemove.end(); ++i) {
285 NBEdge* prohibitedFrom =
myEdges[it->prohibitedFrom]->builtEdge;
287 NBEdge* prohibitorFrom =
myEdges[it->prohibitorFrom]->builtEdge;
289 if (prohibitedFrom ==
nullptr) {
290 WRITE_WARNINGF(
TL(
"Edge '%' in prohibition was not built."), it->prohibitedFrom);
291 }
else if (prohibitedTo ==
nullptr) {
292 WRITE_WARNINGF(
TL(
"Edge '%' in prohibition was not built."), it->prohibitedTo);
293 }
else if (prohibitorFrom ==
nullptr) {
294 WRITE_WARNINGF(
TL(
"Edge '%' in prohibition was not built."), it->prohibitorFrom);
295 }
else if (prohibitorTo ==
nullptr) {
296 WRITE_WARNINGF(
TL(
"Edge '%' in prohibition was not built."), it->prohibitorTo);
305 oc.
set(
"no-internal-links",
"true");
322 if (oc.
isWriteable(
"junctions.limit-turn-speed")) {
356 if (!oc.
getBool(
"no-internal-links")) {
360 for (
const Crossing& crossing : crossIt.second) {
362 for (
const std::string& edgeID : crossing.crossingEdges) {
365 if (edge !=
nullptr) {
366 edges.push_back(edge);
369 if (!edges.empty()) {
370 node->
addCrossing(edges, crossing.width, crossing.priority,
371 crossing.customTLIndex, crossing.customTLIndex2, crossing.customShape,
true, &crossing);
380 std::vector<std::string> edgeIDs;
381 if (item.second.fromEdges.size() + item.second.toEdges.size() == 0) {
383 assert(item.second.fromCrossed.size() > 0);
384 assert(item.second.toCrossed.size() > 0);
385 edgeIDs = item.second.fromCrossed;
386 edgeIDs.insert(edgeIDs.end(), item.second.toCrossed.begin(), item.second.toCrossed.end());
387 }
else if (item.second.fromEdges.size() > 0) {
388 edgeIDs = item.second.fromEdges;
390 edgeIDs = item.second.toEdges;
393 for (
const std::string& edgeID : edgeIDs) {
396 if (edge !=
nullptr) {
397 edges.push_back(edge);
400 if (edges.size() > 0) {
408 for (
const std::string& edgeID : ra) {
410 if (edge ==
nullptr) {
415 roundabout.insert(edge);
584 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
626 WRITE_ERRORF(
TL(
"Unknown spreadType '%' for edge '%'."), lsfS,
id);
643 if (
id != expectedID) {
655 assert(crossings.size() > 0);
755 WRITE_WARNINGF(
TL(
"Junction '%' occurred at least twice in the input."),
id);
799 if (
myEdges.count(fromID) == 0) {
800 WRITE_ERRORF(
TL(
"Unknown edge '%' given in connection."), fromID);
826 if (allow ==
"" && disallow ==
"") {
850 if (conn.
tlID !=
"") {
856 if ((
int)from->
lanes.size() <= fromLaneIdx) {
860 from->
lanes[fromLaneIdx]->connections.push_back(conn);
868 for (std::vector<Crossing>::iterator it = crossings.begin(); it != crossings.end(); ++it) {
869 if (conn.
toEdgeID == (*it).edgeID) {
870 if (conn.
tlID !=
"") {
871 (*it).priority =
true;
882 if (fromID == c.edgeID) {
892 std::map<std::string, WalkingAreaParsedCustomShape>::iterator it =
myWACustomShapes.find(fromID);
896 it->second.toEdges.push_back(conn.
toEdgeID);
900 if (conn.
toEdgeID == crossing.edgeID) {
901 it->second.toCrossed.insert(it->second.toCrossed.end(), crossing.crossingEdges.begin(), crossing.crossingEdges.end());
911 it->second.fromEdges.push_back(fromID);
915 if (fromID == crossing.edgeID) {
916 it->second.fromCrossed.insert(it->second.fromCrossed.end(), crossing.crossingEdges.begin(), crossing.crossingEdges.end());
959 WRITE_ERRORF(
TL(
"Unknown traffic light type '%' for tlLogic '%'."), typeS,
id);
976 const std::string&
id = currentTL->
getID();
997 currentTL->
addPhase(duration, state, minDuration, maxDuration, earliestEnd, latestEnd, vehExt, yellow, red, nextPhases, name);
1013 result =
new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary);
1035 const std::string::size_type div = attr.find(
"->");
1036 if (div == std::string::npos) {
1037 WRITE_ERRORF(
TL(
"Missing connection divider in prohibition attribute '%'"), attr);
1040 from = attr.substr(0, div);
1041 to = attr.substr(div + 2);
1043 if (
myEdges.count(from) == 0) {
1057 const std::vector<std::string>& edgeIDs = attrs.
get<std::vector<std::string> >(
SUMO_ATTR_EDGES,
nullptr, ok);
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
#define PROGRESS_BEGIN_TIME_MESSAGE(msg)
#define PROGRESS_TIME_MESSAGE(before)
std::set< NBEdge * > EdgeSet
container for unique edges
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
std::set< std::string > deprecatedVehicleClassesSeen
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
@ RIGHT
At the rightmost side of the lane.
@ SUMO_TAG_PHASE
a single phase description
@ SUMO_TAG_NET
root element of a network file
@ SUMO_TAG_STOPOFFSET
Information on vClass specific stop offsets at lane end.
@ SUMO_TAG_REQUEST
description of a logic request within the junction
@ SUMO_TAG_PROHIBITION
prohibition of circulation between two edges
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_ROUNDABOUT
roundabout defined in junction
@ SUMO_TAG_TLLOGIC
a traffic light logic
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_PARAM
parameter associated to a certain key
@ SUMO_TAG_NEIGH
begin/end of the description of a neighboring lane
@ SUMO_TAG_EDGE
begin/end of the description of an edge
LaneSpreadFunction
Numbers representing special SUMO-XML-attribute values Information how the edge's lateral offset shal...
FringeType
classifying boundary nodes
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_MAJOR
This is an uncontrolled, major link, may pass.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
RightOfWay
algorithms for computing right of way
@ SUMO_ATTR_JUNCTIONS_MINIMAL_SHAPE
@ SUMO_ATTR_CONV_BOUNDARY
@ SUMO_ATTR_ORIG_BOUNDARY
@ SUMO_ATTR_LATEST_END
The maximum time within the cycle for switching (for coordinated actuation)
@ SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
@ SUMO_ATTR_RED
red duration of a phase
@ SUMO_ATTR_RADIUS
The turning radius at an intersection in m.
@ SUMO_ATTR_INDIRECT
Whether this connection is an indirect (left) turn.
@ SUMO_ATTR_RECTANGULAR_LANE_CUT
@ SUMO_ATTR_LIMIT_TURN_SPEED
@ SUMO_ATTR_CHECKLANEFOES_ROUNDABOUT
@ SUMO_ATTR_AVOID_OVERLAP
@ SUMO_ATTR_YELLOW
yellow duration of a phase
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ SUMO_ATTR_VEHICLEEXTENSION
vehicle extension time of a phase
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_FRINGE
Fringe type of node.
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_NEXT
succesor phase index
@ SUMO_ATTR_JUNCTIONS_ENDPOINT_SHAPE
@ SUMO_ATTR_CHECKLANEFOES_ALL
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_MAXDURATION
maximum duration of a phase
@ SUMO_ATTR_RIGHT_OF_WAY
How to compute right of way.
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
@ SUMO_ATTR_CROSSING_EDGES
the edges crossed by a pedestrian crossing
@ SUMO_ATTR_TLS_IGNORE_INTERNAL_JUNCTION_JAM
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
@ SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH
@ SUMO_ATTR_STATE
The state of a link.
@ SUMO_ATTR_EARLIEST_END
The minimum time within the cycle for switching (for coordinated actuation)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static bool isReadable(std::string path)
Checks whether the given file is readable.
void setFileName(const std::string &name)
Sets the current file name.
static methods for processing the coordinates conversion for the current net
void resolveAbstractProjection()
init projString such as 'UTM' in loaded projection
static void setLoaded(const GeoConvHelper &loaded)
sets the coordinate transformation loaded from a location element
static const int InvalidTlIndex
void addRoundabout(const EdgeSet &roundabout)
add user specified roundabout
void erase(NBDistrictCont &dc, NBEdge *edge)
Removes the given edge from the container (deleting it)
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
bool ignoreFilterMatch(NBEdge *edge)
Returns true if this edge matches one of the removal criteria.
void ignore(std::string id)
mark the given edge id as ignored
bool wasIgnored(std::string id) const
Returns whether the edge with the id was ignored during parsing.
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
The representation of a single edge during network building.
void setPermittedChanging(int lane, SVCPermissions changeLeft, SVCPermissions changeRight)
set allowed classes for changing to the left and right from the given lane
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
double getLaneWidth() const
Returns the default width of lanes of this edge.
NBNode * getToNode() const
Returns the destination node of the edge.
Connection & getConnectionRef(int fromLane, const NBEdge *to, int toLane)
Returns reference to the specified connection This method goes through "myConnections" and returns th...
static const double UNSPECIFIED_FRICTION
unspecified lane friction
Lane & getLaneStruct(int lane)
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, const bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection between the specified this edge's lane and an approached one.
void setDistance(double distance)
set kilometrage at start of edge (negative value implies couting down along the edge)
bool setEdgeStopOffset(int lane, const StopOffset &offset, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes)
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
const std::string & getID() const
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
const StopOffset & getEdgeStopOffset() const
Returns the stopOffset to the end of the edge.
void setBidi(bool isBidi)
mark this edge as a bidi edge
void setFriction(int lane, double friction)
set lane specific friction (negative lane implies set for all lanes)
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
bool hasLaneSpecificWidth() const
whether lanes differ in width
static const double UNSPECIFIED_SPEED
unspecified lane speed
@ VALIDATED
The connection was computed and validated.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
NBNode * getFromNode() const
Returns the origin node of the edge.
static const double UNSPECIFIED_WIDTH
unspecified lane width
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
double getEndOffset() const
Returns the offset to the destination node.
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
static const double UNSPECIFIED_OFFSET
unspecified lane offset
void setLoadedLength(double val)
set loaded length
A loaded (complete) traffic light logic.
void addPhase(const SUMOTime duration, const std::string &state, const SUMOTime minDur, const SUMOTime maxDur, const SUMOTime earliestEnd, const SUMOTime latestEnd, const SUMOTime vehExt, const SUMOTime yellow, const SUMOTime red, const std::vector< int > &next, const std::string &name)
Adds a phase to the logic the new phase is inserted at the end of the list of already added phases.
void addConnection(NBEdge *from, NBEdge *to, int fromLane, int toLane, int linkIndex, int linkIndex2, bool reconstruct=true)
Adds a connection and immediately informs the edges.
Instance responsible for building networks.
static bool transformCoordinates(PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
static int addGeometrySegments(PositionVector &from, const PositionVector &cartesian, const double maxLength)
insertion geometry points to ensure maximum segment length between points
void setHaveNetworkCrossings(bool value)
enable crossing in networks
NBEdgeCont & getEdgeCont()
NBDistrictCont & getDistrictCont()
Returns a reference the districts container.
static bool transformCoordinate(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=nullptr)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Represents a single node (junction) during network building.
void addWalkingAreaShape(EdgeVector edges, const PositionVector &shape, double width)
add custom shape for walkingArea
RightOfWay getRightOfWay() const
Returns hint on how to compute right of way.
NBNode::Crossing * addCrossing(EdgeVector edges, double width, bool priority, int tlIndex=-1, int tlIndex2=-1, const PositionVector &customShape=PositionVector::EMPTY, bool fromSumoNet=false, const Parameterised *params=nullptr)
add a pedestrian crossing to this node
FringeType getFringeType() const
Returns fringe type.
SumoXMLNodeType getType() const
Returns the type of this node.
bool isTrafficLight() const
void setRightOfWay(RightOfWay rightOfWay)
set method for computing right-of-way
void setCustomShape(const PositionVector &shape)
set the junction shape
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
add shorted link FOES
void setRadius(double radius)
set the turning radius
void setName(const std::string &name)
set intersection name
const Position & getPosition() const
void setFringeType(FringeType fringeType)
set method for computing right-of-way
const std::string & getProgramID() const
Returns the ProgramID.
static const SUMOTime UNSPECIFIED_DURATION
const std::map< std::string, NBTrafficLightDefinition * > & getPrograms(const std::string &id) const
Returns all programs for the given tl-id.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
A connection description.
PositionVector customShape
custom shape connection
std::string tlID
The id of the traffic light that controls this connection.
double speed
custom speed for connection
std::string edgeType
optional edge type
std::string toEdgeID
The id of the target edge.
double customLength
custom length for connection
double contPos
custom position for internal junction on this connection
int toLaneIdx
The index of the target lane.
double friction
custom friction for connection
int tlLinkIndex
The index of this connection within the controlling traffic light.
bool indirectLeft
Whether this connection is an indirect left turn.
double visibility
custom foe visibility for connection
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
SVCPermissions changeLeft
custom lane changing permissions for connection
SVCPermissions changeRight
custom lane changing permissions for connection
bool uncontrolled
if set to true, This connection will not be TLS-controlled despite its node being controlled.
SVCPermissions permissions
custom permissions for connection
Describes the values found in an edge's definition and this edge's lanes.
std::string bidi
the bidi edge
LaneSpreadFunction lsf
The lane spread function.
std::vector< LaneAttrs * > lanes
The friction on this edge.
StopOffset edgeStopOffset
This edge's vehicle specific stop offsets (used for lanes, that do not have a specified stopOffset)
PositionVector shape
This edges's shape.
int priority
This edge's priority.
std::string toNode
The node this edge ends at.
std::string type
This edge's type.
double maxSpeed
The maximum velocity allowed on this edge (!!!)
NBEdge * builtEdge
The built edge.
SumoXMLEdgeFunc func
This edge's function.
std::string streetName
This edge's street name.
std::string fromNode
The node this edge starts at.
double length
The length of the edge if set explicitly.
std::string id
This edge's id.
double distance
The position at the start of this edge (kilometrage/mileage)
Describes the values found in a lane's definition.
double maxSpeed
The maximum velocity allowed on this lane.
double friction
The friction on this lane.
std::string changeRight
This lane's vehicle classes allowed to change right.
double endOffset
This lane's offset from the intersection.
bool accelRamp
Whether this lane is an acceleration lane.
std::string oppositeID
This lane's opposite lane.
std::string type
the type of this lane
std::vector< Connection > connections
This lane's connections.
bool customShape
Whether this lane has a custom shape.
StopOffset laneStopOffset
This lane's vehicle specific stop offsets.
PositionVector shape
This lane's shape (may be custom)
std::string changeLeft
This lane's vehicle classes allowed to change left.
double width
The width of this lane.
std::string disallow
This lane's disallowed vehicle classes.
std::string allow
This lane's allowed vehicle classes.
Importer for networks stored in SUMO format.
GeoConvHelper * myLocation
The coordinate transformation which was used to build the loaded network.
static NBLoadedSUMOTLDef * initTrafficLightLogic(const SUMOSAXAttributes &attrs, NBLoadedSUMOTLDef *currentTL)
begins the reading of a traffic lights logic
void parseProhibitionConnection(const std::string &attr, std::string &from, std::string &to, bool &ok)
parses connection string of a prohibition (very old school)
~NIImporter_SUMO()
Destructor.
NIXMLTypesHandler myTypesHandler
The handler for parsing edge types and restrictions.
int myCornerDetail
the level of corner detail in the loaded network
bool myCheckLaneFoesAll
whether foe-relationships where checked at lane-level
double myLimitTurnSpeed
whether turning speed was limited in the network
std::set< std::string > myRailSignals
list of node id with rail signals (no NBTrafficLightDefinition exists)
bool myGeomAvoidOverlap
overlap option for loaded network
std::map< std::string, std::vector< Crossing > > myPedestrianCrossings
The pedestrian crossings found in the network.
bool myCheckLaneFoesRoundabout
JunctionAttrs myCurrentJunction
The currently parsed junction definition to help in reconstructing crossings.
static GeoConvHelper * loadLocation(const SUMOSAXAttributes &attrs, bool setLoaded=true)
Parses network location description and registers it with GeoConveHelper::setLoaded.
void addJunction(const SUMOSAXAttributes &attrs)
Parses a junction and saves it in the node control.
bool myAmLefthand
whether the loaded network was built for lefthand traffic
bool myRectLaneCut
whether all lanes of an edge should have the same stop line
std::vector< Parameterised * > myLastParameterised
element to receive parameters
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
double myInternalJunctionsVehicleWidth
custom settings for internal junction computation
std::string myDefaultSpreadType
default spreadType defined in the network
bool myJunctionsEndpointShape
bool myJunctionsHigherSpeed
higherSpeed option for loaded network
NBLoadedSUMOTLDef * myCurrentTL
The currently parsed traffic light.
static void loadNetwork(OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given SUMO file.
std::vector< std::vector< std::string > > myRoundabouts
loaded roundabout edges
bool myChangeLefthand
whether the written network should have a different "handedness" (LHT/RHT) than the loaded network
void addConnection(const SUMOSAXAttributes &attrs)
Parses a connection and saves it into the lane's definition stored in "myCurrentLane".
void addEdge(const SUMOSAXAttributes &attrs)
Parses an edge and stores the values in "myCurrentEdge".
LaneAttrs * myCurrentLane
The currently parsed lanes's definition (to add the shape to)
void addLane(const SUMOSAXAttributes &attrs)
Parses a lane and stores the values in "myCurrentLane".
NBNodeCont & myNodeCont
The node container to fill.
EdgeAttrs * myCurrentEdge
The currently parsed edge's definition (to add loaded lanes to)
NBNetBuilder & myNetBuilder
The network builder to fill.
void addRoundabout(const SUMOSAXAttributes &attrs)
Parses a roundabout and stores it in myEdgeCont.
std::vector< Prohibition > myProhibitions
Loaded prohibitions.
MMVersion myNetworkVersion
the loaded network version
void _loadNetwork(OptionsCont &oc)
load the network
void myEndElement(int element)
Called when a closing tag occurs.
bool myTlsIgnoreInternalJunctionJam
whether some right-of-way checks at traffic light junctions should be disabled
bool myJunctionsMinimalShape
custom settings for junction shape computation
void addStopOffsets(const SUMOSAXAttributes &attrs, bool &ok)
parses stop offsets for the current lane or edge
static Position readPosition(const SUMOSAXAttributes &attrs, const std::string &id, bool &ok)
read position from the given attributes, attribute errors to id
static void addPhase(const SUMOSAXAttributes &attrs, NBLoadedSUMOTLDef *currentTL)
adds a phase to the traffic lights logic currently build
int myLinkDetail
the level of geometry detail for internal lanes in the loaded network
std::map< std::string, WalkingAreaParsedCustomShape > myWACustomShapes
Map from walkingArea edge IDs to custom shapes.
bool myWalkingAreas
whether walkingareas must be built
NBTrafficLightLogicCont & myTLLCont
The node container to fill.
NIImporter_SUMO(NBNetBuilder &nb)
Constructor.
void addProhibition(const SUMOSAXAttributes &attrs)
Parses a prohibition and saves it.
void addRequest(const SUMOSAXAttributes &attrs)
Parses a request and saves selected attributes in myCurrentJunction.
std::set< std::string > myDiscardableParams
list of parameter keys to discard
std::map< std::string, EdgeAttrs * > myEdges
Loaded edge definitions.
bool myHaveSeenInternalEdge
whether the loaded network contains internal lanes
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag; Parses edge type information.
const std::string & getID() const
Returns the id.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
bool isWriteable(const std::string &name)
Returns the information whether the named option may be set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
static OptionsCont & getOptions()
Retrieves the options.
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file)
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
void updateParameters(const Parameterised::Map &mapArg)
Adds or updates all given parameters from the map.
A point in 2D or 3D with translation and scaling methods.
static const PositionVector EMPTY
empty Vector
Encapsulated SAX-Attributes.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
double getFloat(int id) const
Returns the double-value of the named (by its enum-value) attribute.
SAX-handler base for SUMO-files.
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
static StringBijection< LinkState > LinkStates
link states
static std::string getJunctionIDFromInternalEdge(const std::string internalEdge)
return the junction id when given an edge of type internal, crossing or WalkingArea
bool isDefined() const
check if stopOffset was defined
T get(const std::string &str) const
static MMVersion toVersion(const std::string &sData)
parse a (network) version string
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false, const bool isExternal=false, const bool catchExceptions=true)
Runs the given handler on the given file; returns if everything's ok.
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
std::string type
the type of this lane
std::string oppositeID
An opposite lane ID, if given.
Describes a pedestrian crossing.
std::vector< std::string > crossingEdges
std::vector< std::string > response
std::vector< std::string > intLanes
Describes the values found in a prohibition.
std::string prohibitedFrom
std::string prohibitorFrom
Describes custom shape for a walking area during parsing.