55 #ifdef CHECK_MEMORY_LEAKS
57 #endif // CHECK_MEMORY_LEAKS
79 myNodeCont(nb.getNodeCont()),
80 myTLLCont(nb.getTLLogicCont()),
85 mySuspectKeepShape(false),
86 myHaveSeenInternalEdge(false)
91 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
93 for (std::vector<LaneAttrs*>::const_iterator j = ed->
lanes.begin(); j != ed->
lanes.end(); ++j) {
110 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
112 WRITE_ERROR(
"Could not open sumo-net-file '" + *file +
"'.");
121 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
140 if (ed->
shape.size() > 0) {
151 (
unsigned int) ed->
lanes.size(),
163 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
169 for (
unsigned int fromLaneIndex = 0; fromLaneIndex < (
unsigned int) ed->
lanes.size(); ++fromLaneIndex) {
172 const std::vector<Connection>& connections = lane->
connections;
173 for (std::vector<Connection>::const_iterator c_it = connections.begin(); c_it != connections.end(); c_it++) {
193 if (programs.size() > 0) {
194 std::map<std::string, NBTrafficLightDefinition*>::const_iterator it;
195 for (it = programs.begin(); it != programs.end(); it++) {
200 throw ProcessError(
"Corrupt traffic light definition '" + c.
tlID +
"' (program '" + it->first +
"')");
225 NBEdge* prohibitedFrom =
myEdges[it->prohibitedFrom]->builtEdge;
226 if (prohibitedFrom == 0) {
227 WRITE_ERROR(
"Edge '" + it->prohibitedFrom +
"' in prohibition was not built");
236 oc.
set(
"no-internal-links",
"true");
240 WRITE_WARNING(
"The input network may have been built using option 'xml.keep-shape'.\n... Accuracy of junction positions cannot be guaranteed.");
318 WRITE_ERROR(
"Unmatched closing tag for tl-logic.");
370 WRITE_ERROR(
"Unknown spreadType '" + lsfS +
"' for edge '" +
id +
"'.");
383 WRITE_ERROR(
"Found lane '" +
id +
"' not within edge element");
431 WRITE_WARNING(
"Unknown node type for junction '" +
id +
"'.");
439 if (shape.size() > 0) {
449 WRITE_ERROR(
"Problems on adding junction '" +
id +
"'.");
460 if (
myEdges.count(fromID) == 0) {
461 WRITE_ERROR(
"Unknown edge '" + fromID +
"' given in connection.");
471 if (conn.
tlID !=
"") {
474 if (from->
lanes.size() <= (size_t) fromLaneIdx) {
475 WRITE_ERROR(
"Invalid lane index '" +
toString(fromLaneIdx) +
"' for connection from '" + fromID +
"'.");
478 from->
lanes[fromLaneIdx]->connections.push_back(conn);
505 assert(edge->
id == edge_id);
506 if (edge->
lanes.size() <= (size_t) index) {
507 WRITE_ERROR(
"Unknown lane '" + lane_id +
"' given in succedge.");
510 return edge->
lanes[index];
518 size_t sep_index = lane_id.rfind(
'_');
519 if (sep_index == std::string::npos) {
520 WRITE_ERROR(
"Invalid lane id '" + lane_id +
"' (missing '_').");
522 edge_id = lane_id.substr(0, sep_index);
523 std::string index_string = lane_id.substr(sep_index + 1);
527 WRITE_ERROR(
"Invalid lane index '" + index_string +
"' for lane '" + lane_id +
"'.");
535 WRITE_ERROR(
"Definition of tl-logic '" + currentTL->
getID() +
"' was not finished.");
547 WRITE_ERROR(
"Unknown traffic light type '" + typeS +
"' for tlLogic '" +
id +
"'.");
564 const std::string&
id = currentTL->
getID();
577 currentTL->
addPhase(duration, state);
590 const size_t noLanes = edge->
lanes.size();
597 for (
unsigned int i = 1; i < firstLane.size() - 1; i++) {
605 Position(from.
x() + offsets.first, from.
y() + offsets.second),
606 Position(me.
x() + offsets.first, me.
y() + offsets.second));
609 Position(me.
x() + offsets2.first, me.
y() + offsets2.second),
610 Position(to.
x() + offsets2.first, to.
y() + offsets2.second));
615 WRITE_WARNING(
"Could not reconstruct shape for edge '" + edge->
id +
"'.");
635 result =
new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary);
657 size_t div = attr.find(
"->");
658 if (div == std::string::npos) {
659 WRITE_ERROR(
"Missing connection divider in prohibition attribute '" + attr +
"'");
662 from = attr.substr(0, div);
663 to = attr.substr(div + 2);
665 if (from.find(
'_') != std::string::npos) {
666 from = from.substr(0, from.find(
'_'));
668 if (to.find(
'_') != std::string::npos) {
669 to = to.substr(0, to.find(
'_'));
672 if (
myEdges.count(from) == 0) {
673 WRITE_ERROR(
"Unknown edge prohibition '" + from +
"'");
677 WRITE_ERROR(
"Unknown edge prohibition '" + to +
"'");