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) {
517 if (tmpClusters.size() > 0) {
519 for (ConnectionClusters::iterator j = tmpClusters.begin(); cont && j != tmpClusters.end(); ++j) {
521 std::string nextID = buildEdge->
getID() +
"[1]";
522 cont = ec.
splitAt(dc, buildEdge, (*j)->getNBNode());
532 std::string
id = toString<int>(distNo);
535 WRITE_WARNING(
"The referenced speed distribution '" +
id +
"' is not known.");
540 if (speed < 0 || speed > 1000) {
541 WRITE_WARNING(
"What about distribution '" + toString<int>(distNo) +
"' ");
584 std::pair<NIVissimConnectionCluster*, NBNode*>
587 assert(clusters.size() >= 1);
591 if (c->
around(beg, MAX_DISTANCE)) {
592 clusters.erase(clusters.begin());
593 return std::pair<NIVissimConnectionCluster*, NBNode*>
619 std::pair<NIVissimConnectionCluster*, NBNode*>
622 if (clusters.size() > 0) {
624 assert(clusters.size() >= 1);
627 if (c->around(end, MAX_DISTANCE)) {
628 clusters.erase(clusters.end() - 1);
629 return std::pair<NIVissimConnectionCluster*, NBNode*>(c, c->getNBNode());
666 std::pair<NBNode*, NBNode*>
670 std::string nid =
"ParkingPlace" + toString<int>(d->
getID());
680 return std::pair<NBNode*, NBNode*>(newNode, toNode);
687 return std::pair<NBNode*, NBNode*>(fromNode, newNode);
693 std::pair<NBNode*, NBNode*>
705 std::string nid =
"ParkingPlace" + toString<int>(d->
getID());
714 return std::pair<NBNode*, NBNode*>(node, prevTo);
718 std::string nid =
"ParkingPlace" + toString<int>(d->
getID());
727 return std::pair<NBNode*, NBNode*>(prevFrom, node);
740 toString<int>(
myID) +
"-End",
746 return std::pair<NBNode*, NBNode*>(node, end);
752 toString<int>(
myID) +
"-Begin",
756 std::cout <<
"nope, NIVissimDisturbance" << std::endl;
759 return std::pair<NBNode*, NBNode*>(beg, node);
764 return std::pair<NBNode*, NBNode*>(node, node);
769 return std::pair<NBNode*, NBNode*>(prevFrom, prevTo);
801 ConnectionClusters::iterator i =
816 ConnectionClusters::iterator i =
825 ConnectionClusters::iterator i =
876 for (DictType::iterator i1 =
myDict.begin(); i1 !=
myDict.end(); i1++) {
881 DictType::iterator i2 = i1;
883 for (; i2 !=
myDict.end(); i2++) {
942 std::vector<NIVissimEdge*>::iterator i;
948 changed |= (*i)->addToTreatAsSame(e);
958 std::vector<int>::iterator i;
975 const std::vector<NIVissimEdge*> &
986 std::ostringstream str;
987 str <<
"The following lanes have no explicit speed information:\n ";