SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RODFNet.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // A DFROUTER-network
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <cassert>
33 #include <iostream>
34 #include <map>
35 #include <vector>
36 #include <iterator>
37 #include "RODFNet.h"
38 #include "RODFDetector.h"
39 #include "RODFRouteDesc.h"
40 #include "RODFDetectorFlow.h"
41 #include "RODFEdge.h"
42 #include <cmath>
44 #include <utils/common/ToString.h>
46 #include <utils/geom/GeomHelper.h>
47 
48 #ifdef CHECK_MEMORY_LEAKS
49 #include <foreign/nvwa/debug_new.h>
50 #endif // CHECK_MEMORY_LEAKS
51 
52 
53 // ===========================================================================
54 // method definitions
55 // ===========================================================================
56 RODFNet::RODFNet(bool amInHighwayMode)
57  : RONet(), myAmInHighwayMode(amInHighwayMode),
58  mySourceNumber(0), mySinkNumber(0), myInBetweenNumber(0), myInvalidNumber(0) {
60  myKeepTurnarounds = OptionsCont::getOptions().getBool("keep-turnarounds");
61 }
62 
63 
65 }
66 
67 
68 void
70  const std::map<std::string, ROEdge*>& edges = getEdgeMap();
71  for (std::map<std::string, ROEdge*>::const_iterator rit = edges.begin(); rit != edges.end(); ++rit) {
72  ROEdge* ce = (*rit).second;
73  const ROEdgeVector& successors = ce->getSuccessors();
74  for (ROEdgeVector::const_iterator it = successors.begin(); it != successors.end(); ++it) {
75  ROEdge* help = *it;
76  if (find(myDisallowedEdges.begin(), myDisallowedEdges.end(), help->getID()) != myDisallowedEdges.end()) {
77  // edges in sinks will not be used
78  continue;
79  }
80  if (!myKeepTurnarounds && help->getToNode() == ce->getFromNode()) {
81  // do not use turnarounds
82  continue;
83  }
84  // add the connection help->ce to myApproachingEdges
85  if (myApproachingEdges.find(help) == myApproachingEdges.end()) {
87  }
88  myApproachingEdges[help].push_back(ce);
89  // add the connection ce->help to myApproachingEdges
90  if (myApproachedEdges.find(ce) == myApproachedEdges.end()) {
92  }
93  myApproachedEdges[ce].push_back(help);
94  }
95  }
96 }
97 
98 
99 void
101  myDetectorsOnEdges.clear();
102  myDetectorEdges.clear();
103  const std::vector<RODFDetector*>& dets = detcont.getDetectors();
104  for (std::vector<RODFDetector*>::const_iterator i = dets.begin(); i != dets.end(); ++i) {
105  ROEdge* e = getDetectorEdge(**i);
106  myDetectorsOnEdges[e].push_back((*i)->getID());
107  myDetectorEdges[(*i)->getID()] = e;
108  }
109 }
110 
111 
112 void
114  bool sourcesStrict) const {
115  PROGRESS_BEGIN_MESSAGE("Computing detector types");
116  const std::vector< RODFDetector*>& dets = detcont.getDetectors();
117  // build needed information. first
119  // compute detector types then
120  for (std::vector< RODFDetector*>::const_iterator i = dets.begin(); i != dets.end(); ++i) {
121  if (isSource(**i, detcont, sourcesStrict)) {
122  (*i)->setType(SOURCE_DETECTOR);
123  mySourceNumber++;
124  }
125  if (isDestination(**i, detcont)) {
126  (*i)->setType(SINK_DETECTOR);
127  mySinkNumber++;
128  }
129  if ((*i)->getType() == TYPE_NOT_DEFINED) {
130  (*i)->setType(BETWEEN_DETECTOR);
132  }
133  }
134  // recheck sources
135  for (std::vector< RODFDetector*>::const_iterator i = dets.begin(); i != dets.end(); ++i) {
136  if ((*i)->getType() == SOURCE_DETECTOR && isFalseSource(**i, detcont)) {
137  (*i)->setType(DISCARDED_DETECTOR);
138  myInvalidNumber++;
139  mySourceNumber--;
140  }
141  }
142  // print results
144  WRITE_MESSAGE("Computed detector types:");
145  WRITE_MESSAGE(" " + toString(mySourceNumber) + " source detectors");
146  WRITE_MESSAGE(" " + toString(mySinkNumber) + " sink detectors");
147  WRITE_MESSAGE(" " + toString(myInBetweenNumber) + " in-between detectors");
148  WRITE_MESSAGE(" " + toString(myInvalidNumber) + " invalid detectors");
149 }
150 
151 
152 bool
154  const RODFDetectorCon& detectors) const {
155  assert(myDetectorsOnEdges.find(edge) != myDetectorsOnEdges.end());
156  const std::vector<std::string>& detIDs = myDetectorsOnEdges.find(edge)->second;
157  std::vector<std::string>::const_iterator i;
158  for (i = detIDs.begin(); i != detIDs.end(); ++i) {
159  const RODFDetector& det = detectors.getDetector(*i);
160  if (det.getType() != BETWEEN_DETECTOR) {
161  return false;
162  }
163  }
164  return true;
165 }
166 
167 
168 bool
170  const RODFDetectorCon& detectors) const {
171  assert(myDetectorsOnEdges.find(edge) != myDetectorsOnEdges.end());
172  const std::vector<std::string>& detIDs = myDetectorsOnEdges.find(edge)->second;
173  std::vector<std::string>::const_iterator i;
174  for (i = detIDs.begin(); i != detIDs.end(); ++i) {
175  const RODFDetector& det = detectors.getDetector(*i);
176  if (det.getType() == SOURCE_DETECTOR) {
177  return true;
178  }
179  }
180  return false;
181 }
182 
183 
184 
185 void
187  bool keepUnfoundEnds,
188  bool keepShortestOnly,
189  ROEdgeVector& /*visited*/,
190  const RODFDetector& det, RODFRouteCont& into,
191  const RODFDetectorCon& detectors,
192  int maxFollowingLength,
193  ROEdgeVector& seen) const {
194  std::vector<RODFRouteDesc> unfoundEnds;
195  std::priority_queue<RODFRouteDesc, std::vector<RODFRouteDesc>, DFRouteDescByTimeComperator> toSolve;
196  std::map<ROEdge*, ROEdgeVector > dets2Follow;
197  dets2Follow[edge] = ROEdgeVector();
198  base.passedNo = 0;
199  SUMOReal minDist = OptionsCont::getOptions().getFloat("min-route-length");
200  toSolve.push(base);
201  while (!toSolve.empty()) {
202  RODFRouteDesc current = toSolve.top();
203  toSolve.pop();
204  ROEdge* last = *(current.edges2Pass.end() - 1);
205  if (hasDetector(last)) {
206  if (dets2Follow.find(last) == dets2Follow.end()) {
207  dets2Follow[last] = ROEdgeVector();
208  }
209  for (ROEdgeVector::reverse_iterator i = current.edges2Pass.rbegin() + 1; i != current.edges2Pass.rend(); ++i) {
210  if (hasDetector(*i)) {
211  dets2Follow[*i].push_back(last);
212  break;
213  }
214  }
215  }
216 
217  // do not process an edge twice
218  if (find(seen.begin(), seen.end(), last) != seen.end() && keepShortestOnly) {
219  continue;
220  }
221  seen.push_back(last);
222  // end if the edge has no further connections
223  if (!hasApproached(last)) {
224  // ok, no further connections to follow
225  current.factor = 1.;
226  SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
227  if (minDist < cdist) {
228  into.addRouteDesc(current);
229  }
230  continue;
231  }
232  // check for passing detectors:
233  // if the current last edge is not the one the detector is placed on ...
234  bool addNextNoFurther = false;
235  if (last != getDetectorEdge(det)) {
236  // ... if there is a detector ...
237  if (hasDetector(last)) {
238  if (!hasInBetweenDetectorsOnly(last, detectors)) {
239  // ... and it's not an in-between-detector
240  // -> let's add this edge and the following, but not any further
241  addNextNoFurther = true;
242  current.lastDetectorEdge = last;
243  current.duration2Last = (SUMOTime) current.duration_2;
244  current.distance2Last = current.distance;
245  current.endDetectorEdge = last;
246  if (hasSourceDetector(last, detectors)) {
248  }
249  current.factor = 1.;
250  SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
251  if (minDist < cdist) {
252  into.addRouteDesc(current);
253  }
254  continue;
255  } else {
256  // ... if it's an in-between-detector
257  // -> mark the current route as to be continued
258  current.passedNo = 0;
259  current.duration2Last = (SUMOTime) current.duration_2;
260  current.distance2Last = current.distance;
261  current.lastDetectorEdge = last;
262  }
263  }
264  }
265  // check for highway off-ramps
266  if (myAmInHighwayMode) {
267  // if it's beside the highway...
268  if (last->getSpeed() < 19.4 && last != getDetectorEdge(det)) {
269  // ... and has more than one following edge
270  if (myApproachedEdges.find(last)->second.size() > 1) {
271  // -> let's add this edge and the following, but not any further
272  addNextNoFurther = true;
273  }
274 
275  }
276  }
277  // check for missing end connections
278  if (!addNextNoFurther) {
279  // ... if this one would be processed, but already too many edge
280  // without a detector occured
281  if (current.passedNo > maxFollowingLength) {
282  // mark not to process any further
283  WRITE_WARNING("Could not close route for '" + det.getID() + "'");
284  unfoundEnds.push_back(current);
285  current.factor = 1.;
286  SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
287  if (minDist < cdist) {
288  into.addRouteDesc(current);
289  }
290  continue;
291  }
292  }
293  // ... else: loop over the next edges
294  const ROEdgeVector& appr = myApproachedEdges.find(last)->second;
295  bool hadOne = false;
296  for (size_t i = 0; i < appr.size(); i++) {
297  if (find(current.edges2Pass.begin(), current.edges2Pass.end(), appr[i]) != current.edges2Pass.end()) {
298  // do not append an edge twice (do not build loops)
299  continue;
300  }
301  RODFRouteDesc t(current);
302  t.duration_2 += (appr[i]->getLength() / appr[i]->getSpeed());
303  t.distance += appr[i]->getLength();
304  t.edges2Pass.push_back(appr[i]);
305  if (!addNextNoFurther) {
306  t.passedNo = t.passedNo + 1;
307  toSolve.push(t);
308  } else {
309  if (!hadOne) {
310  t.factor = (SUMOReal) 1. / (SUMOReal) appr.size();
311  SUMOReal cdist = current.edges2Pass[0]->getFromNode()->getPosition().distanceTo(current.edges2Pass.back()->getToNode()->getPosition());
312  if (minDist < cdist) {
313  into.addRouteDesc(t);
314  }
315  hadOne = true;
316  }
317  }
318  }
319  }
320  //
321  if (!keepUnfoundEnds) {
322  std::vector<RODFRouteDesc>::iterator i;
323  ConstROEdgeVector lastDetEdges;
324  for (i = unfoundEnds.begin(); i != unfoundEnds.end(); ++i) {
325  if (find(lastDetEdges.begin(), lastDetEdges.end(), (*i).lastDetectorEdge) == lastDetEdges.end()) {
326  lastDetEdges.push_back((*i).lastDetectorEdge);
327  } else {
328  bool ok = into.removeRouteDesc(*i);
329  assert(ok);
330  UNUSED_PARAMETER(ok); // ony used for assertion
331  }
332  }
333  } else {
334  // !!! patch the factors
335  }
336  while (!toSolve.empty()) {
337 // RODFRouteDesc d = toSolve.top();
338  toSolve.pop();
339 // delete d;
340  }
341 }
342 
343 
344 void
345 RODFNet::buildRoutes(RODFDetectorCon& detcont, bool keepUnfoundEnds, bool includeInBetween,
346  bool keepShortestOnly, int maxFollowingLength) const {
347  // build needed information first
349  // then build the routes
350  std::map<ROEdge*, RODFRouteCont* > doneEdges;
351  const std::vector< RODFDetector*>& dets = detcont.getDetectors();
352  for (std::vector< RODFDetector*>::const_iterator i = dets.begin(); i != dets.end(); ++i) {
353  ROEdge* e = getDetectorEdge(**i);
354  if (doneEdges.find(e) != doneEdges.end()) {
355  // use previously build routes
356  (*i)->addRoutes(new RODFRouteCont(*doneEdges[e]));
357  continue;
358  }
359  ROEdgeVector seen;
360  RODFRouteCont* routes = new RODFRouteCont();
361  doneEdges[e] = routes;
362  RODFRouteDesc rd;
363  rd.edges2Pass.push_back(e);
364  rd.duration_2 = (e->getLength() / e->getSpeed());
365  rd.endDetectorEdge = 0;
366  rd.lastDetectorEdge = 0;
367  rd.distance = e->getLength();
368  rd.distance2Last = 0;
369  rd.duration2Last = 0;
370 
371  rd.overallProb = 0;
372 
373  ROEdgeVector visited;
374  visited.push_back(e);
375  computeRoutesFor(e, rd, 0, keepUnfoundEnds, keepShortestOnly,
376  visited, **i, *routes, detcont, maxFollowingLength, seen);
378  (*i)->addRoutes(routes);
379 
380  // add routes to in-between detectors if wished
381  if (includeInBetween) {
382  // go through the routes
383  const std::vector<RODFRouteDesc>& r = routes->get();
384  for (std::vector<RODFRouteDesc>::const_iterator j = r.begin(); j != r.end(); ++j) {
385  const RODFRouteDesc& mrd = *j;
386  SUMOReal duration = mrd.duration_2;
387  SUMOReal distance = mrd.distance;
388  // go through each route's edges
389  ROEdgeVector::const_iterator routeend = mrd.edges2Pass.end();
390  for (ROEdgeVector::const_iterator k = mrd.edges2Pass.begin(); k != routeend; ++k) {
391  // check whether any detectors lies on the current edge
392  if (myDetectorsOnEdges.find(*k) == myDetectorsOnEdges.end()) {
393  duration -= (*k)->getLength() / (*k)->getSpeed();
394  distance -= (*k)->getLength();
395  continue;
396  }
397  // get the detectors
398  const std::vector<std::string>& dets = myDetectorsOnEdges.find(*k)->second;
399  // go through the detectors
400  for (std::vector<std::string>::const_iterator l = dets.begin(); l != dets.end(); ++l) {
401  const RODFDetector& m = detcont.getDetector(*l);
402  if (m.getType() == BETWEEN_DETECTOR) {
403  RODFRouteDesc nrd;
404  copy(k, routeend, back_inserter(nrd.edges2Pass));
405  nrd.duration_2 = duration;
408  nrd.distance = distance;
409  nrd.distance2Last = mrd.distance2Last;
410  nrd.duration2Last = mrd.duration2Last;
411  nrd.overallProb = mrd.overallProb;
412  nrd.factor = mrd.factor;
413  ((RODFDetector&) m).addRoute(nrd);
414  }
415  }
416  duration -= (*k)->getLength() / (*k)->getSpeed();
417  distance -= (*k)->getLength();
418  }
419  }
420  }
421 
422  }
423 }
424 
425 
426 void
428  RODFDetectorFlows& flows,
429  SUMOTime startTime, SUMOTime endTime,
430  SUMOTime stepOffset) {
431  {
432  if (flows.knows(detector->getID())) {
433  const std::vector<FlowDef>& detFlows = flows.getFlowDefs(detector->getID());
434  for (std::vector<FlowDef>::const_iterator j = detFlows.begin(); j != detFlows.end(); ++j) {
435  if ((*j).qPKW > 0 || (*j).qLKW > 0) {
436  return;
437  }
438  }
439  }
440  }
441  // ok, there is no information for the whole time;
442  // lets find preceding detectors and rebuild the flows if possible
443  WRITE_WARNING("Detector '" + detector->getID() + "' has no flows.\n Trying to rebuild.");
444  // go back and collect flows
445  ROEdgeVector previous;
446  {
447  std::vector<IterationEdge> missing;
448  IterationEdge ie;
449  ie.depth = 0;
450  ie.edge = getDetectorEdge(*detector);
451  missing.push_back(ie);
452  bool maxDepthReached = false;
453  while (!missing.empty() && !maxDepthReached) {
454  IterationEdge last = missing.back();
455  missing.pop_back();
456  ROEdgeVector approaching = myApproachingEdges[last.edge];
457  for (ROEdgeVector::const_iterator j = approaching.begin(); j != approaching.end(); ++j) {
458  if (hasDetector(*j)) {
459  previous.push_back(*j);
460  } else {
461  ie.depth = last.depth + 1;
462  ie.edge = *j;
463  missing.push_back(ie);
464  if (ie.depth > 5) {
465  maxDepthReached = true;
466  }
467  }
468  }
469  }
470  if (maxDepthReached) {
471  WRITE_WARNING(" Could not build list of previous flows.");
472  }
473  }
474  // Edges with previous detectors are now in "previous";
475  // compute following
476  ROEdgeVector latter;
477  {
478  std::vector<IterationEdge> missing;
479  for (ROEdgeVector::const_iterator k = previous.begin(); k != previous.end(); ++k) {
480  IterationEdge ie;
481  ie.depth = 0;
482  ie.edge = *k;
483  missing.push_back(ie);
484  }
485  bool maxDepthReached = false;
486  while (!missing.empty() && !maxDepthReached) {
487  IterationEdge last = missing.back();
488  missing.pop_back();
489  ROEdgeVector approached = myApproachedEdges[last.edge];
490  for (ROEdgeVector::const_iterator j = approached.begin(); j != approached.end(); ++j) {
491  if (*j == getDetectorEdge(*detector)) {
492  continue;
493  }
494  if (hasDetector(*j)) {
495  latter.push_back(*j);
496  } else {
497  IterationEdge ie;
498  ie.depth = last.depth + 1;
499  ie.edge = *j;
500  missing.push_back(ie);
501  if (ie.depth > 5) {
502  maxDepthReached = true;
503  }
504  }
505  }
506  }
507  if (maxDepthReached) {
508  WRITE_WARNING(" Could not build list of latter flows.");
509  return;
510  }
511  }
512  // Edges with latter detectors are now in "latter";
513 
514  // lets not validate them by now - surely this should be done
515  // for each time step: collect incoming flows; collect outgoing;
516  std::vector<FlowDef> mflows;
517  int index = 0;
518  for (SUMOTime t = startTime; t < endTime; t += stepOffset, index++) {
519  FlowDef inFlow;
520  inFlow.qLKW = 0;
521  inFlow.qPKW = 0;
522  inFlow.vLKW = 0;
523  inFlow.vPKW = 0;
524  // collect incoming
525  {
526  // !! time difference is missing
527  for (ROEdgeVector::iterator i = previous.begin(); i != previous.end(); ++i) {
528  const std::vector<FlowDef>& flows = static_cast<const RODFEdge*>(*i)->getFlows();
529  if (flows.size() != 0) {
530  const FlowDef& srcFD = flows[index];
531  inFlow.qLKW += srcFD.qLKW;
532  inFlow.qPKW += srcFD.qPKW;
533  inFlow.vLKW += srcFD.vLKW;
534  inFlow.vPKW += srcFD.vPKW;
535  }
536  }
537  }
538  inFlow.vLKW /= (SUMOReal) previous.size();
539  inFlow.vPKW /= (SUMOReal) previous.size();
540  // collect outgoing
541  FlowDef outFlow;
542  outFlow.qLKW = 0;
543  outFlow.qPKW = 0;
544  outFlow.vLKW = 0;
545  outFlow.vPKW = 0;
546  {
547  // !! time difference is missing
548  for (ROEdgeVector::iterator i = latter.begin(); i != latter.end(); ++i) {
549  const std::vector<FlowDef>& flows = static_cast<const RODFEdge*>(*i)->getFlows();
550  if (flows.size() != 0) {
551  const FlowDef& srcFD = flows[index];
552  outFlow.qLKW += srcFD.qLKW;
553  outFlow.qPKW += srcFD.qPKW;
554  outFlow.vLKW += srcFD.vLKW;
555  outFlow.vPKW += srcFD.vPKW;
556  }
557  }
558  }
559  outFlow.vLKW /= (SUMOReal) latter.size();
560  outFlow.vPKW /= (SUMOReal) latter.size();
561  //
562  FlowDef mFlow;
563  mFlow.qLKW = inFlow.qLKW - outFlow.qLKW;
564  mFlow.qPKW = inFlow.qPKW - outFlow.qPKW;
565  mFlow.vLKW = (inFlow.vLKW + outFlow.vLKW) / (SUMOReal) 2.;
566  mFlow.vPKW = (inFlow.vPKW + outFlow.vPKW) / (SUMOReal) 2.;
567  mflows.push_back(mFlow);
568  }
569  static_cast<RODFEdge*>(getDetectorEdge(*detector))->setFlows(mflows);
570  flows.setFlows(detector->getID(), mflows);
571 }
572 
573 
574 void
576  RODFDetectorFlows& flows,
577  SUMOTime startTime, SUMOTime endTime,
578  SUMOTime stepOffset) {
579  const std::vector<RODFDetector*>& dets = detectors.getDetectors();
580  for (std::vector<RODFDetector*>::const_iterator i = dets.begin(); i != dets.end(); ++i) {
581  // check whether there is at least one entry with a flow larger than zero
582  revalidateFlows(*i, flows, startTime, endTime, stepOffset);
583  }
584 }
585 
586 
587 
588 void
590  RODFDetectorFlows& flows) {
591  const std::vector<RODFDetector*>& dets = detectors.getDetectors();
592  for (std::vector<RODFDetector*>::const_iterator i = dets.begin(); i != dets.end();) {
593  bool remove = true;
594  // check whether there is at least one entry with a flow larger than zero
595  if (flows.knows((*i)->getID())) {
596  remove = false;
597  }
598  if (remove) {
599  WRITE_MESSAGE("Removed detector '" + (*i)->getID() + "' because no flows for him exist.");
600  flows.removeFlow((*i)->getID());
601  detectors.removeDetector((*i)->getID());
602  i = dets.begin();
603  } else {
604  i++;
605  }
606  }
607 }
608 
609 
610 
611 void
613  RODFDetectorFlows& flows) {
614  const std::vector<RODFDetector*>& dets = detectors.getDetectors();
615  for (std::vector<RODFDetector*>::const_iterator i = dets.begin(); i != dets.end(); ++i) {
616  bool remove = true;
617  // check whether there is at least one entry with a flow larger than zero
618  if (flows.knows((*i)->getID())) {
619  remove = false;
620  }
621  if (remove) {
622  WRITE_MESSAGE("Detector '" + (*i)->getID() + "' has no flow.");
623  }
624  }
625 }
626 
627 
628 
629 ROEdge*
631  std::string edgeName = det.getLaneID();
632  edgeName = edgeName.substr(0, edgeName.rfind('_'));
633  ROEdge* ret = getEdge(edgeName);
634  if (ret == 0) {
635  throw ProcessError("Edge '" + edgeName + "' used by detector '" + det.getID() + "' is not known.");
636  }
637  return ret;
638 }
639 
640 
641 bool
643  return
644  myApproachingEdges.find(edge) != myApproachingEdges.end()
645  &&
646  myApproachingEdges.find(edge)->second.size() != 0;
647 }
648 
649 
650 bool
652  return
653  myApproachedEdges.find(edge) != myApproachedEdges.end()
654  &&
655  myApproachedEdges.find(edge)->second.size() != 0;
656 }
657 
658 
659 bool
661  return
662  myDetectorsOnEdges.find(edge) != myDetectorsOnEdges.end()
663  &&
664  myDetectorsOnEdges.find(edge)->second.size() != 0;
665 }
666 
667 
668 const std::vector<std::string>&
670  return myDetectorsOnEdges.find(edge)->second;
671 }
672 
673 
674 SUMOReal
675 RODFNet::getAbsPos(const RODFDetector& det) const {
676  if (det.getPos() >= 0) {
677  return det.getPos();
678  }
679  return getDetectorEdge(det)->getLength() + det.getPos();
680 }
681 
682 bool
683 RODFNet::isSource(const RODFDetector& det, const RODFDetectorCon& detectors,
684  bool strict) const {
685  ROEdgeVector seen;
686  return
687  isSource(det, getDetectorEdge(det), seen, detectors, strict);
688 }
689 
690 bool
691 RODFNet::isFalseSource(const RODFDetector& det, const RODFDetectorCon& detectors) const {
692  ROEdgeVector seen;
693  return
694  isFalseSource(det, getDetectorEdge(det), seen, detectors);
695 }
696 
697 bool
698 RODFNet::isDestination(const RODFDetector& det, const RODFDetectorCon& detectors) const {
699  ROEdgeVector seen;
700  return isDestination(det, getDetectorEdge(det), seen, detectors);
701 }
702 
703 
704 bool
706  ROEdgeVector& seen,
707  const RODFDetectorCon& detectors,
708  bool strict) const {
709  if (seen.size() == 1000) { // !!!
710  WRITE_WARNING("Quitting checking for being a source for detector '" + det.getID() + "' due to seen edge limit.");
711  return false;
712  }
713  if (edge == getDetectorEdge(det)) {
714  // maybe there is another detector at the same edge
715  // get the list of this/these detector(s)
716  const std::vector<std::string>& detsOnEdge = myDetectorsOnEdges.find(edge)->second;
717  for (std::vector<std::string>::const_iterator i = detsOnEdge.begin(); i != detsOnEdge.end(); ++i) {
718  if ((*i) == det.getID()) {
719  continue;
720  }
721  const RODFDetector& sec = detectors.getDetector(*i);
722  if (getAbsPos(sec) < getAbsPos(det)) {
723  // ok, there is another detector on the same edge and it is
724  // before this one -> no source
725  return false;
726  }
727  }
728  }
729  // it's a source if no edges are approaching the edge
730  if (!hasApproaching(edge)) {
731  if (edge != getDetectorEdge(det)) {
732  if (hasDetector(edge)) {
733  return false;
734  }
735  }
736  return true;
737  }
738  if (edge != getDetectorEdge(det)) {
739  // ok, we are at one of the edges in front
740  if (myAmInHighwayMode) {
741  if (edge->getSpeed() >= 19.4) {
742  if (hasDetector(edge)) {
743  // we are still on the highway and there is another detector
744  return false;
745  }
746  // the next is a hack for the A100 scenario...
747  // We have to look into further edges herein edges
748  const ROEdgeVector& appr = myApproachingEdges.find(edge)->second;
749  size_t noOk = 0;
750  size_t noFalse = 0;
751  size_t noSkipped = 0;
752  for (size_t i = 0; i < appr.size(); i++) {
753  if (!hasDetector(appr[i])) {
754  noOk++;
755  } else {
756  noFalse++;
757  }
758  }
759  if ((noFalse + noSkipped) == appr.size()) {
760  return false;
761  }
762  }
763  }
764  }
765 
766  if (myAmInHighwayMode) {
767  if (edge->getSpeed() < 19.4 && edge != getDetectorEdge(det)) {
768  // we have left the highway already
769  // -> the detector will be a highway source
770  if (!hasDetector(edge)) {
771  return true;
772  }
773  }
774  }
775  if (myDetectorsOnEdges.find(edge) != myDetectorsOnEdges.end()
776  &&
777  myDetectorEdges.find(det.getID())->second != edge) {
778  return false;
779  }
780 
781  // let's check the edges in front
782  const ROEdgeVector& appr = myApproachingEdges.find(edge)->second;
783  size_t noOk = 0;
784  size_t noFalse = 0;
785  size_t noSkipped = 0;
786  seen.push_back(edge);
787  for (size_t i = 0; i < appr.size(); i++) {
788  bool had = std::find(seen.begin(), seen.end(), appr[i]) != seen.end();
789  if (!had) {
790  if (isSource(det, appr[i], seen, detectors, strict)) {
791  noOk++;
792  } else {
793  noFalse++;
794  }
795  } else {
796  noSkipped++;
797  }
798  }
799  if (!strict) {
800  return (noFalse + noSkipped) != appr.size();
801  } else {
802  return (noOk + noSkipped) == appr.size();
803  }
804 }
805 
806 
807 bool
809  const RODFDetectorCon& detectors) const {
810  if (seen.size() == 1000) { // !!!
811  WRITE_WARNING("Quitting checking for being a destination for detector '" + det.getID() + "' due to seen edge limit.");
812  return false;
813  }
814  if (edge == getDetectorEdge(det)) {
815  // maybe there is another detector at the same edge
816  // get the list of this/these detector(s)
817  const std::vector<std::string>& detsOnEdge = myDetectorsOnEdges.find(edge)->second;
818  for (std::vector<std::string>::const_iterator i = detsOnEdge.begin(); i != detsOnEdge.end(); ++i) {
819  if ((*i) == det.getID()) {
820  continue;
821  }
822  const RODFDetector& sec = detectors.getDetector(*i);
823  if (getAbsPos(sec) > getAbsPos(det)) {
824  // ok, there is another detector on the same edge and it is
825  // after this one -> no destination
826  return false;
827  }
828  }
829  }
830  if (!hasApproached(edge)) {
831  if (edge != getDetectorEdge(det)) {
832  if (hasDetector(edge)) {
833  return false;
834  }
835  }
836  return true;
837  }
838  if (edge != getDetectorEdge(det)) {
839  // ok, we are at one of the edges coming behind
840  if (myAmInHighwayMode) {
841  if (edge->getSpeed() >= 19.4) {
842  if (hasDetector(edge)) {
843  // we are still on the highway and there is another detector
844  return false;
845  }
846  }
847  }
848  }
849 
850  if (myAmInHighwayMode) {
851  if (edge->getSpeed() < 19.4 && edge != getDetectorEdge(det)) {
852  if (hasDetector(edge)) {
853  return true;
854  }
855  if (myApproachedEdges.find(edge)->second.size() > 1) {
856  return true;
857  }
858 
859  }
860  }
861 
862  if (myDetectorsOnEdges.find(edge) != myDetectorsOnEdges.end()
863  &&
864  myDetectorEdges.find(det.getID())->second != edge) {
865  return false;
866  }
867  const ROEdgeVector& appr = myApproachedEdges.find(edge)->second;
868  bool isall = true;
869  size_t no = 0;
870  seen.push_back(edge);
871  for (size_t i = 0; i < appr.size() && isall; i++) {
872  bool had = std::find(seen.begin(), seen.end(), appr[i]) != seen.end();
873  if (!had) {
874  if (!isDestination(det, appr[i], seen, detectors)) {
875  no++;
876  isall = false;
877  }
878  }
879  }
880  return isall;
881 }
882 
883 bool
885  const RODFDetectorCon& detectors) const {
886  if (seen.size() == 1000) { // !!!
887  WRITE_WARNING("Quitting checking for being a false source for detector '" + det.getID() + "' due to seen edge limit.");
888  return false;
889  }
890  seen.push_back(edge);
891  if (edge != getDetectorEdge(det)) {
892  // ok, we are at one of the edges coming behind
893  if (hasDetector(edge)) {
894  const std::vector<std::string>& dets = myDetectorsOnEdges.find(edge)->second;
895  for (std::vector<std::string>::const_iterator i = dets.begin(); i != dets.end(); ++i) {
896  if (detectors.getDetector(*i).getType() == SINK_DETECTOR) {
897  return false;
898  }
899  if (detectors.getDetector(*i).getType() == BETWEEN_DETECTOR) {
900  return false;
901  }
902  if (detectors.getDetector(*i).getType() == SOURCE_DETECTOR) {
903  return true;
904  }
905  }
906  } else {
907  if (myAmInHighwayMode && edge->getSpeed() < 19.) {
908  return false;
909  }
910  }
911  }
912 
913  if (myApproachedEdges.find(edge) == myApproachedEdges.end()) {
914  return false;
915  }
916 
917  const ROEdgeVector& appr = myApproachedEdges.find(edge)->second;
918  bool isall = false;
919  for (size_t i = 0; i < appr.size() && !isall; i++) {
920  //printf("checking %s->\n", appr[i].c_str());
921  bool had = std::find(seen.begin(), seen.end(), appr[i]) != seen.end();
922  if (!had) {
923  if (isFalseSource(det, appr[i], seen, detectors)) {
924  isall = true;
925  }
926  }
927  }
928  return isall;
929 }
930 
931 
932 void
934  const RODFDetectorCon& detectors,
935  SUMOTime startTime, SUMOTime endTime,
936  SUMOTime stepOffset) {
937  std::map<ROEdge*, std::vector<std::string>, idComp>::iterator i;
938  for (i = myDetectorsOnEdges.begin(); i != myDetectorsOnEdges.end(); ++i) {
939  ROEdge* into = (*i).first;
940  const std::vector<std::string>& dets = (*i).second;
941  std::map<SUMOReal, std::vector<std::string> > cliques;
942  std::vector<std::string>* maxClique = 0;
943  for (std::vector<std::string>::const_iterator j = dets.begin(); j != dets.end(); ++j) {
944  if (!flows.knows(*j)) {
945  continue;
946  }
947  const RODFDetector& det = detectors.getDetector(*j);
948  bool found = false;
949  for (std::map<SUMOReal, std::vector<std::string> >::iterator k = cliques.begin(); !found && k != cliques.end(); ++k) {
950  if (fabs((*k).first - det.getPos()) < 1) {
951  (*k).second.push_back(*j);
952  if ((*k).second.size() > maxClique->size()) {
953  maxClique = &(*k).second;
954  }
955  found = true;
956  }
957  }
958  if (!found) {
959  cliques[det.getPos()].push_back(*j);
960  maxClique = &cliques[det.getPos()];
961  }
962  }
963  if (maxClique == 0) {
964  continue;
965  }
966  std::vector<FlowDef> mflows; // !!! reserve
967  for (SUMOTime t = startTime; t < endTime; t += stepOffset) {
968  FlowDef fd;
969  fd.qPKW = 0;
970  fd.qLKW = 0;
971  fd.vLKW = 0;
972  fd.vPKW = 0;
973  fd.fLKW = 0;
974  fd.isLKW = 0;
975  mflows.push_back(fd);
976  }
977  for (std::vector<std::string>::iterator l = maxClique->begin(); l != maxClique->end(); ++l) {
978  bool didWarn = false;
979  const std::vector<FlowDef>& dflows = flows.getFlowDefs(*l);
980  int index = 0;
981  for (SUMOTime t = startTime; t < endTime; t += stepOffset, index++) {
982  const FlowDef& srcFD = dflows[index];
983  FlowDef& fd = mflows[index];
984  fd.qPKW += srcFD.qPKW;
985  fd.qLKW += srcFD.qLKW;
986  fd.vLKW += (srcFD.vLKW / (SUMOReal) maxClique->size());
987  fd.vPKW += (srcFD.vPKW / (SUMOReal) maxClique->size());
988  fd.fLKW += (srcFD.fLKW / (SUMOReal) maxClique->size());
989  fd.isLKW += (srcFD.isLKW / (SUMOReal) maxClique->size());
990  if (!didWarn && srcFD.vPKW > 0 && srcFD.vPKW < 255 && srcFD.vPKW / 3.6 > into->getSpeed()) {
991  WRITE_MESSAGE("Detected PKW speed higher than allowed speed at '" + (*l) + "' on '" + into->getID() + "'.");
992  didWarn = true;
993  }
994  if (!didWarn && srcFD.vLKW > 0 && srcFD.vLKW < 255 && srcFD.vLKW / 3.6 > into->getSpeed()) {
995  WRITE_MESSAGE("Detected LKW speed higher than allowed speed at '" + (*l) + "' on '" + into->getID() + "'.");
996  didWarn = true;
997  }
998  }
999  }
1000  static_cast<RODFEdge*>(into)->setFlows(mflows);
1001  }
1002 }
1003 
1004 
1005 void
1007  // !!! this will not work when several detectors are lying on the same edge on different positions
1008 
1009 
1010  buildDetectorEdgeDependencies(detectors);
1011  // for each detector, compute the lists of predecessor and following detectors
1012  std::map<std::string, ROEdge*>::const_iterator i;
1013  for (i = myDetectorEdges.begin(); i != myDetectorEdges.end(); ++i) {
1014  const RODFDetector& det = detectors.getDetector((*i).first);
1015  if (!det.hasRoutes()) {
1016  continue;
1017  }
1018  // mark current detectors
1019  std::vector<RODFDetector*> last;
1020  {
1021  const std::vector<std::string>& detNames = myDetectorsOnEdges.find((*i).second)->second;
1022  for (std::vector<std::string>::const_iterator j = detNames.begin(); j != detNames.end(); ++j) {
1023  last.push_back(&detectors.getModifiableDetector(*j));
1024  }
1025  }
1026  // iterate over the current detector's routes
1027  const std::vector<RODFRouteDesc>& routes = det.getRouteVector();
1028  for (std::vector<RODFRouteDesc>::const_iterator j = routes.begin(); j != routes.end(); ++j) {
1029  const ROEdgeVector& edges2Pass = (*j).edges2Pass;
1030  for (ROEdgeVector::const_iterator k = edges2Pass.begin() + 1; k != edges2Pass.end(); ++k) {
1031  if (myDetectorsOnEdges.find(*k) != myDetectorsOnEdges.end()) {
1032  const std::vector<std::string>& detNames = myDetectorsOnEdges.find(*k)->second;
1033  // ok, consecutive detector found
1034  for (std::vector<RODFDetector*>::iterator l = last.begin(); l != last.end(); ++l) {
1035  // mark as follower of current
1036  for (std::vector<std::string>::const_iterator m = detNames.begin(); m != detNames.end(); ++m) {
1037  detectors.getModifiableDetector(*m).addPriorDetector(*l);
1038  (*l)->addFollowingDetector(&detectors.getDetector(*m));
1039  }
1040  }
1041  last.clear();
1042  for (std::vector<std::string>::const_iterator m = detNames.begin(); m != detNames.end(); ++m) {
1043  last.push_back(&detectors.getModifiableDetector(*m));
1044  }
1045  }
1046  }
1047  }
1048  }
1049 }
1050 
1051 
1052 void
1054  buildDetectorEdgeDependencies(detectors);
1055  std::map<ROEdge*, std::vector<std::string>, idComp>::iterator i;
1056  for (i = myDetectorsOnEdges.begin(); i != myDetectorsOnEdges.end(); ++i) {
1057  const std::vector<std::string>& dets = (*i).second;
1058  std::map<SUMOReal, std::vector<std::string> > cliques;
1059  // compute detector cliques
1060  for (std::vector<std::string>::const_iterator j = dets.begin(); j != dets.end(); ++j) {
1061  const RODFDetector& det = detectors.getDetector(*j);
1062  bool found = false;
1063  for (std::map<SUMOReal, std::vector<std::string> >::iterator k = cliques.begin(); !found && k != cliques.end(); ++k) {
1064  if (fabs((*k).first - det.getPos()) < 10.) {
1065  (*k).second.push_back(*j);
1066  found = true;
1067  }
1068  }
1069  if (!found) {
1070  cliques[det.getPos()] = std::vector<std::string>();
1071  cliques[det.getPos()].push_back(*j);
1072  }
1073  }
1074  // join detector cliques
1075  for (std::map<SUMOReal, std::vector<std::string> >::iterator m = cliques.begin(); m != cliques.end(); ++m) {
1076  std::vector<std::string> clique = (*m).second;
1077  // do not join if only one
1078  if (clique.size() == 1) {
1079  continue;
1080  }
1081  std::string nid;
1082  for (std::vector<std::string>::iterator n = clique.begin(); n != clique.end(); ++n) {
1083  std::cout << *n << " ";
1084  if (n != clique.begin()) {
1085  nid = nid + "_";
1086  }
1087  nid = nid + *n;
1088  }
1089  std::cout << ":" << nid << std::endl;
1090  flows.mesoJoin(nid, (*m).second);
1091  detectors.mesoJoin(nid, (*m).second);
1092  }
1093  }
1094 }
1095 
1096 
1097 
1098 /****************************************************************************/
1099 
void mesoJoin(RODFDetectorCon &detectors, RODFDetectorFlows &flows)
Definition: RODFNet.cpp:1053
void revalidateFlows(const RODFDetectorCon &detectors, RODFDetectorFlows &flows, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset)
Definition: RODFNet.cpp:575
RODFDetector & getModifiableDetector(const std::string &id) const
SUMOReal factor
Definition: RODFRouteDesc.h:68
std::vector< std::string > myDisallowedEdges
List of ids of edges that shall not be used.
Definition: RODFNet.h:173
~RODFNet()
Destructor.
Definition: RODFNet.cpp:64
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
RONode * getToNode() const
Returns the node this edge ends at.
Definition: ROEdge.h:222
bool hasInBetweenDetectorsOnly(ROEdge *edge, const RODFDetectorCon &detectors) const
Definition: RODFNet.cpp:153
size_t mySourceNumber
Definition: RODFNet.h:170
ROEdge * getDetectorEdge(const RODFDetector &det) const
Definition: RODFNet.cpp:630
bool isFalseSource(const RODFDetector &det, const RODFDetectorCon &detectors) const
Definition: RODFNet.cpp:691
void removeDetector(const std::string &id)
A source detector.
Definition: RODFDetector.h:76
bool isSource(const RODFDetector &det, const RODFDetectorCon &detectors, bool strict) const
Definition: RODFNet.cpp:683
bool myKeepTurnarounds
Definition: RODFNet.h:176
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
Definition: RONet.h:138
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
SUMOReal distance
Definition: RODFRouteDesc.h:60
const std::vector< FlowDef > & getFlows() const
Definition: RODFEdge.cpp:60
void removeFlow(const std::string &detector_id)
std::map< ROEdge *, ROEdgeVector > myApproachedEdges
Map of edge name->list of names of edges approached by this edge.
Definition: RODFNet.h:164
void reportEmptyDetectors(RODFDetectorCon &detectors, RODFDetectorFlows &flows)
Definition: RODFNet.cpp:612
const std::vector< RODFRouteDesc > & getRouteVector() const
ROEdgeVector edges2Pass
The edges the route is made of.
Definition: RODFRouteDesc.h:56
void computeTypes(RODFDetectorCon &dets, bool sourcesStrict) const
Definition: RODFNet.cpp:113
void addPriorDetector(const RODFDetector *det)
const std::vector< RODFDetector * > & getDetectors() const
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
SUMOReal distance2Last
Definition: RODFRouteDesc.h:64
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:59
SUMOReal isLKW
bool hasSourceDetector(ROEdge *edge, const RODFDetectorCon &detectors) const
Definition: RODFNet.cpp:169
std::vector< RODFRouteDesc > & get()
Returns the container of stored routes.
A container for flows.
A container for RODFDetectors.
Definition: RODFDetector.h:227
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
bool hasDetector(ROEdge *edge) const
Definition: RODFNet.cpp:660
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
SUMOReal getAbsPos(const RODFDetector &det) const
Definition: RODFNet.cpp:675
const std::map< std::string, ROEdge * > & getEdgeMap() const
Definition: RONet.cpp:541
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:67
RONode * getFromNode() const
Returns the node this edge starts at.
Definition: ROEdge.h:214
void buildRoutes(RODFDetectorCon &det, bool keepUnfoundEnds, bool includeInBetween, bool keepShortestOnly, int maxFollowingLength) const
Definition: RODFNet.cpp:345
RODFDetectorType getType() const
Returns the type of the detector.
Definition: RODFDetector.h:150
comparator for maps using edges as key, used only in myDetectorsOnEdges to make tests comparable ...
Definition: RODFNet.h:154
A not yet defined detector.
Definition: RODFDetector.h:67
bool isDestination(const RODFDetector &det, const RODFDetectorCon &detectors) const
Definition: RODFNet.cpp:698
const std::string & getID() const
Returns the id.
Definition: Named.h:60
size_t myInvalidNumber
Definition: RODFNet.h:170
SUMOReal fLKW
bool removeRouteDesc(RODFRouteDesc &desc)
Removes the given route description from the container.
An in-between detector.
Definition: RODFDetector.h:73
bool hasApproaching(ROEdge *edge) const
Definition: RODFNet.cpp:642
RODFNet(bool amInHighwayMode)
Constructor.
Definition: RODFNet.cpp:56
std::vector< ROEdge * > ROEdgeVector
Definition: RODFRouteDesc.h:43
A detector which had to be discarded (!!!)
Definition: RODFDetector.h:70
SUMOReal overallProb
Definition: RODFRouteDesc.h:67
#define PROGRESS_BEGIN_MESSAGE(msg)
Definition: MsgHandler.h:202
void setFlows(const std::string &detector_id, std::vector< FlowDef > &)
const std::vector< std::string > & getDetectorList(ROEdge *edge) const
Definition: RODFNet.cpp:669
void buildDetectorEdgeDependencies(RODFDetectorCon &dets) const
Definition: RODFNet.cpp:100
void buildApproachList()
Definition: RODFNet.cpp:69
bool knows(const std::string &det_id) const
void computeRoutesFor(ROEdge *edge, RODFRouteDesc &base, int no, bool keepUnfoundEnds, bool keepShortestOnly, ROEdgeVector &visited, const RODFDetector &det, RODFRouteCont &into, const RODFDetectorCon &detectors, int maxFollowingLength, ROEdgeVector &seen) const
Definition: RODFNet.cpp:186
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
Definition of the traffic during a certain time containing the flows and speeds.
A route within the DFROUTER.
Definition: RODFRouteDesc.h:54
A basic edge for routing applications.
Definition: ROEdge.h:73
std::map< ROEdge *, ROEdgeVector > myApproachingEdges
Map of edge name->list of names of this edge approaching edges.
Definition: RODFNet.h:161
SUMOReal vPKW
SUMOTime duration2Last
Definition: RODFRouteDesc.h:65
The router's network representation.
Definition: RONet.h:72
SUMOReal getLength() const
Returns the length of the edge.
Definition: ROEdge.h:183
void buildEdgeFlowMap(const RODFDetectorFlows &flows, const RODFDetectorCon &detectors, SUMOTime startTime, SUMOTime endTime, SUMOTime stepOffset)
Definition: RODFNet.cpp:933
const RODFDetector & getDetector(const std::string &id) const
void buildDetectorDependencies(RODFDetectorCon &detectors)
Definition: RODFNet.cpp:1006
Class representing a detector within the DFROUTER.
Definition: RODFDetector.h:88
size_t mySinkNumber
Definition: RODFNet.h:170
const ROEdge * endDetectorEdge
Definition: RODFRouteDesc.h:62
const ROEdgeVector & getSuccessors() const
Returns the following edges.
Definition: ROEdge.h:292
std::map< std::string, ROEdge * > myDetectorEdges
Definition: RODFNet.h:167
SUMOReal duration_2
Definition: RODFRouteDesc.h:59
bool hasApproached(ROEdge *edge) const
Definition: RODFNet.cpp:651
A container for DFROUTER-routes.
Definition: RODFRouteCont.h:63
int SUMOTime
Definition: SUMOTime.h:43
SUMOReal qPKW
SUMOReal getPos() const
Returns the position at which the detector lies.
Definition: RODFDetector.h:141
const std::vector< FlowDef > & getFlowDefs(const std::string &id) const
std::map< ROEdge *, std::vector< std::string >, idComp > myDetectorsOnEdges
Definition: RODFNet.h:166
#define SUMOReal
Definition: config.h:218
void mesoJoin(const std::string &nid, const std::vector< std::string > &oldids)
bool myAmInHighwayMode
Definition: RODFNet.h:169
void removeEmptyDetectors(RODFDetectorCon &detectors, RODFDetectorFlows &flows)
Definition: RODFNet.cpp:589
void mesoJoin(const std::string &nid, const std::vector< std::string > &oldids)
#define PROGRESS_DONE_MESSAGE()
Definition: MsgHandler.h:203
const ROEdge * lastDetectorEdge
Definition: RODFRouteDesc.h:63
void addRouteDesc(RODFRouteDesc &desc)
Adds a route to the container.
SUMOReal vLKW
SUMOReal qLKW
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:201
SUMOReal getSpeed() const
Returns the speed allowed on this edge.
Definition: ROEdge.h:198
size_t myInBetweenNumber
Definition: RODFNet.h:170
bool hasRoutes() const
const std::string & getLaneID() const
Returns the id of the lane this detector is placed on.
Definition: RODFDetector.h:125