58 #ifdef CHECK_MEMORY_LEAKS
60 #endif // CHECK_MEMORY_LEAKS
100 : myEdgeID(edgeid) {}
109 if (pos2 < 0 || pos1 < 0) {
113 assert(pos1 >= 0 && pos2 >= 0);
121 const std::string& type,
int noLanes,
129 assert(noLanes >= 0);
133 for (
int i = 0; i < noLanes; i++) {
149 const std::string& type,
int noLanes,
154 zuschlag2, length, geom, clv);
166 DictType::iterator i =
myDict.find(
id);
178 DictType::iterator i =
myDict.find(
id);
188 const SUMOReal MAX_CLUSTER_DISTANCE = 10;
191 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
192 int edgeid = (*i).first;
197 if (connectors.size() == 0) {
203 std::vector<int> currentCluster;
204 std::vector<int>::iterator j = connectors.begin();
215 if (j == connectors.end()) {
218 currentCluster.push_back(*j);
225 if (n_outgoing == outgoing && fabs(n_position - position) < MAX_CLUSTER_DISTANCE) {
227 currentCluster.push_back(*(j + 1));
232 currentCluster.clear();
233 currentCluster.push_back(*(j + 1));
235 outgoing = n_outgoing;
236 position = n_position;
239 }
while (j != connectors.end());
241 if (currentCluster.size() > 0) {
252 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
261 DictType::iterator i;
270 for (
int j = 0; j < 3; j++) {
309 for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
327 for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
340 if (forLanes.size() == 0) {
342 forLanes.push_back((
int) i);
347 for (std::vector<int>::const_iterator i = forLanes.begin(); i < forLanes.end(); i++) {
369 for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
392 for (
unsigned int i = 0; i <
myNoLanes; i++) {
398 for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
411 std::vector<NIVissimConnection*>
413 std::vector<NIVissimConnection*> ret;
417 if (find(lanes.begin(), lanes.end(), lane) != lanes.end()) {
432 std::pair<NIVissimConnectionCluster*, NBNode*> fromInf, toInf;
433 NBNode* fromNode, *toNode;
434 fromNode = toNode = 0;
438 if (tmpClusters.size() != 0) {
444 fromNode = fromInf.second;
448 toNode = toInf.second;
449 if (fromInf.first != 0 && toNode != 0 && fromInf.first->around(toNode->
getPosition())) {
456 if (fromNode == toNode) {
457 std::pair<NBNode*, NBNode*> tmp =
resolveSameNode(nc, sameNodesOffset, fromNode, toNode);
458 if (fromNode != tmp.first) {
461 if (toNode != tmp.second) {
464 fromNode = tmp.first;
474 if (!nc.
insert(fromNode)) {
475 throw ProcessError(
"Could not insert node '" + fromNode->
getID() +
"' to nodes container.");
483 throw ProcessError(
"Could not insert node '" + toNode->
getID() +
"' to nodes container.");
501 if (fromNode == toNode) {
519 if (tmpClusters.size() > 0) {
521 for (ConnectionClusters::iterator j = tmpClusters.begin(); cont && j != tmpClusters.end(); ++j) {
523 std::string nextID = buildEdge->
getID() +
"[1]";
524 cont = ec.
splitAt(dc, buildEdge, (*j)->getNBNode());
534 std::string
id = toString<int>(distNo);
537 WRITE_WARNING(
"The referenced speed distribution '" +
id +
"' is not known.");
542 if (speed < 0 || speed > 1000) {
543 WRITE_WARNING(
"What about distribution '" + toString<int>(distNo) +
"' ");
586 std::pair<NIVissimConnectionCluster*, NBNode*>
589 assert(clusters.size() >= 1);
593 if (c->
around(beg, MAX_DISTANCE)) {
594 clusters.erase(clusters.begin());
595 return std::pair<NIVissimConnectionCluster*, NBNode*>
621 std::pair<NIVissimConnectionCluster*, NBNode*>
624 if (clusters.size() > 0) {
626 assert(clusters.size() >= 1);
629 if (c->around(end, MAX_DISTANCE)) {
630 clusters.erase(clusters.end() - 1);
631 return std::pair<NIVissimConnectionCluster*, NBNode*>(c, c->getNBNode());
668 std::pair<NBNode*, NBNode*>
672 std::string nid =
"ParkingPlace" + toString<int>(d->
getID());
682 return std::pair<NBNode*, NBNode*>(newNode, toNode);
689 return std::pair<NBNode*, NBNode*>(fromNode, newNode);
695 std::pair<NBNode*, NBNode*>
707 std::string nid =
"ParkingPlace" + toString<int>(d->
getID());
716 return std::pair<NBNode*, NBNode*>(node, prevTo);
720 std::string nid =
"ParkingPlace" + toString<int>(d->
getID());
729 return std::pair<NBNode*, NBNode*>(prevFrom, node);
742 toString<int>(
myID) +
"-End",
748 return std::pair<NBNode*, NBNode*>(node, end);
754 toString<int>(
myID) +
"-Begin",
758 std::cout <<
"nope, NIVissimDisturbance" << std::endl;
761 return std::pair<NBNode*, NBNode*>(beg, node);
766 return std::pair<NBNode*, NBNode*>(node, node);
771 return std::pair<NBNode*, NBNode*>(prevFrom, prevTo);
803 ConnectionClusters::iterator i =
818 ConnectionClusters::iterator i =
827 ConnectionClusters::iterator i =
878 for (DictType::iterator i1 =
myDict.begin(); i1 !=
myDict.end(); i1++) {
883 DictType::iterator i2 = i1;
885 for (; i2 !=
myDict.end(); i2++) {
962 std::vector<int>::iterator i;
979 const std::vector<NIVissimEdge*>&
990 std::ostringstream str;
991 str <<
"The following lanes have no explicit speed information:\n ";