50 #ifdef CHECK_MEMORY_LEAKS
52 #endif // CHECK_MEMORY_LEAKS
65 if (!oc.
isSet(
"output-file")) {
69 device.
writeXMLHeader(
"net",
NWFrame::MAJOR_VERSION +
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo.sf.net/xsd/net_file.xsd\"");
80 bool origNames = oc.
getBool(
"output.original-names");
81 if (!oc.
getBool(
"no-internal-links")) {
83 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
92 bool noNames = !oc.
getBool(
"output.street-names");
93 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
94 writeEdge(device, *(*i).second, noNames, origNames);
102 std::set<NBNode*> roundaboutNodes;
103 const bool checkLaneFoesAll = oc.
getBool(
"check-lane-foes.all");
104 const bool checkLaneFoesRoundabout = !checkLaneFoesAll && oc.
getBool(
"check-lane-foes.roundabout");
105 if (checkLaneFoesRoundabout) {
107 for (std::vector<EdgeVector>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
108 for (EdgeVector::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
109 roundaboutNodes.insert((*j)->getToNode());
113 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
114 const bool checkLaneFoes = checkLaneFoesAll || (checkLaneFoesRoundabout && roundaboutNodes.count((*i).second) > 0);
118 const bool includeInternal = !oc.
getBool(
"no-internal-links");
119 if (includeInternal) {
122 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
131 unsigned int numConnections = 0;
132 for (std::map<std::string, NBEdge*>::const_iterator it_edge = ec.
begin(); it_edge != ec.
end(); it_edge++) {
133 NBEdge* from = it_edge->second;
135 const std::vector<NBEdge::Connection> connections = from->
getConnections();
136 numConnections += (
unsigned int)connections.size();
137 for (std::vector<NBEdge::Connection>::const_iterator it_c = connections.begin(); it_c != connections.end(); it_c++) {
141 if (numConnections > 0) {
144 if (includeInternal) {
147 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
155 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
162 std::vector<std::vector<std::string> > edgeIDs;
163 for (std::vector<EdgeVector>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
164 std::vector<std::string> tEdgeIDs;
165 for (EdgeVector::const_iterator j = (*i).begin(); j != (*i).end(); ++j) {
166 tEdgeIDs.push_back((*j)->getID());
168 std::sort(tEdgeIDs.begin(), tEdgeIDs.end());
169 edgeIDs.push_back(tEdgeIDs);
171 std::sort(edgeIDs.begin(), edgeIDs.end());
173 for (std::vector<std::vector<std::string> >::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
176 if (roundabouts.size() != 0) {
181 for (std::map<std::string, NBDistrict*>::const_iterator i = dc.
begin(); i != dc.
end(); i++) {
184 if (dc.
size() != 0) {
195 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
196 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
197 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
198 if ((*k).toEdge == 0) {
201 std::string origID = origNames ? (*k).origID :
"";
215 const std::string& origID) {
266 const std::vector<NBEdge::Lane>& lanes = e.
getLanes();
279 for (
unsigned int i = 0; i < (
unsigned int) lanes.size(); i++) {
289 SUMOReal length,
unsigned int index,
bool origNames) {
298 if (lane.
speed == 0) {
300 }
else if (lane.
speed < 0) {
304 length = length - lane.
offset;
319 if (origNames && lane.
origID !=
"") {
338 std::string incLanes;
340 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
341 unsigned int noLanes = (*i)->getNumLanes();
342 for (
unsigned int j = 0; j < noLanes; j++) {
343 incLanes += (*i)->getLaneID(j);
344 if (i != incoming.end() - 1 || j < noLanes - 1) {
351 std::string intLanes;
354 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
355 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
356 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
357 if ((*k).toEdge == 0) {
364 intLanes += (*k).id +
"_0";
366 intLanes += (*k).viaID +
"_0";
389 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
390 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
391 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
392 if ((*k).toEdge == 0 || !(*k).haveVia) {
399 std::string incLanes = (*k).id +
"_0";
400 if ((*k).foeIncomingLanes.length() != 0) {
401 incLanes +=
" " + (*k).foeIncomingLanes;
425 if (style !=
PLAIN) {
426 if (includeInternal) {
453 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
455 const std::vector<NBEdge::Connection>& connections = from->
getConnections();
456 for (std::vector<NBEdge::Connection>::const_iterator j = connections.begin(); j != connections.end(); ++j) {
476 const std::string& from,
const std::string& to,
int toLane,
const std::string& via) {
494 std::vector<std::string> nodeIDs;
495 for (std::vector<std::string>::const_iterator i = edgeIDs.begin(); i != edgeIDs.end(); ++i) {
498 std::sort(nodeIDs.begin(), nodeIDs.end());
520 for (i = 0; i < sources.size(); i++) {
527 for (i = 0; i < sinks.size(); i++) {
540 if (time == std::floor(time)) {
550 for (NBConnectionProhibits::const_iterator j = prohibitions.begin(); j != prohibitions.end(); j++) {
553 for (NBConnectionVector::const_iterator k = prohibiting.begin(); k != prohibiting.end(); k++) {
572 std::vector<NBTrafficLightLogic*> logics = tllCont.
getComputed();
573 for (std::vector<NBTrafficLightLogic*>::iterator it = logics.begin(); it != logics.end(); it++) {
580 const std::vector<NBTrafficLightLogic::PhaseDefinition>& phases = (*it)->getPhases();
581 for (std::vector<NBTrafficLightLogic::PhaseDefinition>::const_iterator j = phases.begin(); j != phases.end(); ++j) {
589 if (logics.size() > 0) {
618 }
else if (permissions == 0) {
624 if (encoding.second) {