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 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
106 const bool includeInternal = !oc.
getBool(
"no-internal-links");
107 if (includeInternal) {
110 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
119 unsigned int numConnections = 0;
120 for (std::map<std::string, NBEdge*>::const_iterator it_edge = ec.
begin(); it_edge != ec.
end(); it_edge++) {
121 NBEdge* from = it_edge->second;
123 const std::vector<NBEdge::Connection> connections = from->
getConnections();
124 numConnections += (
unsigned int)connections.size();
125 for (std::vector<NBEdge::Connection>::const_iterator it_c = connections.begin(); it_c != connections.end(); it_c++) {
129 if (numConnections > 0) {
132 if (includeInternal) {
135 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
143 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
149 for (std::vector<EdgeVector>::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
152 if (roundabouts.size() != 0) {
157 for (std::map<std::string, NBDistrict*>::const_iterator i = dc.
begin(); i != dc.
end(); i++) {
160 if (dc.
size() != 0) {
171 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
172 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
173 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
174 if ((*k).toEdge == 0) {
177 std::string origID = origNames ? (*k).origID :
"";
191 const std::string& origID) {
242 const std::vector<NBEdge::Lane>& lanes = e.
getLanes();
247 for (
unsigned int i = 0; i < (
unsigned int) lanes.size(); i++) {
257 SUMOReal length,
unsigned int index,
bool origNames) {
266 if (lane.
speed == 0) {
268 }
else if (lane.
speed < 0) {
272 length = length - lane.
offset;
287 if (origNames && lane.
origID !=
"") {
306 std::string incLanes;
308 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
309 unsigned int noLanes = (*i)->getNumLanes();
310 for (
unsigned int j = 0; j < noLanes; j++) {
311 incLanes += (*i)->getLaneID(j);
312 if (i != incoming.end() - 1 || j < noLanes - 1) {
319 std::string intLanes;
322 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
323 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
324 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
325 if ((*k).toEdge == 0) {
332 intLanes += (*k).id +
"_0";
334 intLanes += (*k).viaID +
"_0";
357 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
358 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
359 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
360 if ((*k).toEdge == 0 || !(*k).haveVia) {
367 std::string incLanes = (*k).id +
"_0";
368 if ((*k).foeIncomingLanes.length() != 0) {
369 incLanes +=
" " + (*k).foeIncomingLanes;
393 if (style !=
PLAIN) {
394 if (includeInternal) {
421 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
423 const std::vector<NBEdge::Connection>& connections = from->
getConnections();
424 for (std::vector<NBEdge::Connection>::const_iterator j = connections.begin(); j != connections.end(); ++j) {
444 const std::string& from,
const std::string& to,
int toLane,
const std::string& via) {
461 std::vector<std::string> edgeIDs;
462 std::vector<std::string> nodeIDs;
463 for (EdgeVector::const_iterator j = r.begin(); j != r.end(); ++j) {
464 edgeIDs.push_back((*j)->getID());
465 nodeIDs.push_back((*j)->getToNode()->getID());
468 std::sort(edgeIDs.begin(), edgeIDs.end());
469 std::sort(nodeIDs.begin(), nodeIDs.end());
491 for (i = 0; i < sources.size(); i++) {
498 for (i = 0; i < sinks.size(); i++) {
511 if (time == std::floor(time)) {
521 for (NBConnectionProhibits::const_iterator j = prohibitions.begin(); j != prohibitions.end(); j++) {
524 for (NBConnectionVector::const_iterator k = prohibiting.begin(); k != prohibiting.end(); k++) {
543 std::vector<NBTrafficLightLogic*> logics = tllCont.
getComputed();
544 for (std::vector<NBTrafficLightLogic*>::iterator it = logics.begin(); it != logics.end(); it++) {
551 const std::vector<NBTrafficLightLogic::PhaseDefinition>& phases = (*it)->getPhases();
552 for (std::vector<NBTrafficLightLogic::PhaseDefinition>::const_iterator j = phases.begin(); j != phases.end(); ++j) {
560 if (logics.size() > 0) {
589 }
else if (permissions == 0) {
595 if (encoding.second) {