58 if (!oc.
isSet(
"output-file")) {
62 std::map<SumoXMLAttr, std::string> attrs;
66 }
else if (oc.
getBool(
"lefthand")) {
72 const int cornerDetail = oc.
getInt(
"junctions.corner-detail");
73 if (cornerDetail > 0) {
76 if (!oc.
isDefault(
"junctions.internal-link-detail")) {
79 if (oc.
getBool(
"rectangular-lane-cut")) {
85 if (oc.
getFloat(
"junctions.limit-turn-speed") > 0) {
88 if (!oc.
isDefault(
"check-lane-foes.all")) {
91 if (!oc.
isDefault(
"check-lane-foes.roundabout")) {
94 if (!oc.
isDefault(
"tls.ignore-internal-junction-jam")) {
100 if (oc.
exists(
"geometry.avoid-overlap") && !oc.
getBool(
"geometry.avoid-overlap")) {
103 if (oc.
exists(
"junctions.higher-speed") && oc.
getBool(
"junctions.higher-speed")) {
106 if (oc.
exists(
"internal-junctions.vehicle-width") && !oc.
isDefault(
"internal-junctions.vehicle-width")) {
109 if (!oc.
isDefault(
"junctions.minimal-shape")) {
112 if (!oc.
isDefault(
"junctions.endpoint-shape")) {
130 if (!oc.
getBool(
"no-internal-links")) {
132 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
141 bool noNames = !oc.
getBool(
"output.street-names");
142 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
143 writeEdge(device, *(*i).second, noNames, defaultSpread);
151 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
155 const bool includeInternal = !oc.
getBool(
"no-internal-links");
156 if (includeInternal) {
159 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
168 int numConnections = 0;
169 for (std::map<std::string, NBEdge*>::const_iterator it_edge = ec.
begin(); it_edge != ec.
end(); it_edge++) {
170 NBEdge* from = it_edge->second;
171 const std::vector<NBEdge::Connection>& connections = from->
getConnections();
172 numConnections += (int)connections.size();
177 if (numConnections > 0) {
180 if (includeInternal) {
183 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
190 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
194 for (
auto c : crossings) {
199 for (
const std::string& cID : wa.nextCrossings) {
207 if (nextCrossing.
tlID !=
"") {
219 for (
const std::string& sw : wa.nextSidewalks) {
223 for (
const std::string& sw : wa.prevSidewalks) {
231 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
240 WRITE_WARNING(
TL(
"Embedding TAZ-data inside the network is deprecated. Use option --taz-output instead"));
241 for (std::map<std::string, NBDistrict*>::const_iterator i = dc.
begin(); i != dc.
end(); i++) {
256#ifdef DEBUG_OPPOSITE_INTERNAL
262 assert(succOpp != 0);
263 assert(predOpp != 0);
264 const std::vector<NBEdge::Connection>& connections = succOpp->
getConnections();
265 for (std::vector<NBEdge::Connection>::const_iterator it_c = connections.begin(); it_c != connections.end(); it_c++) {
268 && predOpp == conOpp.
toEdge
274#ifdef DEBUG_OPPOSITE_INTERNAL
277 oppositeLength = conOpp.
length;
308 std::map<std::string, std::string> oppositeLaneID;
309 std::map<std::string, double> oppositeLengths;
310 for (
NBEdge* e : incoming) {
312 double oppositeLength = 0;
314 oppositeLaneID[c.getInternalLaneID()] = op;
316 oppositeLengths[c.id] = oppositeLength;
320 if (oppositeLengths.size() > 0) {
321 for (
NBEdge* e : incoming) {
323 if (oppositeLengths.count(c.id) > 0) {
324 c.length = (c.length + oppositeLengths[c.id]) / 2;
330 for (
NBEdge* e : incoming) {
331 const std::vector<NBEdge::Connection>& elv = e->getConnections();
332 if (elv.size() > 0) {
333 bool haveVia =
false;
334 std::string edgeID =
"";
335 double bidiLength = -1;
338 if (k.toEdge ==
nullptr) {
342 if (edgeID != k.id) {
351 if (k.edgeType !=
"") {
355 if (e->getBidiEdge() && k.toEdge->getBidiEdge() &&
356 e != k.toEdge->getTurnDestination(
true)) {
358 if (bidiEdge !=
"") {
366 const NBEdge::Lane& successor = k.toEdge->getLanes()[k.toLane];
368 successor.
permissions & e->getPermissions(k.fromLane));
371 const double width = e->getInternalLaneWidth(n, k, successor,
false);
372 const double length = bidiLength > 0 ? bidiLength : k.length;
373 writeLane(into, k.getInternalLaneID(), k.vmax, k.friction,
375 changeLeft, changeRight,
378 length, k.internalLaneIndex, oppositeLaneID[k.getInternalLaneID()],
"");
379 haveVia = haveVia || k.haveVia;
385 std::string viaEdgeID =
"";
390 if (k.toEdge ==
nullptr) {
394 if (viaEdgeID != k.viaID) {
395 if (viaEdgeID !=
"") {
404 if (k.edgeType !=
"") {
408 const NBEdge::Lane& successor = k.toEdge->getLanes()[k.toLane];
410 successor.
permissions & e->getPermissions(k.fromLane));
411 const double width = e->getInternalLaneWidth(n, k, successor,
true);
412 writeLane(into, k.getInternalViaLaneID(), k.vmax, k.friction, permissions, successor.
preferred,
416 MAX2(k.viaLength, POSITION_EPS),
417 k.internalViaLaneIndex,
"",
"");
431 MAX2(c->shape.length(), POSITION_EPS), 0,
"",
"",
false, c->customShape.size() != 0, c->outlineShape);
440 StopOffset(), wa.width, wa.shape,
nullptr, wa.length, 0,
"",
"",
false, wa.hasCustomShape);
452 if (cons.size() > 0) {
454 length = (k.
length + cons.back().length) / 2;
455 return cons.back().id;
463 if (k2.shape.almostSame(rShape, POSITION_EPS)) {
464 length = (c.length + k2.length) / 2;
516 const std::vector<NBEdge::Lane>& lanes = e.
getLanes();
523 for (
int i = 0; i < (int) lanes.size(); i++) {
544 double speed,
double friction,
547 double startOffset,
double endOffset,
550 const std::string& oppositeID,
551 const std::string& type,
552 bool accelRamp,
bool customShape,
581 if (endOffset > 0 || startOffset > 0) {
582 startOffset =
MIN2(startOffset, shape.
length() - POSITION_EPS);
583 endOffset =
MIN2(endOffset, shape.
length() - startOffset - POSITION_EPS);
584 assert(startOffset + endOffset < shape.
length());
600 if (outlineShape.size() != 0) {
604 if (oppositeID !=
"" && oppositeID !=
"-") {
610 if (params !=
nullptr) {
625 std::vector<std::string> incLanes;
627 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
628 int noLanes = (*i)->getNumLanes();
629 for (
int j = 0; j < noLanes; j++) {
630 incLanes.push_back((*i)->getLaneID(j));
633 std::vector<NBNode::Crossing*> crossings = n.
getCrossings();
634 std::set<std::string> prevWAs;
636 for (
auto c : crossings) {
637 if (prevWAs.count(c->prevWalkingArea) == 0) {
638 incLanes.push_back(c->prevWalkingArea +
"_0");
639 prevWAs.insert(c->prevWalkingArea);
644 std::vector<std::string> intLanes;
646 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
647 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
648 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
649 if ((*k).toEdge ==
nullptr) {
653 intLanes.push_back((*k).getInternalLaneID());
655 intLanes.push_back((*k).getInternalViaLaneID());
661 for (
auto c : crossings) {
662 intLanes.push_back(c->id +
"_0");
702 std::vector<std::string> internalLaneIDs;
703 std::map<std::string, std::string> viaIDs;
704 for (
const NBEdge* in : incoming) {
705 for (
const auto& con : in->getConnections()) {
706 if (con.toEdge !=
nullptr) {
707 internalLaneIDs.push_back(con.getInternalLaneID());
708 if (con.viaID !=
"") {
709 viaIDs[con.getInternalLaneID()] = (con.getInternalViaLaneID());
715 internalLaneIDs.push_back(c->id +
"_0");
718 for (
const NBEdge* in : incoming) {
719 for (
const auto& con : in->getConnections()) {
720 if (con.toEdge ==
nullptr || !con.haveVia) {
727 std::string incLanes = con.getInternalLaneID();
728 std::vector<std::string> foeIDs;
729 for (std::string incLane : con.foeIncomingLanes) {
730 if (incLane[0] ==
':') {
733 incLane = internalLaneIDs[index];
734 if (viaIDs[incLane] !=
"") {
735 foeIDs.push_back(viaIDs[incLane]);
738 incLanes +=
" " + incLane;
741 const std::vector<int>& foes = con.foeInternalLinks;
742 for (
int foe : foes) {
743 foeIDs.push_back(internalLaneIDs[foe]);
756 bool includeInternal,
ConnectionStyle style,
bool useGeo,
bool geoAccuracy) {
757 assert(c.
toEdge !=
nullptr);
780 if (includeInternal) {
830 assert(c.toEdge != 0);
833 std::string tlID =
"";
836 linkIndex2 = c.tlLinkIndex2;
839 writeInternalConnection(into, c.id, c.toEdge->getID(), c.internalLaneIndex, c.toLane, c.getInternalViaLaneID(), dir, tlID, linkIndex2,
false, c.visibility);
855 const std::string& from,
const std::string& to,
856 int fromLane,
int toLane,
const std::string& via,
858 const std::string& tlID,
int linkIndex,
887 std::vector<std::vector<std::string> > edgeIDs;
888 for (std::set<EdgeSet>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
889 std::vector<std::string> tEdgeIDs;
890 for (EdgeSet::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
893 tEdgeIDs.push_back((*j)->getID());
895 std::sort(tEdgeIDs.begin(), tEdgeIDs.end());
896 edgeIDs.push_back(tEdgeIDs);
898 std::sort(edgeIDs.begin(), edgeIDs.end());
900 for (std::vector<std::vector<std::string> >::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
903 if (roundabouts.size() != 0) {
912 std::vector<std::string> validEdgeIDs;
913 std::vector<std::string> invalidEdgeIDs;
914 std::vector<std::string> nodeIDs;
915 for (std::vector<std::string>::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
917 if (edge !=
nullptr) {
919 validEdgeIDs.push_back(edge->
getID());
921 invalidEdgeIDs.push_back(*i);
924 std::sort(nodeIDs.begin(), nodeIDs.end());
925 if (validEdgeIDs.size() > 0) {
930 if (invalidEdgeIDs.size() > 0) {
932 +
joinToString(invalidEdgeIDs,
" ") +
"' no longer exist'");
951 for (
int i = 0; i < (int)sources.size(); i++) {
958 for (
int i = 0; i < (int)sinks.size(); i++) {
971 if (time == std::floor(time)) {
981 for (NBConnectionProhibits::const_iterator j = prohibitions.begin(); j != prohibitions.end(); j++) {
988 for (NBConnectionVector::const_iterator k = prohibiting.begin(); k != prohibiting.end(); k++) {
1011 std::vector<NBTrafficLightLogic*> logics = tllCont.
getComputed();
1016 assert(def !=
nullptr);
1019 if (logics.size() > 0) {
1038 nodePos.push_back(pos);
1074 if (ss_vclasses.length() == 0) {
1080 if (ss_vclasses.length() <= ss_exceptions.length()) {
1083 if (ss_exceptions.length() == 0) {
1102 for (
int i = 0; i < (int) shape.size(); i++) {
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::map< NBConnection, NBConnectionVector > NBConnectionProhibits
Definition of a container for connection block dependencies Includes a list of all connections which ...
std::vector< NBConnection > NBConnectionVector
Definition of a connection vector.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
constexpr SUMOTime TIME2STEPS(double x)
const SVCPermissions SVCAll
all VClasses are allowed
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
void writePermissions(OutputDevice &into, SVCPermissions permissions)
writes allowed disallowed attributes if needed;
void writePreferences(OutputDevice &into, SVCPermissions preferred)
writes allowed disallowed attributes if needed;
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_PEDESTRIAN
pedestrian
@ SUMO_TAG_PHASE
a single phase description
@ SUMO_TAG_STOPOFFSET
Information on vClass specific stop offsets at lane end.
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ 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_TAZSOURCE
a source within a district (connection road)
@ 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...
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
@ STRAIGHT
The link is a straight direction.
@ NODIR
The link has no direction (is a dead end link)
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.
@ LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_JUNCTIONS_MINIMAL_SHAPE
@ SUMO_ATTR_NODES
a list of node ids, used for controlling joining
@ 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_ROUNDABOUT
Roundabout type of node.
@ 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_OUTLINESHAPE
edge: the outline shape in xml-definition
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
@ SUMO_ATTR_CROSSING_EDGES
the edges crossed by a pedestrian crossing
@ SUMO_ATTR_DIR
The abstract direction of a link.
@ 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)
const MMVersion NETWORK_VERSION(1, 20)
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static methods for processing the coordinates conversion for the current net
static void writeLocation(OutputDevice &into)
writes the location element
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
void cartesian2geo(Position &cartesian) const
Converts the given cartesian (shifted) position to its geo (lat/long) representation.
NBEdge * getFrom() const
returns the from-edge (start of the connection)
static const int InvalidTlIndex
NBEdge * getTo() const
returns the to-edge (end of the connection)
A container for districts.
std::map< std::string, NBDistrict * >::const_iterator end() const
Returns the pointer to the end of the stored districts.
std::map< std::string, NBDistrict * >::const_iterator begin() const
Returns the pointer to the begin of the stored districts.
int size() const
Returns the number of districts inside the container.
A class representing a single district.
const std::vector< double > & getSourceWeights() const
Returns the weights of the sources.
const std::vector< double > & getSinkWeights() const
Returns the weights of the sinks.
const PositionVector & getShape() const
Returns the shape.
const std::vector< NBEdge * > & getSinkEdges() const
Returns the sinks.
const std::vector< NBEdge * > & getSourceEdges() const
Returns the sources.
Storage for edges, including some functionality operating on multiple edges.
const std::set< EdgeSet > getRoundabouts() const
Returns the determined roundabouts.
std::map< std::string, NBEdge * >::const_iterator begin() const
Returns the pointer to the begin of the stored edges.
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
std::map< std::string, NBEdge * >::const_iterator end() const
Returns the pointer to the end of the stored edges.
std::set< std::string > getUsedTypes() const
return all edge types in used
The representation of a single edge during network building.
const std::vector< Connection > & getConnections() const
Returns the connections.
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
NBNode * getToNode() const
Returns the destination node of the edge.
static const double UNSPECIFIED_FRICTION
unspecified lane friction
const PositionVector & getGeometry() const
Returns the geometry of the edge.
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
bool hasLoadedLength() const
Returns whether a length was set explicitly.
const std::string & getRoutingType() const
return whether this edge should be a bidi edge
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
const std::string & getID() const
double getDistance() const
get distance
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
const StopOffset & getEdgeStopOffset() const
Returns the stopOffset to the end of the edge.
int getNumLanes() const
Returns the number of lanes.
std::vector< Connection > getConnectionsFromLane(int lane, const NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
static const double UNSPECIFIED_CONTPOS
unspecified internal junction position
static const double UNSPECIFIED_VISIBILITY_DISTANCE
unspecified foe visibility for connections
std::string getLaneID(int lane) const
get lane ID
static const double UNSPECIFIED_SPEED
unspecified lane speed
int getJunctionPriority(const NBNode *const node) const
Returns the junction priority (normalised for the node currently build)
const std::string & getTypeID() const
get ID of type
const std::string & getStreetName() const
Returns the street name of this edge.
const NBEdge * getBidiEdge() const
NBNode * getFromNode() const
Returns the origin node of the edge.
NBEdge * getTurnDestination(bool possibleDestination=false) const
bool hasDefaultGeometry() const
Returns whether the geometry consists only of the node positions.
int getPriority() const
Returns the priority of the edge.
static const double UNSPECIFIED_WIDTH
unspecified lane width
double getEndOffset() const
Returns the offset to the destination node.
static const double UNSPECIFIED_OFFSET
unspecified lane offset
bool isMacroscopicConnector() const
Returns whether this edge was marked as a macroscopic connector.
double getFinalLength() const
get length that will be assigned to the lanes in the final network
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
Instance responsible for building networks.
NBNodeCont & getNodeCont()
Returns a reference to the node container.
NBEdgeCont & getEdgeCont()
NBDistrictCont & getDistrictCont()
Returns a reference the districts container.
NBTypeCont & getTypeCont()
Returns a reference to the type container.
NBTrafficLightLogicCont & getTLLogicCont()
Returns a reference to the traffic light logics container.
A definition of a pedestrian crossing.
int tlLinkIndex
the traffic light index of this crossing (if controlled)
std::string tlID
The id of the traffic light that controls this connection.
bool priority
whether the pedestrians have priority
Container for nodes during the netbuilding process.
std::map< std::string, NBNode * >::const_iterator begin() const
Returns the pointer to the begin of the stored nodes.
std::map< std::string, NBNode * >::const_iterator end() const
Returns the pointer to the end of the stored nodes.
Represents a single node (junction) during network building.
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
RightOfWay getRightOfWay() const
Returns hint on how to compute right of way.
LinkState getLinkState(const NBEdge *incoming, const NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
static const double UNSPECIFIED_RADIUS
unspecified lane width
FringeType getFringeType() const
Returns fringe type.
SumoXMLNodeType getType() const
Returns the type of this node.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
bool brakeForCrossingOnExit(const NBEdge *to, LinkDirection dir, bool indirect) const
whether a connection to the given edge must brake for a crossing when leaving the intersection
bool hasCustomShape() const
return whether the shape was set by the user
std::vector< Crossing * > getCrossings() const
return this junctions pedestrian crossings
const std::string & getName() const
Returns intersection name.
bool writeLogic(OutputDevice &into) const
writes the XML-representation of the logic as a bitset-logic XML representation
const Position & getPosition() const
const PositionVector & getShape() const
retrieve the junction shape
RoundaboutType getRoundaboutType() const
Returns roundabout type.
double getRadius() const
Returns the turning radius of this node.
const std::vector< WalkingArea > & getWalkingAreas() const
return this junctions pedestrian walking areas
The base class for traffic light logic definitions.
const std::vector< NBNode * > & getNodes() const
Returns the list of controlled nodes.
virtual void finalChecks() const
perform optional final checks
static const SUMOTime UNSPECIFIED_DURATION
The definition of a single phase of the logic.
A container for traffic light definitions and built programs.
std::vector< NBTrafficLightLogic * > getComputed() const
Returns a list of all computed logics.
NBTrafficLightDefinition * getDefinition(const std::string &id, const std::string &programID) const
Returns the named definition.
A SUMO-compliant built logic for a traffic light.
SUMOTime getOffset() const
Returns the offset of first switch.
TrafficLightType getType() const
get the algorithm type (static etc..)
const std::string & getProgramID() const
Returns the ProgramID.
const std::vector< PhaseDefinition > & getPhases() const
Returns the phases.
void writeEdgeTypes(OutputDevice &into, const std::set< std::string > &typeIDs=std::set< std::string >()) const
writes all EdgeTypes (and their lanes) as XML
static void writePositionLong(const Position &pos, OutputDevice &dev)
Writes the given position to device in long format (one attribute per dimension)
static void writeConnectionAttrs(OutputDevice &device, const NBEdge::Connection &c)
static void writeShape(OutputDevice &out, const GeoConvHelper &gch, PositionVector shape, SumoXMLAttr attr, bool useGeo, bool geoAccuracy, bool needsWrite)
static void writeConnection(OutputDevice &into, const NBEdge &from, const NBEdge::Connection &c, bool includeInternal, ConnectionStyle style=SUMONET, bool useGeo=false, bool geoAccuracy=false)
Writes connections outgoing from the given edge (also used in NWWriter_XML)
static void writeProhibitions(OutputDevice &into, const NBConnectionProhibits &prohibitions, const NBEdgeCont &ec)
writes the given prohibitions
static void writeNetwork(const OptionsCont &oc, NBNetBuilder &nb)
Writes the network into a SUMO-file.
static bool writeInternalNodes(OutputDevice &into, const NBNode &n)
Writes internal junctions (<junction with id[0]==':' ...) of the given node.
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
static std::string writeSUMOTime(SUMOTime time)
writes a SUMOTime as int if possible, otherwise as a float
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.
static bool writeInternalConnections(OutputDevice &into, const NBNode &n)
Writes inner connections within the node.
static void writeLane(OutputDevice &into, const std::string &lID, double speed, double friction, SVCPermissions permissions, SVCPermissions preferred, SVCPermissions changeLeft, SVCPermissions changeRight, double startOffset, double endOffset, const StopOffset &stopOffset, 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, const PositionVector &outlineShape=PositionVector())
Writes a lane (<lane ...) of an edge.
static void writeDistrict(OutputDevice &into, const NBDistrict &d)
Writes a district.
static void writeRoundabouts(OutputDevice &into, const std::set< EdgeSet > &roundabouts, const NBEdgeCont &ec)
Writes roundabouts.
static std::string getInternalBidi(const NBEdge *e, const NBEdge::Connection &k, double &length)
retrieve bidi edge id for internal corresponding to the given connection
static void writeRoundabout(OutputDevice &into, const std::vector< std::string > &r, const NBEdgeCont &ec)
Writes a roundabout.
static void writeStopOffsets(OutputDevice &into, const StopOffset &stopOffset)
Write a stopOffset element into output device.
static void writeInternalConnection(OutputDevice &into, const std::string &from, const std::string &to, int fromLane, int toLane, const std::string &via, LinkDirection dir=LinkDirection::STRAIGHT, const std::string &tlID="", int linkIndex=NBConnection::InvalidTlIndex, bool minor=false, double visibility=NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE)
Writes a single internal connection.
static void writeTrafficLight(OutputDevice &into, const NBTrafficLightLogic *logic, const NBTrafficLightDefinition *def, ConnectionStyle style=SUMONET)
writes a single traffic light logic to the given device
static void writeEdge(OutputDevice &into, const NBEdge &e, bool noNames, LaneSpreadFunction defaultSpread)
Writes an edge (<edge ...)
static void writeTrafficLights(OutputDevice &into, const NBTrafficLightLogicCont &tllCont, ConnectionStyle style=SUMONET)
writes the traffic light logics to the given device
static std::string prohibitionConnection(const NBConnection &c)
the attribute value for a prohibition
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.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
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 exists(const std::string &name) const
Returns the information whether the named option is known.
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)
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
Static storage of an output device and its base (abstract) implementation.
void lf()
writes a line feed if applicable
OutputDevice & writePadding(const std::string &val)
writes padding (ignored for binary output)
void close()
Closes the device and removes it from the dictionary.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const ATTR_TYPE &attr, const T &val, const bool isNull=false, const bool escape=false)
writes a named attribute
OutputDevice & writeOptionalAttr(const SumoXMLAttr attr, const T &val, const bool isNull=false, const bool escape=false)
writes a named attribute unless null
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
void setPrecision(int precision=gPrecision)
Sets the precision or resets it to default.
static OutputDevice & getDevice(const std::string &name, bool usePrefix=true)
Returns the described OutputDevice.
bool writeXMLHeader(const std::string &rootElement, const std::string &schemaFile, std::map< SumoXMLAttr, std::string > attrs=std::map< SumoXMLAttr, std::string >(), bool includeConfig=true)
Writes an XML header with optional configuration.
An upper class for objects with additional parameters.
void writeParams(OutputDevice &device) const
write Params in the given outputdevice
A point in 2D or 3D with translation and scaling methods.
double length() const
Returns the length.
PositionVector simplified() const
return the same shape with intermediate colinear points removed
PositionVector reverse() const
reverse position vector
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
bool isDefined() const
check if stopOffset was defined
SVCPermissions getPermissions() const
get permissions
double getOffset() const
get offset
T get(const std::string &str) const
get key
static std::string escapeXML(const std::string &orig, const bool maskDoubleHyphen=false)
Replaces the standard escapes by their XML entities.
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
static void normaliseSum(std::vector< T > &v, T msum=1.0)
A structure which describes a connection between edges or lanes.
bool indirectLeft
Whether this connection is an indirect left turn.
int fromLane
The lane the connections starts at.
int toLane
The lane the connections yields in.
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
double speed
custom speed for connection
NBEdge * toEdge
The edge the connections yields in.
KeepClear keepClear
whether the junction must be kept clear when using this connection
double customLength
custom length for connection
std::string edgeType
optional type of Connection
bool uncontrolled
check if Connection is uncontrolled
PositionVector customShape
custom shape for connection
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this connections internal lane(s)
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this connections internal lane(s)
std::string getDescription(const NBEdge *parent) const
get string describing this connection
double contPos
custom position for internal junction on this connection
std::string getInternalLaneID() const
get ID of internal lane
std::string tlID
The id of the traffic light that controls this connection.
double visibility
custom foe visiblity for connection
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
double length
computed length (average of all internal lane shape lengths that share an internal edge)
std::string id
id of Connection
int tlLinkIndex
The index of this connection within the controlling traffic light.
An (internal) definition of a single lane of an edge.
double width
This lane's width.
StopOffset laneStopOffset
stopOffsets.second - The stop offset for vehicles stopping at the lane's end. Applies if vClass is in...
PositionVector customShape
A custom shape for this lane set by the user.
double endOffset
This lane's offset to the intersection begin.
std::string type
the type of this lane
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
double speed
The speed allowed on this lane.
std::string oppositeID
An opposite lane ID, if given.
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this lane.
double friction
The friction on this lane.
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this lane.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
bool accelRamp
Whether this lane is an acceleration lane.
PositionVector shape
The lane's shape.
A definition of a pedestrian walking area.