 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
58 if (!oc.
isSet(
"output-file")) {
62 std::map<SumoXMLAttr, std::string> attrs;
67 const int cornerDetail = oc.
getInt(
"junctions.corner-detail");
68 if (cornerDetail > 0) {
71 if (!oc.
isDefault(
"junctions.internal-link-detail")) {
74 if (oc.
getBool(
"rectangular-lane-cut")) {
80 if (oc.
getFloat(
"junctions.limit-turn-speed") > 0) {
83 if (!oc.
isDefault(
"check-lane-foes.all")) {
86 if (!oc.
isDefault(
"check-lane-foes.roundabout")) {
103 if (!oc.
getBool(
"no-internal-links")) {
105 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
114 bool noNames = !oc.
getBool(
"output.street-names");
115 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
116 writeEdge(device, *(*i).second, noNames);
124 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
128 const bool includeInternal = !oc.
getBool(
"no-internal-links");
129 if (includeInternal) {
132 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
141 int numConnections = 0;
142 for (std::map<std::string, NBEdge*>::const_iterator it_edge = ec.
begin(); it_edge != ec.
end(); it_edge++) {
143 NBEdge* from = it_edge->second;
144 const std::vector<NBEdge::Connection> connections = from->
getConnections();
145 numConnections += (int)connections.size();
146 for (std::vector<NBEdge::Connection>::const_iterator it_c = connections.begin(); it_c != connections.end(); it_c++) {
150 if (numConnections > 0) {
153 if (includeInternal) {
156 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
163 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
164 NBNode* node = (*i).second;
166 std::vector<NBNode::Crossing*> crossings = node->
getCrossings();
167 for (
auto c : crossings) {
172 for (
const std::string& cID : wa.nextCrossings) {
180 if (nextCrossing.
tlID !=
"") {
192 for (
const std::string& sw : wa.nextSidewalks) {
196 for (
const std::string& sw : wa.prevSidewalks) {
204 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
213 WRITE_WARNING(
"Embedding TAZ-data inside the network is deprecated. Use option --taz-output instead");
214 for (std::map<std::string, NBDistrict*>::const_iterator i = dc.
begin(); i != dc.
end(); i++) {
229 #ifdef DEBUG_OPPOSITE_INTERNAL
235 assert(succOpp != 0);
236 assert(predOpp != 0);
237 const std::vector<NBEdge::Connection>& connections = succOpp->
getConnections();
238 for (std::vector<NBEdge::Connection>::const_iterator it_c = connections.begin(); it_c != connections.end(); it_c++) {
241 && predOpp == conOpp.
toEdge
247 #ifdef DEBUG_OPPOSITE_INTERNAL
250 oppositeLength = conOpp.
length;
281 std::map<std::string, std::string> oppositeLaneID;
282 std::map<std::string, double> oppositeLengths;
283 for (
NBEdge* e : incoming) {
285 double oppositeLength = 0;
287 oppositeLaneID[c.getInternalLaneID()] = op;
289 oppositeLengths[c.id] = oppositeLength;
293 if (oppositeLengths.size() > 0) {
294 for (
NBEdge* e : incoming) {
296 if (oppositeLengths.count(c.id) > 0) {
297 c.length = (c.length + oppositeLengths[c.id]) / 2;
303 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
304 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
305 if (elv.size() > 0) {
306 bool haveVia =
false;
307 std::string edgeID =
"";
309 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
310 if ((*k).toEdge ==
nullptr) {
314 if (edgeID != (*k).id) {
323 if ((*i)->isBidiRail() && (*k).toEdge->isBidiRail() &&
324 (*i) != (*k).toEdge->getTurnDestination(
true)) {
327 0, (*i)->getTurnDestination(
true), 0);
330 WRITE_WARNINGF(
"Could not find bidi-connection for edge '%'", edgeID)
337 const NBEdge::Lane& successor = (*k).toEdge->getLanes()[(*k).toLane];
339 const double width = n.
isConstantWidthTransition() && (*i)->getNumLanes() > (*k).toEdge->getNumLanes() ? (*i)->getLaneWidth((*k).fromLane) : successor.
width;
340 writeLane(into, (*k).getInternalLaneID(), (*k).vmax,
343 std::map<int, double>(), width, (*k).shape, &(*k),
344 (*k).length, (*k).internalLaneIndex, oppositeLaneID[(*k).getInternalLaneID()],
"");
345 haveVia = haveVia || (*k).haveVia;
351 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
355 if ((*k).toEdge ==
nullptr) {
359 const NBEdge::Lane& successor = (*k).toEdge->getLanes()[(*k).toLane];
366 std::map<int, double>(), successor.
width, (*k).viaShape, &(*k),
382 std::map<int, double>(), c->width, c->shape,
nullptr,
383 MAX2(c->shape.length(),
POSITION_EPS), 0,
"",
"",
false, c->customShape.size() != 0);
387 const std::vector<NBNode::WalkingArea>& WalkingAreas = n.
getWalkingAreas();
388 for (std::vector<NBNode::WalkingArea>::const_iterator it = WalkingAreas.begin(); it != WalkingAreas.end(); it++) {
395 std::map<int, double>(), wa.
width, wa.
shape,
nullptr, wa.
length, 0,
"",
"",
false, wa.
hasCustomShape);
439 const std::vector<NBEdge::Lane>& lanes = e.
getLanes();
443 for (
int i = 0; i < (int) lanes.size(); i++) {
445 std::map<int, double> stopOffsets;
464 double startOffset,
double endOffset,
465 std::map<SVCPermissions, double> stopOffsets,
double width,
PositionVector shape,
467 const std::string& oppositeID,
468 const std::string& type,
469 bool accelRamp,
bool customShape) {
481 WRITE_WARNINGF(
"Lane '%' has a maximum allowed speed of 0.", lID);
482 }
else if (speed < 0) {
483 throw ProcessError(
"Negative allowed speed (" +
toString(speed) +
") on lane '" + lID +
"', use --speed.minimum to prevent this.");
499 if (endOffset > 0 || startOffset > 0) {
500 if (startOffset + endOffset < shape.
length()) {
515 if (stopOffsets.size() != 0) {
519 if (oppositeID !=
"" && oppositeID !=
"-") {
525 if (params !=
nullptr) {
540 std::string incLanes;
542 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
543 int noLanes = (*i)->getNumLanes();
544 for (
int j = 0; j < noLanes; j++) {
545 incLanes += (*i)->getLaneID(j);
546 if (i != incoming.end() - 1 || j < noLanes - 1) {
551 std::vector<NBNode::Crossing*> crossings = n.
getCrossings();
552 std::set<std::string> prevWAs;
554 for (
auto c : crossings) {
555 if (prevWAs.count(c->prevWalkingArea) == 0) {
556 incLanes +=
' ' + c->prevWalkingArea +
"_0";
557 prevWAs.insert(c->prevWalkingArea);
562 std::string intLanes;
565 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
566 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
567 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
568 if ((*k).toEdge ==
nullptr) {
575 intLanes += (*k).getInternalLaneID();
577 intLanes += (*k).viaID +
"_0";
584 for (
auto c : crossings) {
585 intLanes +=
' ' + c->id +
"_0";
619 std::vector<std::string> internalLaneIDs;
620 std::map<std::string, std::string> viaIDs;
621 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
622 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
623 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
624 if ((*k).toEdge !=
nullptr) {
625 internalLaneIDs.push_back((*k).getInternalLaneID());
626 viaIDs[(*k).getInternalLaneID()] = ((*k).viaID);
631 internalLaneIDs.push_back(c->id +
"_0");
634 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
635 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
636 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
637 if ((*k).toEdge ==
nullptr || !(*k).haveVia) {
644 std::string incLanes = (*k).getInternalLaneID();
645 std::vector<std::string> foeIDs;
646 for (std::string incLane : (*k).foeIncomingLanes) {
647 incLanes +=
" " + incLane;
648 if (incLane[0] ==
':' && viaIDs[incLane] !=
"") {
650 foeIDs.push_back(viaIDs[incLane] +
"_0");
654 const std::vector<int>& foes = (*k).foeInternalLinks;
655 for (std::vector<int>::const_iterator it = foes.begin(); it != foes.end(); ++it) {
656 foeIDs.push_back(internalLaneIDs[*it]);
706 if (style !=
PLAIN) {
707 if (includeInternal) {
739 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
741 const std::vector<NBEdge::Connection>& connections = from->
getConnections();
742 for (std::vector<NBEdge::Connection>::const_iterator j = connections.begin(); j != connections.end(); ++j) {
748 std::string tlID =
"";
769 const std::string& from,
const std::string& to,
770 int fromLane,
int toLane,
const std::string& via,
795 std::vector<std::vector<std::string> > edgeIDs;
796 for (std::set<EdgeSet>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
797 std::vector<std::string> tEdgeIDs;
798 for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
801 tEdgeIDs.push_back((*j)->getID());
803 std::sort(tEdgeIDs.begin(), tEdgeIDs.end());
804 edgeIDs.push_back(tEdgeIDs);
806 std::sort(edgeIDs.begin(), edgeIDs.end());
808 for (std::vector<std::vector<std::string> >::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
811 if (roundabouts.size() != 0) {
820 std::vector<std::string> validEdgeIDs;
821 std::vector<std::string> invalidEdgeIDs;
822 std::vector<std::string> nodeIDs;
823 for (std::vector<std::string>::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
825 if (edge !=
nullptr) {
827 validEdgeIDs.push_back(edge->
getID());
829 invalidEdgeIDs.push_back(*i);
832 std::sort(nodeIDs.begin(), nodeIDs.end());
833 if (validEdgeIDs.size() > 0) {
838 if (invalidEdgeIDs.size() > 0) {
840 +
joinToString(invalidEdgeIDs,
" ") +
"' no longer exist'");
859 for (
int i = 0; i < (int)sources.size(); i++) {
866 for (
int i = 0; i < (int)sinks.size(); i++) {
879 if (time == std::floor(time)) {
889 for (NBConnectionProhibits::const_iterator j = prohibitions.begin(); j != prohibitions.end(); j++) {
892 for (NBConnectionVector::const_iterator k = prohibiting.begin(); k != prohibiting.end(); k++) {
911 std::vector<NBTrafficLightLogic*> logics = tllCont.
getComputed();
912 for (std::vector<NBTrafficLightLogic*>::iterator it = logics.begin(); it != logics.end(); it++) {
919 const bool varPhaseLength = (*it)->getType() !=
TLTYPE_STATIC;
920 const std::vector<NBTrafficLightLogic::PhaseDefinition>& phases = (*it)->getPhases();
921 for (std::vector<NBTrafficLightLogic::PhaseDefinition>::const_iterator j = phases.begin(); j != phases.end(); ++j) {
928 if (varPhaseLength) {
939 if (j->next.size() > 0) {
945 (*it)->writeParams(into);
948 if (logics.size() > 0) {
956 if (stopOffsets.size() == 0) {
959 assert(stopOffsets.size() == 1);
960 std::pair<int, double> offset = *stopOffsets.begin();
962 if (ss_vclasses.length() == 0) {
968 if (ss_vclasses.length() <= ss_exceptions.length()) {
971 if (ss_exceptions.length() == 0) {
static void writeLocation(OutputDevice &into)
writes the location element
std::string tlID
The id of the traffic light that controls this connection.
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
static const double UNSPECIFIED_OFFSET
unspecified lane offset
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_STOPOFFSET
Information on vClass specific stop offsets at lane end.
static void writeEdge(OutputDevice &into, const NBEdge &e, bool noNames)
Writes an edge (<edge ...)
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
NBEdge * toEdge
The edge the connections yields in.
double speed
The speed allowed on this lane.
static void writeTrafficLights(OutputDevice &into, const NBTrafficLightLogicCont &tllCont)
writes the traffic light logics to the given device
bool haveVia
check if Connection have a Via
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
PositionVector shape
The polygonal shape.
double length
computed length (average of all internal lane shape lengths that share an internal edge)
#define WRITE_WARNING(msg)
An upper class for objects with additional parameters.
const std::vector< NBEdge * > & getSourceEdges() const
Returns the sources.
Storage for edges, including some functionality operating on multiple edges.
const std::vector< double > & getSourceWeights() const
Returns the weights of the sources.
std::string type
the type of this lane
std::map< std::string, NBDistrict * >::const_iterator begin() const
Returns the pointer to the begin of the stored districts.
Instance responsible for building networks.
const std::vector< NBEdge * > & getSinkEdges() const
Returns the sinks.
PositionVector simplified() const
return the same shape with intermediate colinear points removed
A container for traffic light definitions and built programs.
@ SUMO_ATTR_LIMIT_TURN_SPEED
Static storage of an output device and its base (abstract) implementation.
const double NETWORK_VERSION
version for written networks and default version for loading
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Connection getConnection(int fromLane, const NBEdge *to, int toLane) const
Returns the specified connection This method goes through "myConnections" and returns the specified o...
bool uncontrolled
check if Connection is uncontrolled
@ SUMO_ATTR_CHECKLANEFOES_ALL
@ SUMO_ATTR_RECTANGULAR_LANE_CUT
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
bool hasCustomShape
whether this walkingArea has a custom shape
static std::string prohibitionConnection(const NBConnection &c)
the attribute value for a prohibition
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
double contPos
custom position for internal junction on this connection
static void normaliseSum(std::vector< T > &v, T msum=1.0)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static void writeJunction(OutputDevice &into, const NBNode &n)
Writes a junction (<junction ...)
static bool writeInternalEdges(OutputDevice &into, const NBEdgeCont &ec, const NBNode &n)
Writes internal edges (<edge ... with id[0]==':') of the given node.
void setPrecision(int precision=gPrecision)
Sets the precison or resets it to default.
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
@ SUMO_TAG_LANE
begin/end of the description of a single lane
NBEdge * getFrom() const
returns the from-edge (start of the connection)
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
const std::vector< double > & getSinkWeights() const
Returns the weights of the sinks.
const static int InvalidTlIndex
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
NBEdge * getTo() const
returns the to-edge (end of the connection)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
SumoXMLNodeType getType() const
Returns the type of this node.
int getPriority() const
Returns the priority of the edge.
static void writeLane(OutputDevice &into, const std::string &lID, double speed, SVCPermissions permissions, SVCPermissions preferred, double startOffset, double endOffset, std::map< SVCPermissions, double > stopOffsets, double width, PositionVector shape, const Parameterised *params, double length, int index, const std::string &oppositeID, const std::string &type, bool accelRamp=false, bool customShape=false)
Writes a lane (<lane ...) of an edge.
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
double length() const
Returns the length.
bool getKeepClear() const
Returns the keepClear flag.
#define WRITE_WARNINGF(...)
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
bool isConstantWidthTransition() const
detects whether a given junction splits or merges lanes while keeping constant road width
int tlLinkIndex
The index of this connection within the controlling traffic light.
@ SUMO_TAG_PHASE
a single phase description
@ LINKSTATE_MAJOR
This is an uncontrolled, major link, may pass.
A definition of a pedestrian walking area.
void close()
Closes the device and removes it from the dictionary.
A container for districts.
@ LINKDIR_NODIR
The link has no direction (is a dead end link)
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
bool writeLogic(OutputDevice &into) const
writes the XML-representation of the logic as a bitset-logic XML representation
@ SUMO_ATTR_DIR
The abstract direction of a link.
@ SUMO_ATTR_CHECKLANEFOES_ROUNDABOUT
NBEdgeCont & getEdgeCont()
Container for nodes during the netbuilding process.
int fromLane
The lane the connections starts at.
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a SUMO-file.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
@ SUMO_ATTR_NEXT
succesor phase index
The representation of a single edge during network building.
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static void writeProhibitions(OutputDevice &into, const NBConnectionProhibits &prohibitions)
writes the given prohibitions
double speed
custom speed for connection
int toLane
The lane the connections yields in.
const Position & getPosition() const
@ SUMO_TAG_PROHIBITION
prohibition of circulation between two edges
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
static std::string getOppositeInternalID(const NBEdgeCont &ec, const NBEdge *from, const NBEdge::Connection &con, double &oppositeLength)
retrieve the id of the opposite direction internal lane if it exists
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
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
@ LINKDIR_STRAIGHT
The link is a straight direction.
static std::string writeSUMOTime(SUMOTime time)
writes a SUMOTime as int if possible, otherwise as a float
NBNode * getToNode() const
Returns the destination node of the edge.
static bool writeInternalNodes(OutputDevice &into, const NBNode &n)
Writes internal junctions (<junction with id[0]==':' ...) of the given node.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
static void writeRoundabout(OutputDevice &into, const std::vector< std::string > &r, const NBEdgeCont &ec)
Writes a roundabout.
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
static void writeConnection(OutputDevice &into, const NBEdge &from, const NBEdge::Connection &c, bool includeInternal, ConnectionStyle style=SUMONET, bool geoAccuracy=false)
Writes connections outgoing from the given edge (also used in NWWriter_XML)
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_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
std::string getDescription(const NBEdge *parent) const
get string describing this connection
double getRadius() const
Returns the turning radius of this node.
std::string getLaneID(int lane) const
get lane ID
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
bool priority
whether the pedestrians have priority
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_TAG_EDGE
begin/end of the description of an edge
bool hasLoadedLength() const
Returns whether a length was set explicitly.
std::map< int, double > stopOffsets
stopOffsets.second - The stop offset for vehicles stopping at the lane's end. Applies if vClass is in...
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
A point in 2D or 3D with translation and scaling methods.
A storage for options typed value containers)
double width
This lane's width.
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
static const double UNSPECIFIED_SPEED
unspecified lane speed
static bool writeInternalConnections(OutputDevice &into, const NBNode &n)
Writes inner connections within the node.
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
std::vector< Crossing * > getCrossings() const
return this junctions pedestrian crossings
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
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.
bool hasCustomShape() const
return whether the shape was set by the user
std::vector< NBTrafficLightLogic * > getComputed() const
Returns a list of all computed logics.
const std::string & getStreetName() const
Returns the street name of this edge.
@ SUMO_ATTR_RADIUS
The turning radius at an intersection in m.
@ SUMO_TAG_TLLOGIC
a traffic light logic
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
@ SUMO_TAG_TAZ
a traffic assignment zone
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::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const PositionVector & getShape() const
retrieve the junction shape
PositionVector customShape
A custom shape for this lane set by the user.
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_ATTR_STATE
The state of a link.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
void writeTypes(OutputDevice &into) const
writes all types a s XML
int tlLinkIndex
the traffic light index of this crossing (if controlled)
std::string id
id of Connection
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
NBTrafficLightLogicCont & getTLLogicCont()
Returns a reference to the traffic light logics container.
std::string viaID
if Connection have a via, ID of it
An (internal) definition of a single lane of an edge.
FringeType getFringeType() const
Returns fringe type.
double width
This lane's width.
bool keepClear
whether the junction must be kept clear when using this connection
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
std::string oppositeID
An opposite lane ID, if given.
static const double UNSPECIFIED_RADIUS
unspecified lane width
void lf()
writes a line feed if applicable
std::vector< NBConnection > NBConnectionVector
Definition of a connection vector.
NBDistrictCont & getDistrictCont()
Returns a reference the districts container.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
@ SUMO_ATTR_RIGHT_OF_WAY
How to compute right of way.
@ SUMO_TAG_CONNECTION
connectio between two lanes
static void writeDistrict(OutputDevice &into, const NBDistrict &d)
Writes a district.
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
static const double UNSPECIFIED_WIDTH
unspecified lane width
PositionVector customShape
custom shape for connection
static void writeStopOffsets(OutputDevice &into, const std::map< SVCPermissions, double > &stopOffsets)
Write a stopOffset element into output device.
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
double getFinalLength() const
get length that will be assigned to the lanes in the final network
double length
This lane's width.
const std::string & getTypeID() const
get ID of type
@ SUMO_ATTR_MAXDURATION
maximum duration of a phase
bool accelRamp
Whether this lane is an acceleration lane.
static void writePositionLong(const Position &pos, OutputDevice &dev)
Writes the given position to device in long format (one attribute per dimension)
std::string getInternalLaneID() const
get ID of internal lane
static void writeInternalConnection(OutputDevice &into, const std::string &from, const std::string &to, int fromLane, int toLane, const std::string &via, LinkDirection dir=LINKDIR_STRAIGHT, const std::string &tlID="", int linkIndex=NBConnection::InvalidTlIndex)
Writes a single internal connection.
std::map< std::string, NBDistrict * >::const_iterator end() const
Returns the pointer to the end of the stored districts.
@ SUMO_ATTR_FRINGE
Fringe type of node.
static void writeRoundabouts(OutputDevice &into, const std::set< EdgeSet > &roundabouts, const NBEdgeCont &ec)
Writes roundabouts.
double endOffset
This lane's offset to the intersection begin.
PositionVector shape
The lane's shape.
@ SUMO_ATTR_CROSSING_EDGES
the edges crossed by a pedestrian crossing
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >())
Writes an XML header with optional configuration.
Represents a single node (junction) during network building.
@ SUMO_TAG_ROUNDABOUT
roundabout defined in junction
NBNodeCont & getNodeCont()
Returns a reference to the node container.
A definition of a pedestrian crossing.
A structure which describes a connection between edges or lanes.
NBTypeCont & getTypeCont()
Returns a reference to the type container.
double visibility
custom foe visiblity for connection
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
int internalLaneIndex
The lane index of this internal lane within the internal edge.
RightOfWay getRightOfWay() const
Returns hint on how to compute right of way.
const std::string & getID() const
Returns the id.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
std::string tlID
The id of the traffic light that controls this connection.
const std::vector< Connection > & getConnections() const
Returns the connections.
A class representing a single district.
NBNode * getFromNode() const
Returns the origin node of the edge.
std::string id
the (edge)-id of this walkingArea
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
int size() const
Returns the number of districts inside the container.
const PositionVector & getShape() const
Returns the shape.
double getDistance() const
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
@ SUMO_ATTR_NODES
a list of node ids, used for controlling joining
NBEdge * getTurnDestination(bool possibleDestination=false) const
const std::string & getID() const
OutputDevice & writePadding(const std::string &val)
writes padding (ignored for binary output)