 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
69 myNodeCont(nb.getNodeCont()),
70 myTLLCont(nb.getTLLogicCont()),
71 myTypesHandler(nb.getTypeCont()),
72 myCurrentEdge(nullptr),
73 myCurrentLane(nullptr),
77 myHaveSeenInternalEdge(false),
82 myWalkingAreas(false),
84 myCheckLaneFoesAll(false),
85 myCheckLaneFoesRoundabout(true) {
90 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
92 for (std::vector<LaneAttrs*>::const_iterator j = ed->
lanes.begin(); j != ed->
lanes.end(); ++j) {
110 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
112 WRITE_ERROR(
"Could not open sumo-net-file '" + *file +
"'.");
121 const double maxSegmentLength = oc.
getFloat(
"geometry.max-segment-length");
122 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
131 if (from ==
nullptr) {
140 WRITE_ERROR(
"Edge's '" + ed->
id +
"' from-node and to-node '" + ed->
toNode +
"' are identical.");
143 if (ed->
shape.size() == 0 && maxSegmentLength > 0) {
152 (
int) ed->
lanes.size(),
170 const bool dismissVclasses = oc.
getBool(
"dismiss-vclasses");
171 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
174 if (nbe ==
nullptr) {
178 for (
int fromLaneIndex = 0; fromLaneIndex < (int) ed->
lanes.size(); ++fromLaneIndex) {
181 const std::vector<Connection>& connections = lane->
connections;
183 if (
myEdges.count(c.toEdgeID) == 0) {
184 WRITE_ERROR(
"Unknown edge '" + c.toEdgeID +
"' given in connection.");
188 if (toEdge ==
nullptr) {
195 bool uncontrolled = c.uncontrolled;
203 true, c.mayDefinitelyPass, c.keepClear, c.contPos, c.visibility, c.speed, c.customShape, uncontrolled, c.permissions);
204 if (c.getParametersMap().size() > 0) {
209 const std::map<std::string, NBTrafficLightDefinition*>& programs =
myTLLCont.
getPrograms(c.tlID);
210 if (programs.size() > 0) {
211 std::map<std::string, NBTrafficLightDefinition*>::const_iterator it;
212 for (it = programs.begin(); it != programs.end(); it++) {
215 tlDef->
addConnection(nbe, toEdge, fromLaneIndex, c.toLaneIdx, c.tlLinkIndex, c.tlLinkIndex2,
false);
217 throw ProcessError(
"Corrupt traffic light definition '" + c.tlID +
"' (program '" + it->first +
"')");
221 WRITE_ERROR(
"The traffic light '" + c.tlID +
"' is not known.");
226 if (!dismissVclasses) {
241 bool stopOffsetSet =
false;
246 if (!stopOffsetSet) {
264 toRemove.push_back(nbe);
267 for (EdgeVector::iterator i = toRemove.begin(); i != toRemove.end(); ++i) {
272 NBEdge* prohibitedFrom =
myEdges[it->prohibitedFrom]->builtEdge;
274 NBEdge* prohibitorFrom =
myEdges[it->prohibitorFrom]->builtEdge;
276 if (prohibitedFrom ==
nullptr) {
277 WRITE_WARNING(
"Edge '" + it->prohibitedFrom +
"' in prohibition was not built");
278 }
else if (prohibitedTo ==
nullptr) {
279 WRITE_WARNING(
"Edge '" + it->prohibitedTo +
"' in prohibition was not built");
280 }
else if (prohibitorFrom ==
nullptr) {
281 WRITE_WARNING(
"Edge '" + it->prohibitorFrom +
"' in prohibition was not built");
282 }
else if (prohibitorTo ==
nullptr) {
283 WRITE_WARNING(
"Edge '" + it->prohibitorTo +
"' in prohibition was not built");
292 oc.
set(
"no-internal-links",
"true");
297 if (oc.
isDefault(
"junctions.corner-detail")) {
303 if (oc.
isDefault(
"rectangular-lane-cut")) {
309 if (oc.
isDefault(
"junctions.limit-turn-speed")) {
322 if (!oc.
getBool(
"no-internal-links")) {
326 for (std::vector<Crossing>::const_iterator it_c = (*it).second.begin(); it_c != (*it).second.end(); ++it_c) {
329 for (std::vector<std::string>::const_iterator it_e = crossing.
crossingEdges.begin(); it_e != crossing.
crossingEdges.end(); ++it_e) {
332 if (edge !=
nullptr) {
333 edges.push_back(edge);
336 if (edges.size() > 0) {
345 std::vector<std::string> edgeIDs;
346 if (item.second.fromEdges.size() + item.second.toEdges.size() == 0) {
348 assert(item.second.fromCrossed.size() > 0);
349 assert(item.second.toCrossed.size() > 0);
350 edgeIDs = item.second.fromCrossed;
351 edgeIDs.insert(edgeIDs.end(), item.second.toCrossed.begin(), item.second.toCrossed.end());
352 }
else if (item.second.fromEdges.size() > 0) {
353 edgeIDs = item.second.fromEdges;
355 edgeIDs = item.second.toEdges;
358 for (std::string edgeID : edgeIDs) {
361 if (edge !=
nullptr) {
362 edges.push_back(edge);
365 if (edges.size() > 0) {
373 for (std::vector<std::string>::const_iterator it_r = it->begin(); it_r != it->end(); ++it_r) {
375 if (edge ==
nullptr) {
377 WRITE_ERROR(
"Unknown edge '" + (*it_r) +
"' in roundabout");
380 roundabout.insert(edge);
502 WRITE_ERROR(
"Unmatched closing tag for tl-logic.");
575 WRITE_ERROR(
"Unknown spreadType '" + lsfS +
"' for edge '" +
id +
"'.");
588 WRITE_ERROR(
"Found lane '" +
id +
"' not within edge element.");
592 if (
id != expectedID) {
593 WRITE_WARNING(
"Renaming lane '" +
id +
"' to '" + expectedID +
"'.");
603 assert(crossings.size() > 0);
648 assert(offsets.size() == 1);
652 std::stringstream ss;
653 ss <<
"Duplicate definition of stopOffset for edge " <<
myCurrentEdge->
id <<
".\nIgnoring duplicate specification.";
661 std::stringstream ss;
662 ss <<
"Duplicate definition of lane's stopOffset on edge " <<
myCurrentEdge->
id <<
".\nIgnoring duplicate specifications.";
694 WRITE_WARNING(
"Unknown node type for junction '" +
id +
"'.");
701 WRITE_ERROR(
"Problems on adding junction '" +
id +
"'.");
743 if (
myEdges.count(fromID) == 0) {
744 WRITE_ERROR(
"Unknown edge '" + fromID +
"' given in connection.");
759 if (allow ==
"" && disallow ==
"") {
768 if (conn.
tlID !=
"") {
774 if ((
int)from->
lanes.size() <= fromLaneIdx) {
775 WRITE_ERROR(
"Invalid lane index '" +
toString(fromLaneIdx) +
"' for connection from '" + fromID +
"'.");
778 from->
lanes[fromLaneIdx]->connections.push_back(conn);
786 for (std::vector<Crossing>::iterator it = crossings.begin(); it != crossings.end(); ++it) {
787 if (conn.
toEdgeID == (*it).edgeID) {
788 if (conn.
tlID !=
"") {
789 (*it).priority =
true;
800 if (fromID == c.edgeID) {
810 std::map<std::string, WalkingAreaParsedCustomShape>::iterator it =
myWACustomShapes.find(fromID);
814 it->second.toEdges.push_back(conn.
toEdgeID);
818 if (conn.
toEdgeID == crossing.edgeID) {
819 it->second.toCrossed.insert(it->second.toCrossed.end(), crossing.crossingEdges.begin(), crossing.crossingEdges.end());
829 it->second.fromEdges.push_back(fromID);
833 if (fromID == crossing.edgeID) {
834 it->second.fromCrossed.insert(it->second.fromCrossed.end(), crossing.crossingEdges.begin(), crossing.crossingEdges.end());
867 assert(edge->
id == edge_id);
868 if ((
int)edge->
lanes.size() <= index) {
869 WRITE_ERROR(
"Unknown lane '" + lane_id +
"' given in succedge.");
872 return edge->
lanes[index];
880 WRITE_ERROR(
"Definition of tl-logic '" + currentTL->
getID() +
"' was not finished.");
892 WRITE_ERROR(
"Unknown traffic light type '" + typeS +
"' for tlLogic '" +
id +
"'.");
909 const std::string&
id = currentTL->
getID();
924 currentTL->
addPhase(duration, state, minDuration, maxDuration, nextPhases, name);
940 result =
new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary);
959 const std::string::size_type div = attr.find(
"->");
960 if (div == std::string::npos) {
961 WRITE_ERROR(
"Missing connection divider in prohibition attribute '" + attr +
"'");
964 from = attr.substr(0, div);
965 to = attr.substr(div + 2);
967 if (from.find(
'_') != std::string::npos) {
968 from = from.substr(0, from.find(
'_'));
970 if (to.find(
'_') != std::string::npos) {
971 to = to.substr(0, to.find(
'_'));
974 if (
myEdges.count(from) == 0) {
975 WRITE_ERROR(
"Unknown edge prohibition '" + from +
"'");
979 WRITE_ERROR(
"Unknown edge prohibition '" + to +
"'");
static const double UNSPECIFIED_OFFSET
unspecified lane offset
const std::vector< std::string > getStringVector(int attr) const
Tries to read given attribute assuming it is a string vector.
@ SUMO_TAG_STOPOFFSET
Information on vClass specific stop offsets at lane end.
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
std::vector< std::string > response
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
std::map< std::string, WalkingAreaParsedCustomShape > myWACustomShapes
Map from walkingArea edge IDs to custom shapes.
double distance
The position at the start of this edge (kilometrage/mileage)
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
const std::map< std::string, NBTrafficLightDefinition * > & getPrograms(const std::string &id) const
Returns all programs for the given tl-id.
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
#define WRITE_WARNING(msg)
static StringBijection< LinkState > LinkStates
link states
@ NODETYPE_DEAD_END_DEPRECATED
std::set< std::string > myRailSignals
list of node id with rail signals (no NBTrafficLightDefinition exists)
static const bool UNSPECIFIED_CONNECTION_UNCONTROLLED
TLS-controlled despite its node controlled not specified.
static void addPhase(const SUMOSAXAttributes &attrs, NBLoadedSUMOTLDef *currentTL)
adds a phase to the traffic lights logic currently build
Describes custom shape for a walking area during parsing.
std::string id
This edge's id.
Importer for networks stored in SUMO format.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
std::string type
the type of this lane
SAX-handler base for SUMO-files.
Instance responsible for building networks.
std::vector< Prohibition > myProhibitions
Loaded prohibitions.
@ SUMO_ATTR_LIMIT_TURN_SPEED
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
std::map< SVCPermissions, double > stopOffsets
This edge's vehicle specific stop offsets (used for lanes, that do not have a specified stopOffset)
void erase(NBDistrictCont &dc, NBEdge *edge)
Removes the given edge from the container (deleting it)
SumoXMLEdgeFunc func
This edge's function.
void setRightOfWay(RightOfWay rightOfWay)
set method for computing right-of-way
@ SUMO_ATTR_CHECKLANEFOES_ALL
@ SUMO_TAG_PARAM
parameter associated to a certain key
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
@ SUMO_ATTR_RECTANGULAR_LANE_CUT
void addEdge(const SUMOSAXAttributes &attrs)
Parses an edge and stores the values in "myCurrentEdge".
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
const std::vector< int > getOptIntVector(int attr, const char *objectid, bool &ok, bool report=true) const
convenience function to avoid the default argument and the template stuff at getOpt<>
void ignore(std::string id)
mark the given edge id as ignored
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
LaneAttrs * myCurrentLane
The currently parsed lanes's definition (to add the shape to)
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
static void setLoaded(const GeoConvHelper &loaded)
sets the coordinate transformation loaded from a location element
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
PositionVector customShape
double contPos
custom position for internal junction on this connection
static bool transformCoordinates(PositionVector &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
LaneAttrs * getLaneAttrsFromID(EdgeAttrs *edge, std::string lane_id)
Parses lane index from lane ID an retrieve lane from EdgeAttrs.
const static int InvalidTlIndex
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
void addPhase(SUMOTime duration, const std::string &state, SUMOTime minDur, SUMOTime maxDur, 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.
int priority
This edge's priority.
static OptionsCont & getOptions()
Retrieves the options.
SumoXMLNodeType getType() const
Returns the type of this node.
void addWalkingAreaShape(EdgeVector edges, const PositionVector &shape)
add custom shape for walkingArea
void setDistance(double distance)
set lane specific speed (negative lane implies set for all lanes)
NIImporter_SUMO(NBNetBuilder &nb)
Constructor.
static bool transformCoordinate(Position &from, bool includeInBoundary=true, GeoConvHelper *from_srs=0)
transforms loaded coordinates handles projections, offsets (using GeoConvHelper) and import of height...
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
void addRoundabout(const SUMOSAXAttributes &attrs)
Parses a roundabout and stores it in myEdgeCont.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
bool myCheckLaneFoesRoundabout
A connection description.
void setLoadedLength(double val)
set loaded length
virtual double getFloat(int id) const =0
Returns the double-value of the named (by its enum-value) attribute.
@ SUMO_TAG_PHASE
a single phase description
@ LINKSTATE_MAJOR
This is an uncontrolled, major link, may pass.
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.
void addSortedLinkFoes(const NBConnection &mayDrive, const NBConnection &mustStop)
add shorted link FOES
static methods for processing the coordinates conversion for the current net
double myLimitTurnSpeed
whether turning speed was limited in the network
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
bool ignoreFilterMatch(NBEdge *edge)
Returns true if this edge matches one of the removal criteria.
NBEdgeCont & getEdgeCont()
Describes the values found in a lane's definition.
virtual FringeType getFringeType(bool &ok) const =0
returns fringe type
@ SUMO_ATTR_ORIG_BOUNDARY
void addStopOffsets(const SUMOSAXAttributes &attrs, bool &ok)
parses stop offsets for the current lane or edge
double speed
custom speed for connection
std::string type
the type of this lane
std::vector< Parameterised * > myLastParameterised
element to receive parameters
@ SUMO_ATTR_NEXT
succesor phase index
bool customShape
Whether this lane has a custom shape.
The representation of a single edge during network building.
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
bool myAmLefthand
whether the loaded network was built for lefthand traffic
static NBLoadedSUMOTLDef * initTrafficLightLogic(const SUMOSAXAttributes &attrs, NBLoadedSUMOTLDef *currentTL)
begins the reading of a traffic lights logic
SVCPermissions permissions
custom permissions for connection
double width
The width of this lane.
NBEdge * builtEdge
The built edge.
void addLane(const SUMOSAXAttributes &attrs)
Parses a lane and stores the values in "myCurrentLane".
void parseProhibitionConnection(const std::string &attr, std::string &from, std::string &to, bool &ok)
parses connection string of a prohibition (very old school)
std::vector< std::vector< std::string > > myRoundabouts
loaded roundabout edges
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
bool keepClear
Whether the junction must be kept clear coming from this connection.
const Position & getPosition() const
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
@ SUMO_TAG_PROHIBITION
prohibition of circulation between two edges
JunctionAttrs myCurrentJunction
The currently parsed junction definition to help in reconstructing crossings.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ SUMO_TAG_NEIGH
begin/end of the description of a neighboring lane
std::map< SVCPermissions, double > stopOffsets
This lane's vehicle specific stop offsets.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
NBNode * getToNode() const
Returns the destination node of the edge.
int tlLinkIndex
The index of this connection within the controlling traffic light.
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file)
void updateParameters(const std::map< std::string, std::string > &mapArg)
Adds or updates all given parameters from the map.
bool myHaveSeenInternalEdge
whether the loaded network contains internal lanes
double visibility
custom foe visibility for connection
double getLaneWidth() const
Returns the default width of lanes of this edge.
std::string oppositeID
This lane's opposite lane.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
bool myRectLaneCut
whether all lanes of an edge should have the same stop line
const std::map< int, double > & getStopOffsets() const
Returns the stopOffset to the end of the edge.
static const SUMOTime UNSPECIFIED_DURATION
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
@ SUMO_TAG_REQUEST
description of a logic request within the junction
std::string allow
This lane's allowed vehicle classes.
@ SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
NBNetBuilder & myNetBuilder
The network builder to fill.
T get(const std::string &str) const
std::string getLaneID(int lane) const
get lane ID
std::set< NBEdge * > EdgeSet
container for unique edges
std::string disallow
This lane's disallowed vehicle classes.
double endOffset
This lane's offset from the intersection.
NIXMLTypesHandler myTypesHandler
The handler for parsing edge types and restrictions.
Describes the values found in an edge's definition and this edge's lanes.
void _loadNetwork(OptionsCont &oc)
load the network
@ SUMO_ATTR_EDGES
the edges of a route
A class that stores a 2D geometrical boundary.
@ SUMO_TAG_EDGE
begin/end of the description of an edge
int myLinkDetail
the level of geometry detail for internal lanes in the loaded network
static GeoConvHelper * loadLocation(const SUMOSAXAttributes &attrs)
Parses network location description and registers it with GeoConveHelper::setLoaded.
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
A point in 2D or 3D with translation and scaling methods.
EdgeAttrs * myCurrentEdge
The currently parsed edge's definition (to add loaded lanes to)
virtual RightOfWay getRightOfWay(bool &ok) const =0
Returns the right-of-way method.
bool hasLaneSpecificStopOffsets() const
whether lanes differ in stopOffsets
PositionVector shape
This edges's shape.
PositionVector customShape
custom shape connection
std::string prohibitorFrom
void addConnection(const SUMOSAXAttributes &attrs)
Parses a connection and saves it into the lane's definition stored in "myCurrentLane".
A storage for options typed value containers)
static const PositionVector EMPTY
empty Vector
Lane & getLaneStruct(int lane)
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
void setCustomShape(const PositionVector &shape)
set the junction shape
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
bool uncontrolled
if set to true, This connection will not be TLS-controlled despite its node being controlled.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
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_SPEED
unspecified lane speed
void setRadius(double radius)
set the turning radius
static void loadNetwork(OptionsCont &oc, NBNetBuilder &nb)
Loads content of the optionally given SUMO file.
std::string streetName
This edge's street name.
std::map< std::string, std::vector< Crossing > > myPedestrianCrossings
The pedestrian crossings found in the network.
@ L2L_VALIDATED
The connection was computed and validated.
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Describes a pedestrian crossing.
@ SUMO_ATTR_RADIUS
The turning radius at an intersection in m.
@ SUMO_TAG_TLLOGIC
a traffic light logic
std::string type
This edge's type.
std::string toEdgeID
The id of the target edge.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag; Parses edge type information.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
double getEndOffset() const
Returns the offset to the destination node.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
int toLaneIdx
The index of the target lane.
@ SUMO_ATTR_STATE
The state of a link.
std::string toNode
The node this edge ends at.
NBNode::Crossing * addCrossing(EdgeVector edges, double width, bool priority, int tlIndex=-1, int tlIndex2=-1, const PositionVector &customShape=PositionVector::EMPTY, bool fromSumoNet=false)
add a pedestrian crossing to this node
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
std::string tlID
The id of the traffic light that controls this connection.
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.
#define PROGRESS_BEGIN_MESSAGE(msg)
std::set< std::string > deprecatedVehicleClassesSeen
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
@ SUMO_ATTR_CONV_BOUNDARY
@ SUMO_TAG_NET
root element of a network file
std::string oppositeID
An opposite lane ID, if given.
void addJunction(const SUMOSAXAttributes &attrs)
Parses a junction and saves it in the node control.
#define PROGRESS_DONE_MESSAGE()
virtual SumoXMLNodeType getNodeType(bool &ok) const =0
Returns the value of the named attribute.
double myNetworkVersion
the loaded network version
const std::string & getProgramID() const
Returns the ProgramID.
NBDistrictCont & getDistrictCont()
Returns a reference the districts container.
@ SUMO_ATTR_RIGHT_OF_WAY
How to compute right of way.
@ SUMO_TAG_CONNECTION
connectio between two lanes
static bool isTrafficLight(SumoXMLNodeType type)
return whether the given type is a traffic light
std::map< SVCPermissions, double > parseStopOffsets(const SUMOSAXAttributes &attrs, bool &ok)
Extract stopOffsets from attributes of stopOffset element.
static const double UNSPECIFIED_WIDTH
unspecified lane width
~NIImporter_SUMO()
Destructor.
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
NBTrafficLightLogicCont & myTLLCont
The node container to fill.
static int addGeometrySegments(PositionVector &from, const PositionVector &cartesian, const double maxLength)
insertion geometry points to ensure maximum segment length between points
std::string prohibitedFrom
double maxSpeed
The maximum velocity allowed on this lane.
bool myWalkingAreas
whether walkingareas must be built
static bool isReadable(std::string path)
Checks whether the given file is readable.
void setFringeType(FringeType fringeType)
set method for computing right-of-way
@ SUMO_ATTR_MAXDURATION
maximum duration of a phase
void addRoundabout(const EdgeSet &roundabout)
add user specified roundabout
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
LaneSpreadFunction lsf
The lane spread function.
double maxSpeed
The maximum velocity allowed on this edge (!!!)
@ SUMO_ATTR_FRINGE
Fringe type of node.
std::vector< std::string > crossingEdges
static std::string getJunctionIDFromInternalEdge(const std::string internalEdge)
return the junction id when given an edge of type internal, crossing or WalkingArea
std::string fromNode
The node this edge starts at.
@ SUMO_ATTR_CROSSING_EDGES
the edges crossed by a pedestrian crossing
virtual SumoXMLEdgeFunc getEdgeFunc(bool &ok) const =0
Returns the value of the named attribute.
Represents a single node (junction) during network building.
std::vector< LaneAttrs * > lanes
This edge's lanes.
bool myCheckLaneFoesAll
whether foe-relationships where checked at lane-level
@ SUMO_TAG_ROUNDABOUT
roundabout defined in junction
bool hasConnectionTo(NBEdge *destEdge, int destLane, int fromLane=-1) const
Retrieves info about a connection to a certain lane of a certain edge.
void addRequest(const SUMOSAXAttributes &attrs)
Parses a reques and saves selected attributes in myCurrentJunction.
int myCornerDetail
the level of corner detail in the loaded network
std::vector< Connection > connections
This lane's connections.
NBLoadedSUMOTLDef * myCurrentTL
The currently parsed traffic light.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
double length
The length of the edge if set explicitly.
Encapsulated SAX-Attributes.
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
void myEndElement(int element)
Called when a closing tag occurs.
const std::string & getID() const
Returns the id.
PositionVector shape
This lane's shape (may be custom)
static Position readPosition(const SUMOSAXAttributes &attrs, const std::string &id, bool &ok)
read position from the given attributes, attribute errors to id
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions=SVC_UNSPECIFIED)
Adds a connection between the specified this edge's lane and an approached one.
void addProhibition(const SUMOSAXAttributes &attrs)
Parses a prohibition and saves it.
std::map< std::string, EdgeAttrs * > myEdges
Loaded edge definitions.
NBNodeCont & myNodeCont
The node container to fill.
bool setStopOffsets(int lane, std::map< int, double > offsets, bool overwrite=false)
set lane and vehicle class specific stopOffset (negative lane implies set for all lanes)
bool wasIgnored(std::string id) const
Returns whether the edge with the id was ignored during parsing.
std::vector< std::string > intLanes
GeoConvHelper * myLocation
The coordinate transformation which was used to build the loaded network.
void setFileName(const std::string &name)
Sets the current file name.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
bool accelRamp
Whether this lane is an acceleration lane.
bool hasLaneSpecificWidth() const
whether lanes differ in width
const std::string & getID() const
Describes the values found in a prohibition.
A loaded (complete) traffic light logic.