55 #ifdef CHECK_MEMORY_LEAKS
57 #endif // CHECK_MEMORY_LEAKS
79 myNodeCont(nb.getNodeCont()),
80 myTLLCont(nb.getTLLogicCont()),
85 mySuspectKeepShape(false) {}
89 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
91 for (std::vector<LaneAttrs*>::const_iterator j = ed->
lanes.begin(); j != ed->
lanes.end(); ++j) {
108 for (std::vector<std::string>::const_iterator file = files.begin(); file != files.end(); ++file) {
110 WRITE_ERROR(
"Could not open sumo-net-file '" + *file +
"'.");
119 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
149 (
unsigned int) ed->
lanes.size(),
161 for (std::map<std::string, EdgeAttrs*>::const_iterator i =
myEdges.begin(); i !=
myEdges.end(); ++i) {
167 for (
unsigned int fromLaneIndex = 0; fromLaneIndex < (
unsigned int) ed->
lanes.size(); ++fromLaneIndex) {
170 const std::vector<Connection>& connections = lane->
connections;
171 for (std::vector<Connection>::const_iterator c_it = connections.begin(); c_it != connections.end(); c_it++) {
188 if (programs.size() > 0) {
189 std::map<std::string, NBTrafficLightDefinition*>::const_iterator it;
190 for (it = programs.begin(); it != programs.end(); it++) {
195 throw ProcessError(
"Corrupt traffic light definition '" + c.
tlID +
"' (program '" + it->first +
"')");
214 NBEdge* prohibitedFrom =
myEdges[it->prohibitedFrom]->builtEdge;
215 if (prohibitedFrom == 0) {
216 WRITE_ERROR(
"Edge '" + it->prohibitedFrom +
"' in prohibition was not built");
227 WRITE_WARNING(
"The input network may have been built using option 'xml.keep-shape'.\n... Accuracy of junction positions cannot be guaranteed.");
307 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");
405 WRITE_WARNING(
"Unknown node type for junction '" +
id +
"'.");
413 if (shape.
size() > 0) {
423 WRITE_ERROR(
"Problems on adding junction '" +
id +
"'.");
434 if (
myEdges.count(fromID) == 0) {
435 WRITE_ERROR(
"Unknown edge '" + fromID +
"' given in connection.");
451 if (conn.
tlID !=
"") {
455 if (from->
lanes.size() <= (size_t) fromLaneIdx) {
456 WRITE_ERROR(
"Invalid lane index '" +
toString(fromLaneIdx) +
"' for connection from '" + fromID +
"'.");
459 from->
lanes[fromLaneIdx]->connections.push_back(conn);
486 assert(edge->
id == edge_id);
487 if (edge->
lanes.size() <= (size_t) index) {
488 WRITE_ERROR(
"Unknown lane '" + lane_id +
"' given in succedge.");
491 return edge->
lanes[index];
499 size_t sep_index = lane_id.rfind(
'_');
500 if (sep_index == std::string::npos) {
501 WRITE_ERROR(
"Invalid lane id '" + lane_id +
"' (missing '_').");
503 edge_id = lane_id.substr(0, sep_index);
504 std::string index_string = lane_id.substr(sep_index + 1);
508 WRITE_ERROR(
"Invalid lane index '" + index_string +
"' for lane '" + lane_id +
"'.");
516 WRITE_ERROR(
"Definition of tl-logic '" + currentTL->
getID() +
"' was not finished.");
525 WRITE_WARNING(
"Traffic light '" +
id +
"' has unsupported type '" + type +
"' and will be converted to '" +
542 const std::string&
id = currentTL->
getID();
555 currentTL->
addPhase(duration, state);
568 const size_t noLanes = edge->
lanes.size();
569 for (
unsigned int i = 1; i < firstLane.
size() - 1; i++) {
575 noLanes, edge->
lsf,
false);
578 noLanes, edge->
lsf,
false);
581 Position(from.
x() + offsets.first, from.
y() + offsets.second),
582 Position(me.
x() + offsets.first, me.
y() + offsets.second));
585 Position(me.
x() + offsets2.first, me.
y() + offsets2.second),
586 Position(to.
x() + offsets2.first, to.
y() + offsets2.second));
591 WRITE_WARNING(
"Could not reconstruct shape for edge '" + edge->
id +
"'.");
611 result =
new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary);
633 size_t div = attr.find(
"->");
634 if (div == std::string::npos) {
635 WRITE_ERROR(
"Missing connection divider in prohibition attribute '" + attr +
"'");
638 from = attr.substr(0, div);
639 to = attr.substr(div + 2);
641 if (from.find(
'_') != std::string::npos) {
642 from = from.substr(0, from.find(
'_'));
644 if (to.find(
'_') != std::string::npos) {
645 to = to.substr(0, to.find(
'_'));
648 if (
myEdges.count(from) == 0) {
649 WRITE_ERROR(
"Unknown edge prohibition '" + from +
"'");
653 WRITE_ERROR(
"Unknown edge prohibition '" + to +
"'");