54 #ifdef CHECK_MEMORY_LEAKS
56 #endif // CHECK_MEMORY_LEAKS
78 myNodeCont(nb.getNodeCont()),
79 myTLLCont(nb.getTLLogicCont()),
84 mySuspectKeepShape(false),
85 myHaveWarnedAboutDeprecatedSpreadType(false),
86 myHaveWarnedAboutDeprecatedMaxSpeed(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) {
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++) {
197 + c.
tlID +
"' (program '" + it->first +
"')");
216 NBEdge* prohibitedFrom =
myEdges[it->prohibitedFrom]->builtEdge;
217 if (prohibitedFrom == 0) {
218 WRITE_ERROR(
"Edge '" + it->prohibitedFrom +
"' in prohibition was not built");
229 WRITE_WARNING(
"The input network may have been built using option 'xml.keep-shape'.\n... Accuracy of junction positions cannot be guaranteed.");
293 const std::string& chars) {
320 WRITE_ERROR(
"Unmatched closing tag for tl-logic.");
380 WRITE_ERROR(
"Unknown spreadType '" + lsfS +
"' for edge '" +
id +
"'.");
393 WRITE_ERROR(
"Found lane '" +
id +
"' not within edge element");
440 WRITE_WARNING(
"Unknown node type '" + typeS +
"' for junction '" +
id +
"'.");
458 WRITE_ERROR(
"Problems on adding junction '" +
id +
"'.");
470 if (
myEdges.count(edge_id) == 0) {
471 WRITE_ERROR(
"Unknown edge '" + edge_id +
"' given in succedge.");
483 WRITE_ERROR(
"Found succlane outside succ element");
489 if (laneID ==
"SUMO_NO_DESTINATION") {
496 if (conn.
tlID !=
"") {
509 if (
myEdges.count(fromID) == 0) {
510 WRITE_ERROR(
"Unknown edge '" + fromID +
"' given in connection.");
520 if (conn.
tlID !=
"") {
524 if (from->
lanes.size() <= (size_t) fromLaneIdx) {
525 WRITE_ERROR(
"Invalid lane index '" +
toString(fromLaneIdx) +
"' for connection from '" + fromID +
"'.");
528 from->
lanes[fromLaneIdx]->connections.push_back(conn);
555 assert(edge->
id == edge_id);
556 if (edge->
lanes.size() <= (size_t) index) {
557 WRITE_ERROR(
"Unknown lane '" + lane_id +
"' given in succedge.");
560 return edge->
lanes[index];
568 size_t sep_index = lane_id.rfind(
'_');
569 if (sep_index == std::string::npos) {
570 WRITE_ERROR(
"Invalid lane id '" + lane_id +
"' (missing '_').");
572 edge_id = lane_id.substr(0, sep_index);
573 std::string index_string = lane_id.substr(sep_index + 1);
577 WRITE_ERROR(
"Invalid lane index '" + index_string +
"' for lane '" + lane_id +
"'.");
585 WRITE_ERROR(
"Definition of tl-logic '" + currentTL->
getID() +
"' was not finished.");
594 WRITE_WARNING(
"Traffic light '" +
id +
"' has unsupported type '" + type +
"' and will be converted to '" +
611 const std::string&
id = currentTL->
getID();
624 currentTL->
addPhase(duration, state);
637 const size_t noLanes = edge->
lanes.size();
638 for (
unsigned int i = 1; i < firstLane.
size() - 1; i++) {
644 noLanes, edge->
lsf,
false);
647 noLanes, edge->
lsf,
false);
650 Position(from.
x() + offsets.first, from.
y() + offsets.second),
651 Position(me.
x() + offsets.first, me.
y() + offsets.second));
654 Position(me.
x() + offsets2.first, me.
y() + offsets2.second),
655 Position(to.
x() + offsets2.first, to.
y() + offsets2.second));
660 WRITE_WARNING(
"Could not reconstruct shape for edge '" + edge->
id +
"'.");
686 result =
new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary);
708 size_t div = attr.find(
"->");
709 if (div == std::string::npos) {
710 WRITE_ERROR(
"Missing connection divider in prohibition attribute '" + attr +
"'");
713 from = attr.substr(0, div);
714 to = attr.substr(div + 2);
716 if (from.find(
'_') != std::string::npos) {
717 from = from.substr(0, from.find(
'_'));
719 if (to.find(
'_') != std::string::npos) {
720 to = to.substr(0, to.find(
'_'));
723 if (
myEdges.count(from) == 0) {
724 WRITE_ERROR(
"Unknown edge prohibition '" + from +
"'");
728 WRITE_ERROR(
"Unknown edge prohibition '" + to +
"'");