Eclipse SUMO - Simulation of Urban MObility
NIVissimEdge.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // A temporary storage for edges imported from Vissim
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <string>
26 #include <algorithm>
27 #include <map>
28 #include <cassert>
29 #include <iomanip>
30 #include <cmath>
31 #include <iostream>
32 #include <sstream>
33 #include <iterator>
34 #include <utils/common/ToString.h>
36 #include <utils/geom/GeomHelper.h>
38 #include <netbuild/NBNode.h>
39 #include <netbuild/NBNodeCont.h>
41 #include "NIVissimNodeCluster.h"
44 #include "NIVissimConnection.h"
45 #include "NIVissimDisturbance.h"
46 #include "NIVissimEdge.h"
48 
49 
50 // ===========================================================================
51 // static members
52 // ===========================================================================
54 int NIVissimEdge::myMaxID = 0;
55 std::vector<std::string> NIVissimEdge::myLanesWithMissingSpeeds;
56 
57 
58 // ===========================================================================
59 // method definitions
60 // ===========================================================================
62  : myEdgeID(edgeid) {}
63 
64 
65 int
67  int c2id) const {
70  double pos1 =
71  c1->getFromEdgeID() == myEdgeID
72  ? c1->getFromPosition() : c1->getToPosition();
73  double pos2 =
74  c2->getFromEdgeID() == myEdgeID
75  ? c2->getFromPosition() : c2->getToPosition();
76  return pos1 < pos2;
77 }
78 
79 
80 
81 
82 
83 
84 
85 
87  : myEdgeID(edgeid) {}
88 
89 
90 int
93  NIVissimConnectionCluster* cc2) const {
94  double pos1 = cc1->getPositionForEdge(myEdgeID);
95  double pos2 = cc2->getPositionForEdge(myEdgeID);
96  if (pos2 < 0 || pos1 < 0) {
97  cc1->getPositionForEdge(myEdgeID);
98  cc2->getPositionForEdge(myEdgeID);
99  }
100  assert(pos1 >= 0 && pos2 >= 0);
101  return pos1 < pos2;
102 }
103 
104 
105 
106 
107 NIVissimEdge::NIVissimEdge(int id, const std::string& name,
108  const std::string& type,
109  std::vector<double> laneWidths,
110  double zuschlag1, double zuschlag2,
111  double /*length*/, const PositionVector& geom,
112  const NIVissimClosedLanesVector& clv) :
113  NIVissimAbstractEdge(id, geom),
114  myName(name), myType(type), myNoLanes((int)laneWidths.size()),
115  myLaneWidths(laneWidths),
116  myZuschlag1(zuschlag1), myZuschlag2(zuschlag2),
117  myClosedLanes(clv),
118  myLaneSpeeds(myNoLanes, -1),
119  myAmWithinJunction(false)
120  //, mySpeed(-1)
121 {
122  assert(myNoLanes >= 0);
123  if (myMaxID < myID) {
124  myMaxID = myID;
125  }
126 }
127 
128 
130  for (NIVissimClosedLanesVector::iterator i = myClosedLanes.begin(); i != myClosedLanes.end(); i++) {
131  delete (*i);
132  }
133  myClosedLanes.clear();
134 }
135 
136 
137 bool
138 NIVissimEdge::dictionary(int id, const std::string& name,
139  const std::string& type, int noLanes,
140  double zuschlag1, double zuschlag2, double length,
141  const PositionVector& geom,
142  const NIVissimClosedLanesVector& clv) {
143  NIVissimEdge* o = new NIVissimEdge(id, name, type, std::vector<double>(noLanes, NBEdge::UNSPECIFIED_WIDTH),
144  zuschlag1, zuschlag2, length, geom, clv);
145  if (!dictionary(id, o)) {
146  delete o;
147  return false;
148  }
149  return true;
150 }
151 
152 
153 
154 bool
156  DictType::iterator i = myDict.find(id);
157  if (i == myDict.end()) {
158  myDict[id] = o;
159  return true;
160  }
161  return false;
162 }
163 
164 
165 
168  DictType::iterator i = myDict.find(id);
169  if (i == myDict.end()) {
170  return nullptr;
171  }
172  return (*i).second;
173 }
174 
175 
176 void
178  const double MAX_CLUSTER_DISTANCE = 10;
179  // build clusters for all edges made up from not previously assigne
180  // connections
181  for (DictType::iterator i = myDict.begin(); i != myDict.end(); i++) {
182  int edgeid = (*i).first;
183  NIVissimEdge* edge = (*i).second;
184  // get all connectors using this edge
185  std::vector<int> connectors = edge->myIncomingConnections;
186  copy(edge->myOutgoingConnections.begin(), edge->myOutgoingConnections.end(), back_inserter(connectors));
187  if (connectors.size() == 0) {
188  continue;
189  }
190  // sort the connectors by the place on the edge
191  sort(connectors.begin(), connectors.end(), connection_position_sorter(edgeid));
192  // try to cluster the connections participating within the current edge
193  std::vector<int> currentCluster;
194  std::vector<int>::iterator j = connectors.begin();
195  bool outgoing = NIVissimConnection::dictionary(*j)->getFromEdgeID() == (*i).first;
196  double position = outgoing
197  ? NIVissimConnection::dictionary(*j)->getFromPosition()
198  : NIVissimConnection::dictionary(*j)->getToPosition();
199 
200  // skip connections already in a cluster
201  // !!! (?)
202  while (j != connectors.end() && NIVissimConnection::dictionary(*j)->hasNodeCluster()) {
203  ++j;
204  }
205  if (j == connectors.end()) {
206  continue;
207  }
208  currentCluster.push_back(*j);
209  do {
210  if (j + 1 != connectors.end() && !NIVissimConnection::dictionary(*j)->hasNodeCluster()) {
211  bool n_outgoing = NIVissimConnection::dictionary(*(j + 1))->getFromEdgeID() == edgeid;
212  double n_position = n_outgoing
213  ? NIVissimConnection::dictionary(*(j + 1))->getFromPosition()
214  : NIVissimConnection::dictionary(*(j + 1))->getToPosition();
215  if (n_outgoing == outgoing && fabs(n_position - position) < MAX_CLUSTER_DISTANCE) {
216  // ok, in same cluster as prior
217  currentCluster.push_back(*(j + 1));
218  } else {
219  // start new cluster
220  VectorHelper<int>::removeDouble(currentCluster);
221  edge->myConnectionClusters.push_back(new NIVissimConnectionCluster(currentCluster, -1, edgeid));
222  currentCluster.clear();
223  currentCluster.push_back(*(j + 1));
224  }
225  outgoing = n_outgoing;
226  position = n_position;
227  }
228  j++;
229  } while (j != connectors.end());
230  // add last connection
231  if (currentCluster.size() > 0) {
232  VectorHelper<int>::removeDouble(currentCluster);
233  edge->myConnectionClusters.push_back(new NIVissimConnectionCluster(currentCluster, -1, edgeid));
234  }
235  }
236 }
237 
238 
239 void
241  NBEdgeCont& ec, double offset) {
242  for (DictType::iterator i = myDict.begin(); i != myDict.end(); i++) {
243  NIVissimEdge* edge = (*i).second;
244  edge->buildNBEdge(dc, nc, ec, offset);
245  }
246 }
247 
248 
249 void
251  DictType::iterator i;
252  for (i = myDict.begin(); i != myDict.end(); i++) {
253  NIVissimEdge* edge = (*i).second;
254  edge->setDistrictSpeed();
255  }
256  for (i = myDict.begin(); i != myDict.end(); i++) {
257  NIVissimEdge* edge = (*i).second;
258  edge->propagateSpeed(-1, std::vector<int>());
259  }
260  for (int j = 0; j < 3; j++) {
261  for (i = myDict.begin(); i != myDict.end(); i++) {
262  NIVissimEdge* edge = (*i).second;
263  edge->propagateOwn();
264  }
265  for (i = myDict.begin(); i != myDict.end(); i++) {
266  NIVissimEdge* edge = (*i).second;
268  }
269  }
270 }
271 
272 
273 void
275  for (int i = 0; i < (int) myLaneSpeeds.size(); i++) {
276  if (myLaneSpeeds[i] == -1) {
277  double speed = -1;
278  int j1 = i - 1; // !!! recheck - j1 may become negative?
279  int j2 = i;
280  while (j2 != (int) myLaneSpeeds.size() && myLaneSpeeds[j2] == -1) {
281  j2++;
282  }
283  if (j1 < 0) {
284  if (j2 < (int) myLaneSpeeds.size()) {
285  speed = myLaneSpeeds[j2];
286  }
287  } else {
288  if (j2 >= (int) myLaneSpeeds.size()) {
289  speed = myLaneSpeeds[j1];
290  } else {
291  speed = (myLaneSpeeds[j1] + myLaneSpeeds[j2]) / (double) 2.0;
292  }
293  }
294  if (speed == -1) {
295  continue;
296  }
297  myLaneSpeeds[i] = speed;
298  std::vector<NIVissimConnection*> connected = getOutgoingConnected(i);
299  for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
300  NIVissimConnection* c = *j;
302  // propagate
303  e->propagateSpeed(/*dc, */speed, c->getToLanes());
304  }
305  }
306  }
307 }
308 
309 
310 void
312  for (int i = 0; i < (int) myLaneSpeeds.size(); i++) {
313  if (myLaneSpeeds[i] == -1) {
314  continue;
315  }
316  std::vector<NIVissimConnection*> connected = getOutgoingConnected(i);
317  for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
318  NIVissimConnection* c = *j;
320  // propagate
321  e->propagateSpeed(/*dc, */myLaneSpeeds[i], c->getToLanes());
322  }
323  }
324 }
325 
326 
327 void
328 NIVissimEdge::propagateSpeed(double speed, std::vector<int> forLanes) {
329  // if no lane is given, all set be set
330  if (forLanes.size() == 0) {
331  for (int i = 0; i < myNoLanes; i++) {
332  forLanes.push_back((int) i);
333  }
334  }
335  // for the case of a first call
336  // go through the lanes
337  for (std::vector<int>::const_iterator i = forLanes.begin(); i < forLanes.end(); i++) {
338  // check whether a speed was set before
339  if (myLaneSpeeds[*i] != -1) {
340  // do not reset it from incoming
341  continue;
342  }
343  // check whether the lane has a new speed to set
344  if ((int) myPatchedSpeeds.size() > *i && myPatchedSpeeds[*i] != -1) {
345  // use it
346  speed = getRealSpeed(/*dc, */myPatchedSpeeds[*i]);
347  }
348  // check whether a speed is given
349  if (speed == -1) {
350  // do nothing if not
351  continue;
352  }
353  // set the lane's speed to the given
354  myLaneSpeeds[*i] = speed;
355  // propagate the speed further
356  // get the list of connected edges
357  std::vector<NIVissimConnection*> connected = getOutgoingConnected(*i);
358  // go throught the list
359  for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
360  NIVissimConnection* c = *j;
362  // propagate
363  e->propagateSpeed(/*dc, */speed, c->getToLanes());
364  }
365  }
366 }
367 
368 
369 
370 void
372  if (myDistrictConnections.size() > 0) {
373  double pos = *(myDistrictConnections.begin());
374  if (pos < getLength() - pos) {
377  if (d != nullptr) {
378  double speed = d->getMeanSpeed(/*dc*/);
379  if (speed == -1) {
380  return;
381  }
382  for (int i = 0; i < myNoLanes; i++) {
383  myLaneSpeeds[i] = speed;
384  // propagate the speed further
385  // get the list of connected edges
386  std::vector<NIVissimConnection*> connected = getOutgoingConnected(i);
387  // go throught the list
388  for (std::vector<NIVissimConnection*>::iterator j = connected.begin(); j != connected.end(); j++) {
389  NIVissimConnection* c = *j;
391  // propagate
392  e->propagateSpeed(/*dc, */speed, c->getToLanes());
393  }
394  }
395  }
396  }
397  }
398 }
399 
400 
401 std::vector<NIVissimConnection*>
403  std::vector<NIVissimConnection*> ret;
404  for (std::vector<int>::const_iterator i = myOutgoingConnections.begin(); i != myOutgoingConnections.end(); i++) {
406  const std::vector<int>& lanes = c->getFromLanes();
407  if (find(lanes.begin(), lanes.end(), lane) != lanes.end()) {
409  if (e != nullptr) {
410  ret.push_back(c);
411  }
412  }
413  }
414  return ret;
415 }
416 
417 
418 void
420  double sameNodesOffset) {
421  // build the edge
422  std::pair<NIVissimConnectionCluster*, NBNode*> fromInf, toInf;
423  NBNode* fromNode, *toNode;
424  fromNode = toNode = nullptr;
426  sort(myDistrictConnections.begin(), myDistrictConnections.end());
428  if (tmpClusters.size() != 0) {
429  sort(tmpClusters.begin(), tmpClusters.end(), connection_cluster_position_sorter(myID));
430  // get or build the from-node
431  // A node may have to be build when the edge starts or ends at
432  // a parking place or something like this
433  fromInf = getFromNode(nc, tmpClusters);
434  fromNode = fromInf.second;
435  // get or build the to-node
436  //if(tmpClusters.size()>0) {
437  toInf = getToNode(nc, tmpClusters);
438  toNode = toInf.second;
439  if (fromInf.first != 0 && toNode != nullptr && fromInf.first->around(toNode->getPosition())) {
440  WRITE_WARNING("Will not build edge '" + toString(myID) + "'.");
441  myAmWithinJunction = true;
442  return;
443  }
444  //}
445  // if both nodes are the same, resolve the problem otherwise
446  if (fromNode == toNode) {
447  std::pair<NBNode*, NBNode*> tmp = resolveSameNode(nc, sameNodesOffset, fromNode, toNode);
448  if (fromNode != tmp.first) {
449  fromInf.first = 0;
450  }
451  if (toNode != tmp.second) {
452  toInf.first = 0;
453  }
454  fromNode = tmp.first;
455  toNode = tmp.second;
456  }
457  }
458 
459  //
460  if (fromNode == nullptr) {
461  fromInf.first = 0;
462  Position pos = myGeom[0];
463  fromNode = new NBNode(toString<int>(myID) + "-SourceNode", pos, NODETYPE_NOJUNCTION);
464  if (!nc.insert(fromNode)) {
465  throw ProcessError("Could not insert node '" + fromNode->getID() + "' to nodes container.");
466  }
467  }
468  if (toNode == nullptr) {
469  toInf.first = 0;
470  Position pos = myGeom[-1];
471  toNode = new NBNode(toString<int>(myID) + "-DestinationNode", pos, NODETYPE_NOJUNCTION);
472  if (!nc.insert(toNode)) {
473  throw ProcessError("Could not insert node '" + toNode->getID() + "' to nodes container.");
474  }
475  }
476 
477  // build the edge
478  double avgSpeed = 0;
479  for (int i = 0; i < myNoLanes; i++) {
480  if ((int)myLaneSpeeds.size() <= i || myLaneSpeeds[i] == -1) {
481  myLanesWithMissingSpeeds.push_back(toString(myID) + "_" + toString(i));
482  avgSpeed += OptionsCont::getOptions().getFloat("vissim.default-speed");
483  } else {
484  avgSpeed += myLaneSpeeds[i];
485  }
486  }
487  avgSpeed /= (double) myLaneSpeeds.size();
488  avgSpeed *= OptionsCont::getOptions().getFloat("vissim.speed-norm");
489 
490  if (fromNode == toNode) {
491  WRITE_WARNING("Could not build edge '" + toString(myID) + "'; would connect same node.");
492  return;
493  }
494 
495  NBEdge* buildEdge = new NBEdge(toString<int>(myID), fromNode, toNode, myType,
496  avgSpeed / (double) 3.6, myNoLanes, -1,
498  myGeom, myName, "", LANESPREAD_CENTER, true);
499  for (int i = 0; i < myNoLanes; i++) {
500  buildEdge->setLaneWidth(i, myLaneWidths[i]);
501  if ((int) myLaneSpeeds.size() <= i || myLaneSpeeds[i] == -1) {
502  buildEdge->setSpeed(i, OptionsCont::getOptions().getFloat("vissim.default-speed") / (double) 3.6);
503  } else {
504  buildEdge->setSpeed(i, myLaneSpeeds[i] / (double) 3.6);
505  }
506  }
507  ec.insert(buildEdge);
508  // check whether the edge contains any other clusters
509  if (tmpClusters.size() > 0) {
510  bool cont = true;
511  for (ConnectionClusters::iterator j = tmpClusters.begin(); cont && j != tmpClusters.end(); ++j) {
512  // split the edge at the previously build node
513  std::string nextID = buildEdge->getID() + "[1]";
514  cont = ec.splitAt(dc, buildEdge, (*j)->getNBNode());
515  // !!! what to do if the edge could not be split?
516  buildEdge = ec.retrieve(nextID);
517  }
518  }
519 }
520 
521 
522 double
524  std::string id = toString<int>(distNo);
525  Distribution* dist = DistributionCont::dictionary("speed", id);
526  if (dist == nullptr) {
527  WRITE_WARNING("The referenced speed distribution '" + id + "' is not known.");
528  return -1;
529  }
530  assert(dist != 0);
531  double speed = dist->getMax();
532  if (speed < 0 || speed > 1000) {
533  WRITE_WARNING("What about distribution '" + toString<int>(distNo) + "' ");
534  }
535  return speed;
536 }
537 
538 /*
539 bool
540 NIVissimEdge::recheckSpeedPatches()
541 {
542 // int speed_idx = -1;
543  // check set speeds
544  if(myPatchedSpeeds.size()!=0) {
545  std::vector<double>::iterator i =
546  std::find(myPatchedSpeeds.begin(), myPatchedSpeeds.end(), -1);
547  if(myPatchedSpeeds.size()!=myNoLanes||i!=myPatchedSpeeds.end()) {
548  cot << "Warning! Not all lanes are patched! (edge:" << myID << ")." << endl;
549  }
550  //
551  if(std::vector<double>Helper::maxValue(myPatchedSpeeds)!=std::vector<double>Helper::minValue(myPatchedSpeeds)) {
552  cot << "Warning! Not all lanes have the same speed!! (edge:" << myID << ")." << endl;
553  }
554  //
555 / // !!! ist natuerlich Quatsch - erst recht, wenn Edges zusammengefasst werden
556  speed = std::vector<double>Helper::sum(myPatchedSpeeds);
557  speed /= (double) myPatchedSpeeds.size();*/
558 /* return true;
559  }
560  if(myDistrictConnections.size()>0) {
561  double pos = *(myDistrictConnections.begin());
562 // if(pos<10) {
563  NIVissimDistrictConnection *d =
564  NIVissimDistrictConnection::dict_findForEdge(myID);
565  if(d!=0) {
566  return true;
567 // speed = d->getMeanSpeed();
568  }
569 // }
570 // return true;
571  }
572  return false;
573 }
574 */
575 
576 std::pair<NIVissimConnectionCluster*, NBNode*>
578  // changed MAX_DISTANCE from 10 to 3.5, because 3.5 is the default lane width in VISSIM
579  const double MAX_DISTANCE = 3.5;
580  assert(clusters.size() >= 1);
581  const Position& beg = myGeom.front();
582  NIVissimConnectionCluster* c = *(clusters.begin());
583  // check whether the edge starts within a already build node
584  if (c->around(beg, MAX_DISTANCE)) {
585  clusters.erase(clusters.begin());
586  return std::pair<NIVissimConnectionCluster*, NBNode*>
587  (c, c->getNBNode());
588  }
589  // check for a parking place at the begin
590  if (myDistrictConnections.size() > 0) {
591  double pos = *(myDistrictConnections.begin());
592  if (pos < 10) {
593  NBNode* node = new NBNode(toString<int>(myID) + "-begin", beg, NODETYPE_NOJUNCTION);
594  if (!nc.insert(node)) {
595  throw 1;
596  }
597  while (myDistrictConnections.size() > 0 && *(myDistrictConnections.begin()) < 10) {
599  }
600  return std::pair<NIVissimConnectionCluster*, NBNode*>(static_cast<NIVissimConnectionCluster*>(nullptr), node);
601  }
602  }
603  // build a new node for the edge's begin otherwise
604  NBNode* node = new NBNode(toString<int>(myID) + "-begin", beg, NODETYPE_NOJUNCTION);
605  if (!nc.insert(node)) {
606  throw 1;
607  }
608  return std::pair<NIVissimConnectionCluster*, NBNode*>(static_cast<NIVissimConnectionCluster*>(nullptr), node);
609 }
610 
611 
612 std::pair<NIVissimConnectionCluster*, NBNode*>
614  const Position& end = myGeom.back();
615  if (clusters.size() > 0) {
616  const double MAX_DISTANCE = 10.;
617  assert(clusters.size() >= 1);
618  NIVissimConnectionCluster* c = *(clusters.end() - 1);
619  // check whether the edge ends within a already build node
620  if (c->around(end, MAX_DISTANCE)) {
621  clusters.erase(clusters.end() - 1);
622  return std::pair<NIVissimConnectionCluster*, NBNode*>(c, c->getNBNode());
623  }
624  }
625  // check for a parking place at the end
626  if (myDistrictConnections.size() > 0) {
627  double pos = *(myDistrictConnections.end() - 1);
628  if (pos > myGeom.length() - 10) {
629  NBNode* node = new NBNode(toString<int>(myID) + "-end", end, NODETYPE_NOJUNCTION);
630  if (!nc.insert(node)) {
631  throw 1;
632  }
633  while (myDistrictConnections.size() > 0 && *(myDistrictConnections.end() - 1) < myGeom.length() - 10) {
635  }
636  return std::pair<NIVissimConnectionCluster*, NBNode*>(static_cast<NIVissimConnectionCluster*>(nullptr), node);
637  }
638  }
639 
640  // build a new node for the edge's end otherwise
641  NBNode* node = new NBNode(toString<int>(myID) + "-end", end, NODETYPE_NOJUNCTION);
642  if (!nc.insert(node)) {
643  throw 1;
644  }
645  return std::pair<NIVissimConnectionCluster*, NBNode*>(static_cast<NIVissimConnectionCluster*>(nullptr), node);
646  /*
647  if (clusters.size()>0) {
648  NIVissimConnectionCluster *c = *(clusters.end()-1);
649  clusters.erase(clusters.end()-1);
650  return std::pair<NIVissimConnectionCluster*, NBNode*>(c, c->getNBNode());
651  } else {
652  // !!! self-loop edge?!
653  return std::pair<NIVissimConnectionCluster*, NBNode*>(static_cast<NIVissimConnectionCluster*>(0), (*(myConnectionClusters.begin()))->getNBNode());
654  }
655  */
656 }
657 
658 
659 std::pair<NBNode*, NBNode*>
662  NBNode* fromNode, NBNode* toNode) {
663  std::string nid = "ParkingPlace" + toString<int>(d->getID());
664  if (d->geomPosition().distanceTo(fromNode->getPosition())
665  <
666  d->geomPosition().distanceTo(toNode->getPosition())) {
667 
668  NBNode* newNode = new NBNode(nid,
669  fromNode->getPosition(),
671  nc.erase(fromNode);
672  nc.insert(newNode);
673  return std::pair<NBNode*, NBNode*>(newNode, toNode);
674  } else {
675  NBNode* newNode = new NBNode(nid,
676  toNode->getPosition(),
678  nc.erase(toNode);
679  nc.insert(newNode);
680  return std::pair<NBNode*, NBNode*>(fromNode, newNode);
681  }
682 }
683 
684 
685 
686 std::pair<NBNode*, NBNode*>
688  NBNode* prevFrom, NBNode* prevTo) {
689  // check whether the edge is connected to a district
690  // use it if so
693  if (d != nullptr) {
694  Position pos = d->geomPosition();
695  double position = d->getPosition();
696  // the district is at the begin of the edge
697  if (myGeom.length() - position > position) {
698  std::string nid = "ParkingPlace" + toString<int>(d->getID());
699  NBNode* node = nc.retrieve(nid);
700  if (node == nullptr) {
701  node = new NBNode(nid,
702  pos, NODETYPE_NOJUNCTION);
703  if (!nc.insert(node)) {
704  throw 1;
705  }
706  }
707  return std::pair<NBNode*, NBNode*>(node, prevTo);
708  }
709  // the district is at the end of the edge
710  else {
711  std::string nid = "ParkingPlace" + toString<int>(d->getID());
712  NBNode* node = nc.retrieve(nid);
713  if (node == nullptr) {
714  node = new NBNode(nid, pos, NODETYPE_NOJUNCTION);
715  if (!nc.insert(node)) {
716  throw 1;
717  }
718  }
719  assert(node != 0);
720  return std::pair<NBNode*, NBNode*>(prevFrom, node);
721  }
722  }
723  // otherwise, check whether the edge is some kind of
724  // a dead end...
725  // check which end is nearer to the node centre
726  if (myConnectionClusters.size() == 1) {
727  NBNode* node = prevFrom; // it is the same as getToNode()
728 
730  // no end node given
731  if (c->around(myGeom.front(), offset) && !c->around(myGeom.back(), offset)) {
732  NBNode* end = new NBNode(
733  toString<int>(myID) + "-End",
734  myGeom.back(),
736  if (!nc.insert(end)) {
737  throw 1;
738  }
739  return std::pair<NBNode*, NBNode*>(node, end);
740  }
741 
742  // no begin node given
743  if (!c->around(myGeom.front(), offset) && c->around(myGeom.back(), offset)) {
744  NBNode* beg = new NBNode(
745  toString<int>(myID) + "-Begin",
746  myGeom.front(),
748  if (!nc.insert(beg)) {
749  std::cout << "nope, NIVissimDisturbance" << std::endl;
750  throw 1;
751  }
752  return std::pair<NBNode*, NBNode*>(beg, node);
753  }
754 
755  // self-loop edge - both points lie within the same cluster
756  if (c->around(myGeom.front()) && c->around(myGeom.back())) {
757  return std::pair<NBNode*, NBNode*>(node, node);
758  }
759  }
760  // what to do in other cases?
761  // It simply is a self-looping edge....
762  return std::pair<NBNode*, NBNode*>(prevFrom, prevTo);
763 }
764 
765 
766 
767 
768 void
770  myNode = nodeid;
771 }
772 
773 
774 void
776 
777 
778 void
780  myIncomingConnections.push_back(id);
781 }
782 
783 
784 void
786  myOutgoingConnections.push_back(id);
787 }
788 
789 
790 
791 void
794  ConnectionClusters::iterator i =
795  std::find(myConnectionClusters.begin(), myConnectionClusters.end(), old);
796  if (i != myConnectionClusters.end()) {
797  myConnectionClusters.erase(i);
798  }
799  i = std::find(myConnectionClusters.begin(), myConnectionClusters.end(), act);
800  if (i == myConnectionClusters.end()) {
801  myConnectionClusters.push_back(act);
802  }
803 }
804 
805 
806 
807 void
809  ConnectionClusters::iterator i =
810  std::find(myConnectionClusters.begin(), myConnectionClusters.end(), c);
811  assert(i != myConnectionClusters.end());
812  myConnectionClusters.erase(i);
813 }
814 
815 
816 void
818  ConnectionClusters::iterator i =
819  std::find(myConnectionClusters.begin(), myConnectionClusters.end(), c);
820  if (i == myConnectionClusters.end()) {
821  myConnectionClusters.push_back(c);
822  }
823 }
824 
825 
826 Position // !!! reference?
828  return myGeom[0];
829 }
830 
831 
832 Position // !!! reference?
834  return myGeom[-1];
835 }
836 
837 
838 double
840  return myGeom.length();
841 }
842 
843 
844 void
846  if (find(myDistrictConnections.begin(), myDistrictConnections.end(), pos) == myDistrictConnections.end()) {
847  myDistrictConnections.push_back(pos);
848  /* int id = NIVissimConnection::getMaxID() + 1;
849  std::vector<int> currentCluster;
850  currentCluster.push_back(id);
851  myConnectionClusters.push_back(
852  new NIVissimConnectionCluster(currentCluster, -1, myID));*/
853  }
854 }
855 
856 
857 void
858 NIVissimEdge::setSpeed(int lane, int speedDist) {
859  while ((int)myPatchedSpeeds.size() <= lane) {
860  myPatchedSpeeds.push_back(-1);
861  }
862  myPatchedSpeeds[lane] = speedDist;
863 }
864 
865 
866 void
868  // go through the edges
869  for (DictType::iterator i1 = myDict.begin(); i1 != myDict.end(); i1++) {
870  // retrieve needed values from the first edge
871  NIVissimEdge* e1 = (*i1).second;
872  const PositionVector& g1 = e1->getGeometry();
873  // check all other edges
874  DictType::iterator i2 = i1;
875  i2++;
876  for (; i2 != myDict.end(); i2++) {
877  // retrieve needed values from the second edge
878  NIVissimEdge* e2 = (*i2).second;
879  const PositionVector& g2 = e2->getGeometry();
880  // get the connection description
881  NIVissimConnection* c = e1->getConnectionTo(e2);
882  if (c == nullptr) {
883  c = e2->getConnectionTo(e1);
884  }
885  // the edge must not be a direct contiuation of the other
886  if (c != nullptr) {
887  if ((c->getFromEdgeID() == e1->getID() && fabs(c->getFromPosition() - e1->getGeometry().length()) < 5)
888  ||
889  (c->getFromEdgeID() == e2->getID() && fabs(c->getFromPosition() - e2->getGeometry().length()) < 5)) {
890 
891  continue;
892  }
893  }
894  // only parallel edges which do end at the same node
895  // should be joined
896  // check for parallelity
897  // !!! the usage of an explicit value is not very fine
898  if (fabs(GeomHelper::angleDiff(g1.beginEndAngle(), g2.beginEndAngle())) > DEG2RAD(2.0)) {
899  // continue if the lines are not parallel
900  continue;
901  }
902 
903  // check whether the same node is approached
904  // (the distance between the ends should not be too large)
905  // !!! the usage of an explicit value is not very fine
906  if (g1.back().distanceTo(g2.back()) > 10) {
907  // continue if the lines do not end at the same length
908  continue;
909  }
910  // ok, seem to be different lanes for the same edge
911  // mark as possibly joined later
912  e1->addToTreatAsSame(e2);
913  e2->addToTreatAsSame(e1);
914  }
915  }
916 }
917 
918 
919 bool
921  if (e == this) {
922  return false;
923  }
924  // check whether this edge already knows about the other
925  if (find(myToTreatAsSame.begin(), myToTreatAsSame.end(), e) == myToTreatAsSame.end()) {
926  myToTreatAsSame.push_back(e);
927  return true;
928  } else {
929  return false; // !!! check this
930  }
931  /*
932  //
933  std::vector<NIVissimEdge*>::iterator i;
934  // add to all other that shall be treated as same
935  bool changed = true;
936  while (changed) {
937  changed = false;
938  for (i = myToTreatAsSame.begin(); !changed && i != myToTreatAsSame.end(); i++) {
939  changed |= (*i)->addToTreatAsSame(e);
940  }
941  for (i = myToTreatAsSame.begin(); !changed && i != myToTreatAsSame.end(); i++) {
942  changed |= e->addToTreatAsSame(*i);
943  }
944  }
945  */
946 }
947 
950  std::vector<int>::iterator i;
951  for (i = myIncomingConnections.begin(); i != myIncomingConnections.end(); i++) {
953  if (c->getFromEdgeID() == e->getID()) {
954  return c;
955  }
956  }
957  for (i = myOutgoingConnections.begin(); i != myOutgoingConnections.end(); i++) {
959  if (c->getToEdgeID() == e->getID()) {
960  return c;
961  }
962  }
963  return nullptr;
964 }
965 
966 
967 const std::vector<NIVissimEdge*>&
969  return myToTreatAsSame;
970 }
971 
972 
973 void
975  if (myLanesWithMissingSpeeds.size() == 0) {
976  return;
977  }
978  std::ostringstream str;
979  str << "The following lanes have no explicit speed information:\n ";
980  for (std::vector<std::string>::iterator i = myLanesWithMissingSpeeds.begin(); i != myLanesWithMissingSpeeds.end(); ++i) {
981  if (i != myLanesWithMissingSpeeds.begin()) {
982  str << ", ";
983  }
984  str << *i;
985  }
986  WRITE_WARNING(str.str());
987 }
988 
989 
992  // @todo seems as this would have been a hard hack!
993  /*
994  for (std::vector<int>::const_iterator i = myIncomingConnections.begin(); i != myIncomingConnections.end(); ++i) {
995  NIVissimConnection* c = NIVissimConnection::dictionary(*i);
996  return NIVissimEdge::dictionary(c->getFromEdgeID());
997  }
998  return 0;
999  */
1000  if (myIncomingConnections.size() != 0) {
1002  }
1003  return nullptr;
1004 }
1005 
1006 
1007 NIVissimEdge*
1009  // @todo seems as this would have been a hard hack!
1010  /*
1011  for (std::vector<int>::const_iterator i = myOutgoingConnections.begin(); i != myOutgoingConnections.end(); ++i) {
1012  NIVissimConnection* c = NIVissimConnection::dictionary(*i);
1013  return NIVissimEdge::dictionary(c->getToEdgeID());
1014  }
1015  return 0;
1016  */
1017  if (myOutgoingConnections.size() != 0) {
1019  }
1020  return nullptr;
1021 }
1022 
1023 
1024 
1025 /****************************************************************************/
1026 
NIVissimAbstractEdge
Definition: NIVissimAbstractEdge.h:36
NIVissimEdge::myLaneWidths
std::vector< double > myLaneWidths
Definition: NIVissimEdge.h:260
NIVissimDistrictConnection::getPosition
double getPosition() const
Returns the position of the connection at the edge.
Definition: NIVissimDistrictConnection.h:59
NIVissimEdge::getBegin2D
Position getBegin2D() const
Definition: NIVissimEdge.cpp:827
VectorHelper::removeDouble
static void removeDouble(std::vector< T > &v)
Definition: VectorHelper.h:68
NBEdge::UNSPECIFIED_OFFSET
static const double UNSPECIFIED_OFFSET
unspecified lane offset
Definition: NBEdge.h:318
PositionVector::beginEndAngle
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position
Definition: PositionVector.cpp:808
ToString.h
NIVissimConnectionCluster::getNBNode
NBNode * getNBNode() const
Definition: NIVissimConnectionCluster.cpp:576
NIVissimEdge::buildConnectionClusters
static void buildConnectionClusters()
Clusters connections of each edge.
Definition: NIVissimEdge.cpp:177
NIVissimClosedLanesVector
std::vector< NIVissimClosedLaneDef * > NIVissimClosedLanesVector
Definition: NIVissimClosedLanesVector.h:29
Distribution
Definition: Distribution.h:37
NIVissimEdge::myClosedLanes
NIVissimClosedLanesVector myClosedLanes
List of lanes closed on this edge.
Definition: NIVissimEdge.h:266
NBEdgeCont::retrieve
NBEdge * retrieve(const std::string &id, bool retrieveExtracted=false) const
Returns the edge that has the given id.
Definition: NBEdgeCont.cpp:246
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
DistributionCont::dictionary
static bool dictionary(const std::string &type, const std::string &id, Distribution *d)
Adds a distribution of the given type and name to the container.
Definition: DistributionCont.cpp:34
NIVissimEdge.h
NBEdgeCont
Storage for edges, including some functionality operating on multiple edges.
Definition: NBEdgeCont.h:60
NIVissimEdge
A temporary storage for edges imported from Vissim.
Definition: NIVissimEdge.h:52
GeomHelper::angleDiff
static double angleDiff(const double angle1, const double angle2)
Returns the difference of the second angle to the first angle in radiants.
Definition: GeomHelper.cpp:180
NIVissimEdge::propagateSpeed
void propagateSpeed(double speed, std::vector< int > forLanes)
Definition: NIVissimEdge.cpp:328
NIVissimEdge::NIVissimEdge
NIVissimEdge(int id, const std::string &name, const std::string &type, std::vector< double > laneWidths, double zuschlag1, double zuschlag2, double length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
Constructor.
Definition: NIVissimEdge.cpp:107
NIVissimEdge::addIncomingConnection
void addIncomingConnection(int id)
Adds a connection where this edge is the destination.
Definition: NIVissimEdge.cpp:779
NIVissimEdge::myDict
static DictType myDict
The dictionary.
Definition: NIVissimEdge.h:293
NIVissimConnection::getToPosition
double getToPosition() const
Definition: NIVissimConnection.cpp:174
NIVissimEdge::connection_position_sorter
Definition: NIVissimEdge.h:217
OptionsCont.h
NIVissimEdge::getRealSpeed
double getRealSpeed(int distNo)
Definition: NIVissimEdge.cpp:523
MsgHandler.h
NBNodeCont::insert
bool insert(const std::string &id, const Position &position, NBDistrict *district=0)
Inserts a node into the map.
Definition: NBNodeCont.cpp:78
NIVissimEdge::myType
std::string myType
The type of the edge.
Definition: NIVissimEdge.h:256
NIVissimEdge::setSpeed
void setSpeed(int lane, int speedDist)
Definition: NIVissimEdge.cpp:858
NIVissimEdge::connection_cluster_position_sorter
Definition: NIVissimEdge.h:236
NIVissimEdge::myAmWithinJunction
bool myAmWithinJunction
Information whether this edge was not build due to being within a junction.
Definition: NIVissimEdge.h:286
NIVissimEdge::getFromNode
std::pair< NIVissimConnectionCluster *, NBNode * > getFromNode(NBNodeCont &nc, ConnectionClusters &clusters)
Returns the origin node.
Definition: NIVissimEdge.cpp:577
NIVissimEdge::addOutgoingConnection
void addOutgoingConnection(int id)
Adds a connection where this edge is the source.
Definition: NIVissimEdge.cpp:785
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
NIVissimEdge::buildNBEdge
void buildNBEdge(NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec, double sameNodesOffset)
Builds the NBEdge from this VissimEdge.
Definition: NIVissimEdge.cpp:419
NIVissimEdge::mergedInto
void mergedInto(NIVissimConnectionCluster *old, NIVissimConnectionCluster *act)
Definition: NIVissimEdge.cpp:792
NBEdgeCont::insert
bool insert(NBEdge *edge, bool ignorePrunning=false)
Adds an edge to the dictionary.
Definition: NBEdgeCont.cpp:153
PositionVector::length
double length() const
Returns the length.
Definition: PositionVector.cpp:484
Distribution::getMax
virtual double getMax() const =0
Returns the maximum value of this distribution.
NIVissimEdge::myOutgoingConnections
std::vector< int > myOutgoingConnections
List of connections outgoing from this edge.
Definition: NIVissimEdge.h:275
PositionVector
A list of positions.
Definition: PositionVector.h:45
NIVissimEdge::checkDistrictConnectionExistanceAt
void checkDistrictConnectionExistanceAt(double pos)
Definition: NIVissimEdge.cpp:845
NIVissimConnectionCluster::getPositionForEdge
double getPositionForEdge(int edgeid) const
Definition: NIVissimConnectionCluster.cpp:621
NIVissimAbstractEdge::getID
int getID() const
Definition: NIVissimAbstractEdge.cpp:147
NBDistrictCont
A container for districts.
Definition: NBDistrictCont.h:52
LANESPREAD_CENTER
@ LANESPREAD_CENTER
Definition: SUMOXMLDefinitions.h:1099
NBEdgeCont::splitAt
bool splitAt(NBDistrictCont &dc, NBEdge *edge, NBNode *node)
Splits the edge at the position nearest to the given node.
Definition: NBEdgeCont.cpp:557
NIVissimConnection::getToEdgeID
int getToEdgeID() const
Definition: NIVissimConnection.cpp:162
NIVissimEdge::connection_cluster_position_sorter::operator()
int operator()(NIVissimConnectionCluster *cc1, NIVissimConnectionCluster *cc2) const
comparing operation
Definition: NIVissimEdge.cpp:91
NIVissimEdge::checkUnconnectedLaneSpeeds
void checkUnconnectedLaneSpeeds()
Definition: NIVissimEdge.cpp:274
NBNodeCont
Container for nodes during the netbuilding process.
Definition: NBNodeCont.h:59
NBNodeCont::erase
bool erase(NBNode *node)
Removes the given node, deleting it.
Definition: NBNodeCont.cpp:137
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
NIVissimEdge::myDistrictConnections
std::vector< double > myDistrictConnections
Definition: NIVissimEdge.h:277
NIVissimEdge::dictionary
static bool dictionary(int id, const std::string &name, const std::string &type, int noLanes, double zuschlag1, double zuschlag2, double length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
Adds the described item to the dictionary Builds the edge first.
Definition: NIVissimEdge.cpp:138
NIVissimEdge::addToTreatAsSame
bool addToTreatAsSame(NIVissimEdge *e)
Definition: NIVissimEdge.cpp:920
NIVissimDistrictConnection::getID
int getID() const
Returns the id of the connection.
Definition: NIVissimDistrictConnection.h:54
NBNode::getPosition
const Position & getPosition() const
Definition: NBNode.h:247
NIVissimEdge::myName
std::string myName
The name of the edge.
Definition: NIVissimEdge.h:253
NIVissimDisturbance.h
NIVissimEdge::connection_position_sorter::connection_position_sorter
connection_position_sorter(int edgeid)
constructor
Definition: NIVissimEdge.cpp:61
NIVissimEdge::buildGeom
void buildGeom()
Definition: NIVissimEdge.cpp:775
NIVissimConnectionCluster::around
bool around(const Position &p, double offset=0) const
Definition: NIVissimConnectionCluster.cpp:582
NIVissimEdge::myToTreatAsSame
std::vector< NIVissimEdge * > myToTreatAsSame
Definition: NIVissimEdge.h:283
NIVissimAbstractEdge::myID
int myID
Definition: NIVissimAbstractEdge.h:65
Position::distanceTo
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:233
NIVissimEdge::ConnectionClusters
std::vector< NIVissimConnectionCluster * > ConnectionClusters
The definition for a container for connection clusters.
Definition: NIVissimEdge.h:163
NIVissimConnection
Definition: NIVissimConnection.h:45
ProcessError
Definition: UtilExceptions.h:39
NBEdge::setSpeed
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3345
NIVissimEdge::reportUnsetSpeeds
static void reportUnsetSpeeds()
Writes edges with unset speeds to the warnings message log instance.
Definition: NIVissimEdge.cpp:974
NIVissimEdge::setNodeCluster
void setNodeCluster(int nodeid)
Definition: NIVissimEdge.cpp:769
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
NIVissimConnection::getFromPosition
double getFromPosition() const
Definition: NIVissimConnection.cpp:168
NIVissimEdge::resolveSameNode
std::pair< NBNode *, NBNode * > resolveSameNode(NBNodeCont &nc, double offset, NBNode *prevFrom, NBNode *prevTo)
Tries to resolve the problem that the same node has been returned as origin and destination node.
Definition: NIVissimEdge.cpp:687
NIVissimEdge::myLanesWithMissingSpeeds
static std::vector< std::string > myLanesWithMissingSpeeds
Definition: NIVissimEdge.h:298
NIVissimAbstractEdge::getGeometry
const PositionVector & getGeometry() const
Definition: NIVissimAbstractEdge.cpp:161
NIVissimAbstractEdge::myNode
int myNode
Definition: NIVissimAbstractEdge.h:68
NIVissimDistrictConnection::dict_findForEdge
static NIVissimDistrictConnection * dict_findForEdge(int edgeid)
Returns the connection to a district placed at the given node Yep, there onyl should be one,...
Definition: NIVissimDistrictConnection.cpp:338
NIVissimEdge::myZuschlag2
double myZuschlag2
Definition: NIVissimEdge.h:263
NIVissimEdge::propagateOwn
void propagateOwn()
Definition: NIVissimEdge.cpp:311
NIVissimEdge::getBestIncoming
NIVissimEdge * getBestIncoming() const
Definition: NIVissimEdge.cpp:991
NIVissimNodeCluster.h
NIVissimEdge::dict_buildNBEdges
static void dict_buildNBEdges(NBDistrictCont &dc, NBNodeCont &nc, NBEdgeCont &ec, double offset)
Builds NBEdges from the VissimEdges within the dictionary.
Definition: NIVissimEdge.cpp:240
NIVissimEdge::removeFromConnectionCluster
void removeFromConnectionCluster(NIVissimConnectionCluster *c)
Definition: NIVissimEdge.cpp:808
NIVissimEdge::getToTreatAsSame
const std::vector< NIVissimEdge * > & getToTreatAsSame() const
Definition: NIVissimEdge.cpp:968
NBNodeCont::retrieve
NBNode * retrieve(const std::string &id) const
Returns the node with the given name.
Definition: NBNodeCont.cpp:107
DEG2RAD
#define DEG2RAD(x)
Definition: GeomHelper.h:37
NIVissimDistrictConnection::geomPosition
Position geomPosition() const
Returns the position The position yields from the edge geometry and the place the connection is plaed...
Definition: NIVissimDistrictConnection.cpp:331
NIVissimEdge::getBestOutgoing
NIVissimEdge * getBestOutgoing() const
Definition: NIVissimEdge.cpp:1008
NIVissimClosedLanesVector.h
OptionsCont::getFloat
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
Definition: OptionsCont.cpp:208
NIVissimEdge::connection_position_sorter::operator()
int operator()(int c1id, int c2id) const
comparing operation
Definition: NIVissimEdge.cpp:66
NIVissimEdge::myZuschlag1
double myZuschlag1
Additional load values for this edge.
Definition: NIVissimEdge.h:263
NBNodeCont.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
NIVissimEdge::getOutgoingConnected
std::vector< NIVissimConnection * > getOutgoingConnected(int lane) const
Definition: NIVissimEdge.cpp:402
NIVissimEdge::connection_cluster_position_sorter::connection_cluster_position_sorter
connection_cluster_position_sorter(int edgeid)
constructor
Definition: NIVissimEdge.cpp:86
NIVissimDistrictConnection
Definition: NIVissimDistrictConnection.h:38
NIVissimConnection.h
NBEdge::setLaneWidth
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3239
NIVissimEdge::dict_propagateSpeeds
static void dict_propagateSpeeds()
Definition: NIVissimEdge.cpp:250
NIVissimConnection::getToLanes
const std::vector< int > & getToLanes() const
Definition: NIVissimConnection.cpp:285
NIVissimDistrictConnection.h
NIVissimEdge::myNoLanes
int myNoLanes
The number of lanes the edge has.
Definition: NIVissimEdge.h:259
NBEdge::UNSPECIFIED_WIDTH
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:315
NIVissimConnection::getFromLanes
const std::vector< int > & getFromLanes() const
Definition: NIVissimConnection.cpp:279
NIVissimEdge::dict_checkEdges2Join
static void dict_checkEdges2Join()
Definition: NIVissimEdge.cpp:867
NIVissimEdge::DictType
std::map< int, NIVissimEdge * > DictType
Definition of the dictionary type.
Definition: NIVissimEdge.h:290
NIVissimEdge::myMaxID
static int myMaxID
The current maximum id; needed for further id assignment.
Definition: NIVissimEdge.h:296
NIVissimEdge::getLength
double getLength() const
Returns the length of the node.
Definition: NIVissimEdge.cpp:839
NIVissimEdge::setDistrictSpeed
void setDistrictSpeed()
Definition: NIVissimEdge.cpp:371
NIVissimEdge::myPatchedSpeeds
std::vector< int > myPatchedSpeeds
Definition: NIVissimEdge.h:279
NIVissimEdge::remapOneOfNodes
std::pair< NBNode *, NBNode * > remapOneOfNodes(NBNodeCont &nc, NIVissimDistrictConnection *d, NBNode *fromNode, NBNode *toNode)
Definition: NIVissimEdge.cpp:660
config.h
NIVissimConnection::dictionary
static bool dictionary(int id, NIVissimConnection *o)
Definition: NIVissimConnection.cpp:77
GeomHelper.h
NIVissimEdge::myConnectionClusters
ConnectionClusters myConnectionClusters
List of connection clusters along this edge.
Definition: NIVissimEdge.h:269
NIVissimEdge::~NIVissimEdge
~NIVissimEdge()
Destructor.
Definition: NIVissimEdge.cpp:129
NIVissimConnection::getFromEdgeID
int getFromEdgeID() const
Definition: NIVissimConnection.cpp:156
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
NIVissimEdge::myIncomingConnections
std::vector< int > myIncomingConnections
List of connections incoming to this edge.
Definition: NIVissimEdge.h:272
NIVissimDistrictConnection::getMeanSpeed
double getMeanSpeed() const
Definition: NIVissimDistrictConnection.cpp:358
NIVissimEdge::addToConnectionCluster
void addToConnectionCluster(NIVissimConnectionCluster *c)
Definition: NIVissimEdge.cpp:817
NIVissimEdge::getToNode
std::pair< NIVissimConnectionCluster *, NBNode * > getToNode(NBNodeCont &nc, ConnectionClusters &clusters)
Returns the destination node.
Definition: NIVissimEdge.cpp:613
NBNode.h
NIVissimAbstractEdge::myGeom
PositionVector myGeom
Definition: NIVissimAbstractEdge.h:66
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
PositionVector.h
DistributionCont.h
NIVissimEdge::myLaneSpeeds
std::vector< double > myLaneSpeeds
Definition: NIVissimEdge.h:281
NIVissimEdge::getEnd2D
Position getEnd2D() const
Returns the end position of the edge.
Definition: NIVissimEdge.cpp:833
NODETYPE_NOJUNCTION
@ NODETYPE_NOJUNCTION
Definition: SUMOXMLDefinitions.h:1067
NIVissimConnectionCluster
Definition: NIVissimConnectionCluster.h:52
NIVissimEdge::getConnectionTo
NIVissimConnection * getConnectionTo(NIVissimEdge *e)
Definition: NIVissimEdge.cpp:949
NBEdge::getID
const std::string & getID() const
Definition: NBEdge.h:1380