55 #ifdef CHECK_MEMORY_LEAKS
57 #endif // CHECK_MEMORY_LEAKS
79 myNodeCont(nb.getNodeCont()),
80 myTLLCont(nb.getTLLogicCont()),
85 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) {
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++) {
191 if (programs.size() > 0) {
192 std::map<std::string, NBTrafficLightDefinition*>::const_iterator it;
193 for (it = programs.begin(); it != programs.end(); it++) {
198 throw ProcessError(
"Corrupt traffic light definition '" + c.
tlID +
"' (program '" + it->first +
"')");
223 NBEdge* prohibitedFrom =
myEdges[it->prohibitedFrom]->builtEdge;
224 if (prohibitedFrom == 0) {
225 WRITE_ERROR(
"Edge '" + it->prohibitedFrom +
"' in prohibition was not built");
234 oc.
set(
"no-internal-links",
"true");
243 for (std::vector<Crossing>::const_iterator it_c = (*it).second.begin(); it_c != (*it).second.end(); ++it_c) {
246 for (std::vector<std::string>::const_iterator it_e = crossing.
crossingEdges.begin(); it_e != crossing.
crossingEdges.end(); ++it_e) {
249 edges.push_back(edge);
332 WRITE_ERROR(
"Unmatched closing tag for tl-logic.");
346 for (std::vector<Crossing>::iterator it = crossings.begin(); it != crossings.end(); ++it) {
403 WRITE_ERROR(
"Unknown spreadType '" + lsfS +
"' for edge '" +
id +
"'.");
416 WRITE_ERROR(
"Found lane '" +
id +
"' not within edge element");
423 assert(crossings.size() > 0);
424 crossings.back().laneID = id;
472 WRITE_WARNING(
"Unknown node type for junction '" +
id +
"'.");
478 WRITE_ERROR(
"Problems on adding junction '" +
id +
"'.");
500 if (
myEdges.count(fromID) == 0) {
501 WRITE_ERROR(
"Unknown edge '" + fromID +
"' given in connection.");
511 if (conn.
tlID !=
"") {
514 if (from->
lanes.size() <= (size_t) fromLaneIdx) {
515 WRITE_ERROR(
"Invalid lane index '" +
toString(fromLaneIdx) +
"' for connection from '" + fromID +
"'.");
518 from->
lanes[fromLaneIdx]->connections.push_back(conn);
545 assert(edge->
id == edge_id);
546 if (edge->
lanes.size() <= (size_t) index) {
547 WRITE_ERROR(
"Unknown lane '" + lane_id +
"' given in succedge.");
550 return edge->
lanes[index];
558 size_t sep_index = lane_id.rfind(
'_');
559 if (sep_index == std::string::npos) {
560 WRITE_ERROR(
"Invalid lane id '" + lane_id +
"' (missing '_').");
562 edge_id = lane_id.substr(0, sep_index);
563 std::string index_string = lane_id.substr(sep_index + 1);
567 WRITE_ERROR(
"Invalid lane index '" + index_string +
"' for lane '" + lane_id +
"'.");
575 WRITE_ERROR(
"Definition of tl-logic '" + currentTL->
getID() +
"' was not finished.");
587 WRITE_ERROR(
"Unknown traffic light type '" + typeS +
"' for tlLogic '" +
id +
"'.");
604 const std::string&
id = currentTL->
getID();
617 currentTL->
addPhase(duration, state);
630 const size_t noLanes = edge->
lanes.size();
637 for (
unsigned int i = 1; i < firstLane.size() - 1; i++) {
645 Position(from.
x() + offsets.first, from.
y() + offsets.second),
646 Position(me.
x() + offsets.first, me.
y() + offsets.second));
649 Position(me.
x() + offsets2.first, me.
y() + offsets2.second),
650 Position(to.
x() + offsets2.first, to.
y() + offsets2.second));
655 WRITE_WARNING(
"Could not reconstruct shape for edge '" + edge->
id +
"'.");
675 result =
new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary);
697 size_t div = attr.find(
"->");
698 if (div == std::string::npos) {
699 WRITE_ERROR(
"Missing connection divider in prohibition attribute '" + attr +
"'");
702 from = attr.substr(0, div);
703 to = attr.substr(div + 2);
705 if (from.find(
'_') != std::string::npos) {
706 from = from.substr(0, from.find(
'_'));
708 if (to.find(
'_') != std::string::npos) {
709 to = to.substr(0, to.find(
'_'));
712 if (
myEdges.count(from) == 0) {
713 WRITE_ERROR(
"Unknown edge prohibition '" + from +
"'");
717 WRITE_ERROR(
"Unknown edge prohibition '" + to +
"'");