SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSE2Collector.cpp
Go to the documentation of this file.
1 /****************************************************************************/
12 // An areal (along a single lane) detector
13 /****************************************************************************/
14 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
15 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
16 /****************************************************************************/
17 //
18 // This file is part of SUMO.
19 // SUMO is free software: you can redistribute it and/or modify
20 // it under the terms of the GNU General Public License as published by
21 // the Free Software Foundation, either version 3 of the License, or
22 // (at your option) any later version.
23 //
24 /****************************************************************************/
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <cassert>
37 #include <algorithm>
38 #include "MSE2Collector.h"
39 #include <microsim/MSLane.h>
40 #include <microsim/MSVehicle.h>
41 #include <microsim/MSVehicleType.h>
42 
43 #ifdef CHECK_MEMORY_LEAKS
44 #include <foreign/nvwa/debug_new.h>
45 #endif // CHECK_MEMORY_LEAKS
46 
47 
48 // ===========================================================================
49 // method definitions
50 // ===========================================================================
51 MSE2Collector::MSE2Collector(const std::string& id, DetectorUsage usage,
52  MSLane* const lane, SUMOReal startPos, SUMOReal detLength,
53  SUMOTime haltingTimeThreshold,
54  SUMOReal haltingSpeedThreshold,
55  SUMOReal jamDistThreshold) :
56  MSMoveReminder(id, lane),
58  myJamHaltingSpeedThreshold(haltingSpeedThreshold),
59  myJamHaltingTimeThreshold(haltingTimeThreshold),
60  myJamDistanceThreshold(jamDistThreshold),
61  myStartPos(startPos), myEndPos(startPos + detLength),
62  myUsage(usage),
63  myCurrentOccupancy(0), myCurrentMeanSpeed(-1), myCurrentJamNo(0),
64  myCurrentMaxJamLengthInMeters(0), myCurrentMaxJamLengthInVehicles(0),
65  myCurrentJamLengthInMeters(0), myCurrentJamLengthInVehicles(0), myCurrentStartedHalts(0),
66  myCurrentHaltingsNumber(0)
67 
68 {
69  assert(myLane != 0);
70  assert(myStartPos >= 0 && myStartPos < myLane->getLength());
71  assert(myEndPos - myStartPos > 0 && myEndPos <= myLane->getLength());
72  reset();
73 }
74 
75 
77  myKnownVehicles.clear();
78 }
79 
80 
81 bool
83  SUMOReal newPos, SUMOReal) {
84  if (newPos < myStartPos) {
85  // detector not yet reached
86  return true;
87  }
88  if (newPos >= myStartPos && oldPos < myStartPos) {
89  if (find(myKnownVehicles.begin(), myKnownVehicles.end(), &veh) == myKnownVehicles.end()) {
90  myKnownVehicles.push_back(&veh);
91  }
92  }
93  if (newPos - veh.getVehicleType().getLength() > myEndPos) {
94  std::list<SUMOVehicle*>::iterator i = find(myKnownVehicles.begin(), myKnownVehicles.end(), &veh);
95  if (i != myKnownVehicles.end()) {
96  myKnownVehicles.erase(i);
97  }
98  return false;
99  }
100  return true;
101 }
102 
103 
104 bool
106  if (reason != MSMoveReminder::NOTIFICATION_JUNCTION || (lastPos >= myStartPos && lastPos - veh.getVehicleType().getLength() < myEndPos)) {
107  std::list<SUMOVehicle*>::iterator i = find(myKnownVehicles.begin(), myKnownVehicles.end(), &veh);
108  if (i != myKnownVehicles.end()) {
109  myKnownVehicles.erase(i);
110  }
111  return false;
112  }
113  return true;
114 }
115 
116 
117 bool
120  // vehicle is on detector
121  myKnownVehicles.push_back(&veh);
122  return true;
123  }
124  if (veh.getPositionOnLane() - veh.getVehicleType().getLength() > myEndPos) {
125  // vehicle is beyond detector
126  return false;
127  }
128  // vehicle is in front of detector
129  return true;
130 }
131 
132 
133 void
135  mySpeedSum = 0;
136  myStartedHalts = 0;
139  myVehicleSamples = 0;
140  myOccupancySum = 0;
141  myMaxOccupancy = 0;
144  myMaxJamInVehicles = 0;
145  myMaxJamInMeters = 0;
146  myTimeSamples = 0;
148  myMaxVehicleNumber = 0;
149  for (std::map<SUMOVehicle*, SUMOTime>::iterator i = myIntervalHaltingVehicleDurations.begin(); i != myIntervalHaltingVehicleDurations.end(); ++i) {
150  (*i).second = 0;
151  }
152  myPastStandingDurations.clear();
154 }
155 
156 
157 
158 void
160  JamInfo* currentJam = 0;
161  std::map<SUMOVehicle*, SUMOTime> haltingVehicles;
162  std::map<SUMOVehicle*, SUMOTime> intervalHaltingVehicles;
163  std::vector<JamInfo*> jams;
164 
165  SUMOReal lengthSum = 0;
166  myCurrentMeanSpeed = 0;
170 
171  // go through the (sorted) list of vehicles positioned on the detector
172  // sum up values and prepare the list of jams
174  for (std::list<SUMOVehicle*>::const_iterator i = myKnownVehicles.begin(); i != myKnownVehicles.end(); ++i) {
175  MSVehicle* veh = static_cast<MSVehicle*>(*i);
176 
177  SUMOReal length = veh->getVehicleType().getLength();
178  if (veh->getLane() == getLane()) {
179  if (veh->getPositionOnLane() - veh->getVehicleType().getLength() < myStartPos) {
180  // vehicle entered detector partially
181  length -= (veh->getVehicleType().getLength() - (veh->getPositionOnLane() - myStartPos));
182  }
183  if (veh->getPositionOnLane() > myEndPos && veh->getPositionOnLane() - veh->getVehicleType().getLength() <= myEndPos) {
184  // vehicle left detector partially
185  length -= (veh->getPositionOnLane() - myEndPos);
186  }
187  } else {
188  // ok, the vehicle is only partially still on the detector, has already moved to the
189  // next lane; still, we do not know how far away it is
190  assert(veh == myLane->getPartialOccupator());
191  length = myEndPos - myLane->getPartialOccupatorEnd();
192  }
193  assert(length >= 0);
194 
195  mySpeedSum += veh->getSpeed();
196  myCurrentMeanSpeed += veh->getSpeed();
197  lengthSum += length;
198  myCurrentMeanLength += length;
199 
200  // jam-checking begins
201  bool isInJam = false;
202  // first, check whether the vehicle is slow enough to be states as halting
203  if (veh->getSpeed() < myJamHaltingSpeedThreshold) {
205  // we have to track the time it was halting;
206  // so let's look up whether it was halting before and compute the overall halting time
207  bool wasHalting = myHaltingVehicleDurations.find(veh) != myHaltingVehicleDurations.end();
208  if (wasHalting) {
209  haltingVehicles[veh] = myHaltingVehicleDurations[veh] + DELTA_T;
210  intervalHaltingVehicles[veh] = myIntervalHaltingVehicleDurations[veh] + DELTA_T;
211  } else {
212  haltingVehicles[veh] = DELTA_T;
213  intervalHaltingVehicles[veh] = DELTA_T;
215  myStartedHalts++;
216  }
217  // we now check whether the halting time is large enough
218  if (haltingVehicles[veh] > myJamHaltingTimeThreshold) {
219  // yep --> the vehicle is a part of a jam
220  isInJam = true;
221  }
222  } else {
223  // is not standing anymore; keep duration information
224  std::map<SUMOVehicle*, SUMOTime>::iterator v = myHaltingVehicleDurations.find(veh);
225  if (v != myHaltingVehicleDurations.end()) {
226  myPastStandingDurations.push_back((*v).second);
227  myHaltingVehicleDurations.erase(v);
228  }
229  v = myIntervalHaltingVehicleDurations.find(veh);
230  if (v != myIntervalHaltingVehicleDurations.end()) {
231  myPastIntervalStandingDurations.push_back((*v).second);
233  }
234  }
235 
236  // jam-building
237  if (isInJam) {
238  // the vehicle is in a jam;
239  // it may be a new one or already an existing one
240  if (currentJam == 0) {
241  // the vehicle is the first vehicle in a jam
242  currentJam = new JamInfo;
243  currentJam->firstStandingVehicle = i;
244  } else {
245  // ok, we have a jam already. But - maybe it is too far away
246  // ... honestly, I can hardly find a reason for doing this,
247  // but jams were defined this way in an earlier version...
248  if (veh->getPositionOnLane() - (*currentJam->lastStandingVehicle)->getPositionOnLane() > myJamDistanceThreshold) {
249  // yep, yep, yep - it's a new one...
250  // close the frist, build a new
251  jams.push_back(currentJam);
252  currentJam = new JamInfo;
253  currentJam->firstStandingVehicle = i;
254  }
255  }
256  currentJam->lastStandingVehicle = i;
257  } else {
258  // the vehicle is not part of a jam...
259  // maybe we have to close an already computed jam
260  if (currentJam != 0) {
261  jams.push_back(currentJam);
262  currentJam = 0;
263  }
264  }
265  }
266  if (currentJam != 0) {
267  jams.push_back(currentJam);
268  currentJam = 0;
269  }
270 
275  // process jam information
276  for (std::vector<JamInfo*>::iterator i = jams.begin(); i != jams.end(); ++i) {
277  // compute current jam's values
278  SUMOReal jamLengthInMeters =
279  (*(*i)->firstStandingVehicle)->getPositionOnLane()
280  - (*(*i)->lastStandingVehicle)->getPositionOnLane()
281  + (*(*i)->lastStandingVehicle)->getVehicleType().getLengthWithGap();
282  const MSVehicle* const occ = myLane->getPartialOccupator();
283  if (occ && occ == *(*i)->firstStandingVehicle && occ != *(*i)->lastStandingVehicle) {
284  jamLengthInMeters = myLane->getPartialOccupatorEnd() + occ->getVehicleType().getLengthWithGap()
285  - (*(*i)->lastStandingVehicle)->getPositionOnLane()
286  + (*(*i)->lastStandingVehicle)->getVehicleType().getLengthWithGap();
287  }
288  unsigned jamLengthInVehicles = (unsigned) distance((*i)->firstStandingVehicle, (*i)->lastStandingVehicle) + 1;
289  // apply them to the statistics
292  myJamLengthInMetersSum += jamLengthInMeters;
293  myJamLengthInVehiclesSum += jamLengthInVehicles;
294  myCurrentJamLengthInMeters += jamLengthInMeters;
295  myCurrentJamLengthInVehicles += jamLengthInVehicles;
296  }
297  myCurrentJamNo = (unsigned) jams.size();
298 
299  unsigned noVehicles = (unsigned) myKnownVehicles.size();
300  myVehicleSamples += noVehicles;
301  myTimeSamples += 1;
302  // compute occupancy values
303  SUMOReal currentOccupancy = lengthSum / (myEndPos - myStartPos) * (SUMOReal) 100.;
304  myCurrentOccupancy = currentOccupancy;
305  myOccupancySum += currentOccupancy;
306  myMaxOccupancy = MAX2(myMaxOccupancy, currentOccupancy);
307  // compute jam values
312  // save information about halting vehicles
313  myHaltingVehicleDurations = haltingVehicles;
314  myIntervalHaltingVehicleDurations = intervalHaltingVehicles;
315  // compute information about vehicle numbers
316  myMeanVehicleNumber += (unsigned) myKnownVehicles.size();
318  // norm current values
319  myCurrentMeanSpeed = noVehicles != 0 ? myCurrentMeanSpeed / (SUMOReal) noVehicles : -1;
320  myCurrentMeanLength = noVehicles != 0 ? myCurrentMeanLength / (SUMOReal) noVehicles : -1;
321 
322  // clean up
323  for (std::vector<JamInfo*>::iterator i = jams.begin(); i != jams.end(); ++i) {
324  delete *i;
325  }
326  jams.clear();
327 }
328 
329 
330 
331 void
333  dev << " <interval begin=\"" << time2string(startTime) << "\" end=\"" << time2string(stopTime) << "\" " << "id=\"" << getID() << "\" ";
334 
335  const SUMOReal meanSpeed = myVehicleSamples != 0 ? mySpeedSum / (SUMOReal) myVehicleSamples : -1;
336  const SUMOReal meanOccupancy = myTimeSamples != 0 ? myOccupancySum / (SUMOReal) myTimeSamples : 0;
337  const SUMOReal meanJamLengthInMeters = myTimeSamples != 0 ? myMeanMaxJamInMeters / (SUMOReal) myTimeSamples : 0;
338  const SUMOReal meanJamLengthInVehicles = myTimeSamples != 0 ? myMeanMaxJamInVehicles / (SUMOReal) myTimeSamples : 0;
339  const SUMOReal meanVehicleNumber = myTimeSamples != 0 ? (SUMOReal) myMeanVehicleNumber / (SUMOReal) myTimeSamples : 0;
340 
341  SUMOTime haltingDurationSum = 0;
342  SUMOTime maxHaltingDuration = 0;
343  unsigned haltingNo = 0;
344  for (std::vector<SUMOTime>::iterator i = myPastStandingDurations.begin(); i != myPastStandingDurations.end(); ++i) {
345  haltingDurationSum += (*i);
346  maxHaltingDuration = MAX2(maxHaltingDuration, (*i));
347  haltingNo++;
348  }
349  for (std::map<SUMOVehicle*, SUMOTime> ::iterator i = myHaltingVehicleDurations.begin(); i != myHaltingVehicleDurations.end(); ++i) {
350  haltingDurationSum += (*i).second;
351  maxHaltingDuration = MAX2(maxHaltingDuration, (*i).second);
352  haltingNo++;
353  }
354  const SUMOTime meanHaltingDuration = haltingNo != 0 ? haltingDurationSum / haltingNo : 0;
355 
356  SUMOTime intervalHaltingDurationSum = 0;
357  SUMOTime intervalMaxHaltingDuration = 0;
358  unsigned intervalHaltingNo = 0;
359  for (std::vector<SUMOTime>::iterator i = myPastIntervalStandingDurations.begin(); i != myPastIntervalStandingDurations.end(); ++i) {
360  intervalHaltingDurationSum += (*i);
361  intervalMaxHaltingDuration = MAX2(intervalMaxHaltingDuration, (*i));
362  intervalHaltingNo++;
363  }
364  for (std::map<SUMOVehicle*, SUMOTime> ::iterator i = myIntervalHaltingVehicleDurations.begin(); i != myIntervalHaltingVehicleDurations.end(); ++i) {
365  intervalHaltingDurationSum += (*i).second;
366  intervalMaxHaltingDuration = MAX2(intervalMaxHaltingDuration, (*i).second);
367  intervalHaltingNo++;
368  }
369  const SUMOTime intervalMeanHaltingDuration = intervalHaltingNo != 0 ? intervalHaltingDurationSum / intervalHaltingNo : 0;
370 
371  dev << "nSamples=\"" << myVehicleSamples << "\" "
372  << "meanSpeed=\"" << meanSpeed << "\" "
373  << "meanOccupancy=\"" << meanOccupancy << "\" "
374  << "maxOccupancy=\"" << myMaxOccupancy << "\" "
375  << "meanMaxJamLengthInVehicles=\"" << meanJamLengthInVehicles << "\" "
376  << "meanMaxJamLengthInMeters=\"" << meanJamLengthInMeters << "\" "
377  << "maxJamLengthInVehicles=\"" << myMaxJamInVehicles << "\" "
378  << "maxJamLengthInMeters=\"" << myMaxJamInMeters << "\" "
379  << "jamLengthInVehiclesSum=\"" << myJamLengthInVehiclesSum << "\" "
380  << "jamLengthInMetersSum=\"" << myJamLengthInMetersSum << "\" "
381  << "meanHaltingDuration=\"" << STEPS2TIME(meanHaltingDuration) << "\" "
382  << "maxHaltingDuration=\"" << STEPS2TIME(maxHaltingDuration) << "\" "
383  << "haltingDurationSum=\"" << STEPS2TIME(haltingDurationSum) << "\" "
384  << "meanIntervalHaltingDuration=\"" << STEPS2TIME(intervalMeanHaltingDuration) << "\" "
385  << "maxIntervalHaltingDuration=\"" << STEPS2TIME(intervalMaxHaltingDuration) << "\" "
386  << "intervalHaltingDurationSum=\"" << STEPS2TIME(intervalHaltingDurationSum) << "\" "
387  << "startedHalts=\"" << myStartedHalts << "\" "
388  << "meanVehicleNumber=\"" << meanVehicleNumber << "\" "
389  << "maxVehicleNumber=\"" << myMaxVehicleNumber << "\" "
390  << "/>\n";
391  reset();
392 }
393 
394 
395 void
397  dev.writeXMLHeader("detector", "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"http://sumo-sim.org/xsd/det_e2_file.xsd\"");
398 }
399 
400 
401 unsigned
403  return (unsigned) myKnownVehicles.size();
404 }
405 
406 
407 SUMOReal
409  return myCurrentOccupancy * (SUMOReal) 100.;
410 }
411 
412 
413 SUMOReal
415  return myCurrentMeanSpeed;
416 }
417 
418 
419 SUMOReal
421  return myCurrentMeanLength;
422 }
423 
424 
425 unsigned
427  return myCurrentJamNo;
428 }
429 
430 
431 unsigned
434 }
435 
436 
437 SUMOReal
440 }
441 
442 
443 unsigned
446 }
447 
448 
449 SUMOReal
452 }
453 
454 
455 unsigned
457  return myCurrentStartedHalts;
458 }
459 
460 
461 int
463  const MSVehicle* const occ = myLane->getPartialOccupator();
464  if (v1 == occ) {
465  return true;
466  }
467  if (v2 == occ) {
468  return false;
469  }
470  return v1->getPositionOnLane() > v2->getPositionOnLane();
471 }
472 
473 SUMOReal
476 }
477 
478 
479 std::vector<std::string>
481  std::vector<std::string> ret;
482  for (std::list<SUMOVehicle*>::const_iterator i = myKnownVehicles.begin(); i != myKnownVehicles.end(); ++i) {
483  MSVehicle* veh = static_cast<MSVehicle*>(*i);
484  ret.push_back(veh->getID());
485  }
486  std::sort(ret.begin(), ret.end());
487  return ret;
488 }
489 
490 /****************************************************************************/
491 
std::map< SUMOVehicle *, SUMOTime > myHaltingVehicleDurations
Storage for halting durations of known vehicles (for halting vehicles)
std::vector< SUMOTime > myPastIntervalStandingDurations
Halting durations of ended halts for the current interval [s].
std::vector< std::string > getCurrentVehicleIDs() const
Returns the IDs of the vehicles within the area.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:77
unsigned myCurrentJamNo
The current jam number.
unsigned getCurrentJamNumber() const
Returns the current number of jams.
SUMOReal myMaxJamInMeters
The max jam length [m].
unsigned getCurrentStartedHalts() const
Returns the length of all jams in meters.
virtual ~MSE2Collector()
Destructor.
SUMOReal getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
SUMOReal getCurrentMeanLength() const
Returns the mean vehicle length of vehicles currently on the detector.
The vehicle arrived at a junction.
Internal representation of a jam.
MSLane *const myLane
Lane on which the reminder works.
unsigned getCurrentMaxJamLengthInVehicles() const
Returns the length in vehicles of the currently largest jam.
virtual SUMOReal getPositionOnLane() const =0
Get the vehicle's position along the lane.
SUMOReal myStartedHalts
The number of started halts [#].
Notification
Definition of a vehicle state.
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:61
SUMOReal getLength() const
Get vehicle's length [m].
A class used to sort known vehicles by their position.
T MAX2(T a, T b)
Definition: StdDefs.h:71
std::vector< SUMOTime > myPastStandingDurations
Halting durations of ended halts [s].
unsigned myMaxVehicleNumber
The max number of vehicles [#veh].
SUMOReal getCurrentJamLengthInMeters() const
Returns the length of all jams in meters.
SUMOReal getPositionOnLane() const
Get the vehicle's position along the lane.
Definition: MSVehicle.h:283
SUMOReal myCurrentMeanLength
The current mean length.
unsigned myCurrentStartedHalts
The number of started halts in the last step.
const MSLane * getLane() const
Returns the lane the reminder works on.
SUMOReal getPartialOccupatorEnd() const
Returns the position of the in-lapping vehicle's end.
Definition: MSLane.h:261
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
const std::string & getID() const
Returns the id.
Definition: Named.h:60
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Adds the vehicle to known vehicles if not beyond the dector.
unsigned myVehicleSamples
The number of collected samples [#].
Representation of a vehicle.
Definition: SUMOVehicle.h:63
std::map< SUMOVehicle *, SUMOTime > myIntervalHaltingVehicleDurations
Storage for halting durations of known vehicles (current interval)
std::list< SUMOVehicle * > myKnownVehicles
List of known vehicles.
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
SUMOReal getCurrentMeanSpeed() const
Returns the mean vehicle speed of vehicles currently on the detector.
Something on a lane to be noticed about vehicle movement.
SUMOReal myJamHaltingSpeedThreshold
A vehicle must driver slower than this to be counted as a part of a jam.
unsigned myCurrentJamLengthInVehicles
The overall jam length in vehicles.
SUMOTime myJamHaltingTimeThreshold
A vehicle must be that long beyond myJamHaltingSpeedThreshold to be counted as a part of a jam...
SUMOReal mySpeedSum
The sum of collected vehicle speeds [m/s].
unsigned myMeanVehicleNumber
The mean number of vehicles [#veh].
SUMOReal myCurrentMaxJamLengthInMeters
the current maximum jam length in meters
SUMOReal getCurrentHaltingNumber() const
Returns the number of current haltings within the area.
unsigned myMeanMaxJamInVehicles
The mean jam length [#veh].
SUMOReal myCurrentJamLengthInMeters
The overall jam length in meters.
std::list< SUMOVehicle * >::const_iterator firstStandingVehicle
The first standing vehicle.
SUMOReal myStartPos
The position the detector starts at.
unsigned myMaxJamInVehicles
The max jam length [#veh].
void detectorUpdate(const SUMOTime step)
Computes the detector values in each time step.
SUMOReal myEndPos
The position the detector ends at.
SUMOReal myCurrentOccupancy
The current occupancy.
SUMOReal myMaxOccupancy
The maximum occupancy [%].
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Adds/removes vehicles from the list of vehicles to regard.
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
SUMOReal getCurrentOccupancy() const
Returns the curent detector occupancy.
SUMOReal myCurrentMeanSpeed
The current mean speed.
void reset()
Resets all values.
unsigned myTimeSamples
The current aggregation duration [#steps].
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
Definition: MSBaseVehicle.h:94
unsigned getCurrentVehicleNumber() const
Returns the number of vehicles currently on the detector.
SUMOReal myMeanMaxJamInMeters
The mean jam length [m].
SUMOReal myOccupancySum
The sum of occupancies [%].
const MSLane *const myLane
The lane the detector is placed at.
SUMOReal getSpeed() const
Returns the vehicle's current speed.
Definition: MSVehicle.h:291
MSE2Collector(const std::string &id, DetectorUsage usage, MSLane *const lane, SUMOReal startPos, SUMOReal detLength, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Constructor.
std::list< SUMOVehicle * >::const_iterator lastStandingVehicle
The last standing vehicle.
unsigned myCurrentMaxJamLengthInVehicles
The current maximum jam length in vehicles.
SUMOReal myJamLengthInMetersSum
The sum of jam lengths [m].
SUMOReal getCurrentMaxJamLengthInMeters() const
Returns the length in meters of the currently largest jam.
MSVehicle * getPartialOccupator() const
Returns the vehicle which laps into this lane.
Definition: MSLane.h:253
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
unsigned getCurrentJamLengthInVehicles() const
Returns the length of all jams in vehicles.
#define SUMOReal
Definition: config.h:215
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
Removes a known vehicle due to its lane-change.
#define DELTA_T
Definition: SUMOTime.h:50
MSLane * getLane() const
Returns the lane the vehicle is on.
Definition: MSVehicle.h:328
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
SUMOReal myCurrentHaltingsNumber
The number of halted vehicles [#].
int operator()(const SUMOVehicle *v1, const SUMOVehicle *v2)
Comparison funtcion.
Base of value-generating classes (detectors)
const std::string & getID() const
Returns the name of the vehicle.
SUMOReal myJamDistanceThreshold
Two standing vehicles must be closer than this to be counted into the same jam.
unsigned myJamLengthInVehiclesSum
The sum of jam lengths [#veh].
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.