55 #ifdef CHECK_MEMORY_LEAKS
57 #endif // CHECK_MEMORY_LEAKS
79 myNodeCont(nb.getNodeCont()),
80 myTLLCont(nb.getTLLogicCont()),
85 mySuspectKeepShape(false),
86 myHaveSeenInternalEdge(false) {}
90 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
92 for (std::vector<LaneAttrs*>::const_iterator j = ed->
lanes.begin(); j != ed->
lanes.end(); ++j) {
109 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
111 WRITE_ERROR(
"Could not open sumo-net-file '" + *file +
"'.");
120 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
139 if (ed->
shape.size() > 0) {
150 (
unsigned int) ed->
lanes.size(),
162 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
168 for (
unsigned int fromLaneIndex = 0; fromLaneIndex < (
unsigned int) ed->
lanes.size(); ++fromLaneIndex) {
171 const std::vector<Connection>& connections = lane->
connections;
172 for (std::vector<Connection>::const_iterator c_it = connections.begin(); c_it != connections.end(); c_it++) {
189 if (programs.size() > 0) {
190 std::map<std::string, NBTrafficLightDefinition*>::const_iterator it;
191 for (it = programs.begin(); it != programs.end(); it++) {
196 throw ProcessError(
"Corrupt traffic light definition '" + c.
tlID +
"' (program '" + it->first +
"')");
215 NBEdge* prohibitedFrom =
myEdges[it->prohibitedFrom]->builtEdge;
216 if (prohibitedFrom == 0) {
217 WRITE_ERROR(
"Edge '" + it->prohibitedFrom +
"' in prohibition was not built");
226 oc.
set(
"no-internal-links",
"true");
230 WRITE_WARNING(
"The input network may have been built using option 'xml.keep-shape'.\n... Accuracy of junction positions cannot be guaranteed.");
308 WRITE_ERROR(
"Unmatched closing tag for tl-logic.");
357 WRITE_ERROR(
"Unknown spreadType '" + lsfS +
"' for edge '" +
id +
"'.");
370 WRITE_ERROR(
"Found lane '" +
id +
"' not within edge element");
416 WRITE_WARNING(
"Unknown node type for junction '" +
id +
"'.");
424 if (shape.size() > 0) {
434 WRITE_ERROR(
"Problems on adding junction '" +
id +
"'.");
445 if (
myEdges.count(fromID) == 0) {
446 WRITE_ERROR(
"Unknown edge '" + fromID +
"' given in connection.");
462 if (conn.
tlID !=
"") {
466 if (from->
lanes.size() <= (size_t) fromLaneIdx) {
467 WRITE_ERROR(
"Invalid lane index '" +
toString(fromLaneIdx) +
"' for connection from '" + fromID +
"'.");
470 from->
lanes[fromLaneIdx]->connections.push_back(conn);
497 assert(edge->
id == edge_id);
498 if (edge->
lanes.size() <= (size_t) index) {
499 WRITE_ERROR(
"Unknown lane '" + lane_id +
"' given in succedge.");
502 return edge->
lanes[index];
510 size_t sep_index = lane_id.rfind(
'_');
511 if (sep_index == std::string::npos) {
512 WRITE_ERROR(
"Invalid lane id '" + lane_id +
"' (missing '_').");
514 edge_id = lane_id.substr(0, sep_index);
515 std::string index_string = lane_id.substr(sep_index + 1);
519 WRITE_ERROR(
"Invalid lane index '" + index_string +
"' for lane '" + lane_id +
"'.");
527 WRITE_ERROR(
"Definition of tl-logic '" + currentTL->
getID() +
"' was not finished.");
539 WRITE_ERROR(
"Unknown traffic light type '" + typeS +
"' for tlLogic '" +
id +
"'.");
556 const std::string&
id = currentTL->
getID();
569 currentTL->
addPhase(duration, state);
582 const size_t noLanes = edge->
lanes.size();
589 for (
unsigned int i = 1; i < firstLane.size() - 1; i++) {
597 Position(from.
x() + offsets.first, from.
y() + offsets.second),
598 Position(me.
x() + offsets.first, me.
y() + offsets.second));
601 Position(me.
x() + offsets2.first, me.
y() + offsets2.second),
602 Position(to.
x() + offsets2.first, to.
y() + offsets2.second));
607 WRITE_WARNING(
"Could not reconstruct shape for edge '" + edge->
id +
"'.");
627 result =
new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary);
649 size_t div = attr.find(
"->");
650 if (div == std::string::npos) {
651 WRITE_ERROR(
"Missing connection divider in prohibition attribute '" + attr +
"'");
654 from = attr.substr(0, div);
655 to = attr.substr(div + 2);
657 if (from.find(
'_') != std::string::npos) {
658 from = from.substr(0, from.find(
'_'));
660 if (to.find(
'_') != std::string::npos) {
661 to = to.substr(0, to.find(
'_'));
664 if (
myEdges.count(from) == 0) {
665 WRITE_ERROR(
"Unknown edge prohibition '" + from +
"'");
669 WRITE_ERROR(
"Unknown edge prohibition '" + to +
"'");