49 #ifdef CHECK_MEMORY_LEAKS
51 #endif // CHECK_MEMORY_LEAKS
64 if (!oc.
isSet(
"output-file")) {
79 bool origNames = oc.
getBool(
"output.original-names");
80 if (!oc.
getBool(
"no-internal-links")) {
82 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
91 bool noNames = !oc.
getBool(
"output.street-names");
92 for (std::map<std::string, NBEdge*>::const_iterator i = ec.
begin(); i != ec.
end(); ++i) {
93 writeEdge(device, *(*i).second, noNames, origNames);
101 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
105 const bool includeInternal = !oc.
getBool(
"no-internal-links");
106 if (includeInternal) {
109 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
118 unsigned int numConnections = 0;
119 for (std::map<std::string, NBEdge*>::const_iterator it_edge = ec.
begin(); it_edge != ec.
end(); it_edge++) {
120 NBEdge* from = it_edge->second;
122 const std::vector<NBEdge::Connection> connections = from->
getConnections();
123 numConnections += (
unsigned int)connections.size();
124 for (std::vector<NBEdge::Connection>::const_iterator it_c = connections.begin(); it_c != connections.end(); it_c++) {
128 if (numConnections > 0) {
131 if (includeInternal) {
134 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
142 for (std::map<std::string, NBNode*>::const_iterator i = nc.
begin(); i != nc.
end(); ++i) {
147 const std::vector<std::set<NBEdge*> >& roundabouts = nb.
getRoundabouts();
148 for (std::vector<std::set<NBEdge*> >::const_iterator i = roundabouts.begin(); i != roundabouts.end(); ++i) {
151 if (roundabouts.size() != 0) {
156 for (std::map<std::string, NBDistrict*>::const_iterator i = dc.
begin(); i != dc.
end(); i++) {
159 if (dc.
size() != 0) {
170 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
171 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
172 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
173 if ((*k).toEdge == 0) {
176 std::string origID = origNames ? (*k).origID :
"";
190 const std::string& origID) {
244 const std::vector<NBEdge::Lane>& lanes = e.
getLanes();
249 for (
unsigned int i = 0; i < (
unsigned int) lanes.size(); i++) {
259 SUMOReal length,
unsigned int index,
bool origNames) {
268 if (lane.
speed == 0) {
270 }
else if (lane.
speed < 0) {
274 length = length - lane.
offset;
289 if (origNames && lane.
origID !=
"") {
309 std::string incLanes;
311 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
312 unsigned int noLanes = (*i)->getNumLanes();
313 for (
unsigned int j = 0; j < noLanes; j++) {
314 incLanes += (*i)->getLaneID(j);
315 if (i != incoming.end() - 1 || j < noLanes - 1) {
322 std::string intLanes;
325 for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
326 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
327 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
328 if ((*k).toEdge == 0) {
335 intLanes += (*k).id +
"_0";
337 intLanes += (*k).viaID +
"_0";
361 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); i++) {
362 const std::vector<NBEdge::Connection>& elv = (*i)->getConnections();
363 for (std::vector<NBEdge::Connection>::const_iterator k = elv.begin(); k != elv.end(); ++k) {
364 if ((*k).toEdge == 0 || !(*k).haveVia) {
371 std::string incLanes = (*k).id +
"_0";
372 if ((*k).foeIncomingLanes.length() != 0) {
373 incLanes +=
" " + (*k).foeIncomingLanes;
397 if (style !=
PLAIN) {
398 if (includeInternal) {
425 for (std::vector<NBEdge*>::const_iterator i = incoming.begin(); i != incoming.end(); ++i) {
427 const std::vector<NBEdge::Connection>& connections = from->
getConnections();
428 for (std::vector<NBEdge::Connection>::const_iterator j = connections.begin(); j != connections.end(); ++j) {
448 const std::string& from,
const std::string& to,
int toLane,
const std::string& via) {
465 std::set<std::string> nodes;
466 for (std::set<NBEdge*>::const_iterator j = r.begin(); j != r.end(); ++j) {
467 nodes.insert((*j)->getToNode()->getID());
469 std::string nodeString;
470 for (std::set<std::string>::const_iterator j = nodes.begin(); j != nodes.end(); ++j) {
471 if (j != nodes.begin()) {
495 for (i = 0; i < sources.size(); i++) {
502 for (i = 0; i < sinks.size(); i++) {
515 if (time == std::floor(time)) {
525 for (NBConnectionProhibits::const_iterator j = prohibitions.begin(); j != prohibitions.end(); j++) {
528 for (NBConnectionVector::const_iterator k = prohibiting.begin(); k != prohibiting.end(); k++) {
547 std::vector<NBTrafficLightLogic*> logics = tllCont.
getComputed();
548 for (std::vector<NBTrafficLightLogic*>::iterator it = logics.begin(); it != logics.end(); it++) {
556 const std::vector<NBTrafficLightLogic::PhaseDefinition>& phases = (*it)->getPhases();
557 for (std::vector<NBTrafficLightLogic::PhaseDefinition>::const_iterator j = phases.begin(); j != phases.end(); ++j) {
565 if (logics.size() > 0) {
594 }
else if (permissions == 0) {
600 if (encoding.second) {