Eclipse SUMO - Simulation of Urban MObility
MSE2Collector.h
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 /****************************************************************************/
21 // An areal detector covering to a sequence of consecutive lanes
22 /****************************************************************************/
23 #ifndef MSE2Collector_h
24 #define MSE2Collector_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #include <config.h>
31 
32 #include <vector>
33 #include <list>
34 #include <microsim/MSLane.h>
35 #include <microsim/MSNet.h>
39 #include <cassert>
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 class OutputDevice;
45 class SUMOVehicle;
46 class SUMOTrafficObject;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
82 public:
87  struct VehicleInfo {
90  VehicleInfo(std::string id, std::string type, double length, double minGap, const MSLane* entryLane, double entryOffset,
91  std::size_t currentOffsetIndex, double exitOffset, double distToDetectorEnd, bool onDetector) :
92  id(id),
93  type(type),
94  length(length),
95  minGap(minGap),
96  entryLaneID(entryLane->getID()),
98  currentLane(entryLane),
105  hasEntered(false),
106  lastAccel(0),
107  lastSpeed(0),
108  lastPos(0) {
109  assert(exitOffset < 0);
110  }
111  virtual ~VehicleInfo() {};
113  std::string id;
115  std::string type;
117  double length;
119  double minGap;
121  std::string entryLaneID;
125  double entryOffset;
129  std::size_t currentOffsetIndex;
132  double exitOffset;
139 
145  double lastAccel;
147  double lastSpeed;
150  double lastPos;
151  };
152 
153  typedef std::map<std::string, VehicleInfo*> VehicleInfoMap;
154 
155 
156 private:
162  MoveNotificationInfo(std::string _vehID, double _oldPos, double _newPos, double _speed, double _accel, double _distToDetectorEnd, double _timeOnDetector, double _lengthOnDetector, double _timeLoss, bool _onDetector) :
163  id(_vehID),
164  oldPos(_oldPos),
165  newPos(_newPos),
166  speed(_speed),
167  accel(_accel),
168  distToDetectorEnd(_distToDetectorEnd),
169  timeOnDetector(_timeOnDetector),
170  lengthOnDetector(_lengthOnDetector),
171  timeLoss(_timeLoss),
172  onDetector(_onDetector) {}
173 
174  virtual ~MoveNotificationInfo() {};
175 
177  std::string id;
179  double oldPos;
181  double newPos;
183  double speed;
185  double accel;
193  double timeLoss;
196  };
197 
198 
199 
205  struct JamInfo {
207  std::vector<MoveNotificationInfo*>::const_iterator firstStandingVehicle;
208 
210  std::vector<MoveNotificationInfo*>::const_iterator lastStandingVehicle;
211  };
212 
213 
214 public:
215 
234  MSE2Collector(const std::string& id,
235  DetectorUsage usage, MSLane* lane, double startPos, double endPos, double length,
236  SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
237  const std::string& vTypes);
238 
239 
252  MSE2Collector(const std::string& id,
253  DetectorUsage usage, std::vector<MSLane*> lanes, double startPos, double endPos,
254  SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold,
255  const std::string& vTypes);
256 
257 
259  virtual ~MSE2Collector();
260 
266  virtual DetectorUsage getUsageType() const {
267  return myUsage;
268  }
269 
270 
271 
274 
292  virtual bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos,
293  double newSpeed);
294 
295 
307  virtual bool notifyLeave(SUMOTrafficObject& veh, double lastPos, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
308 
309 
322  virtual bool notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane);
324 
325 
326 
327 
328 
331 
340  virtual void detectorUpdate(const SUMOTime step);
341 
342 
349  virtual void writeXMLOutput(OutputDevice& dev, SUMOTime startTime, SUMOTime stopTime);
350 
351 
360  virtual void writeXMLDetectorProlog(OutputDevice& dev) const;
361 
363 
364 
369  double getStartPos() const {
370  return myStartPos;
371  }
372 
373 
378  double getEndPos() const {
379  return myEndPos;
380  }
381 
386  double getLength() const {
387  return myDetectorLength;
388  }
389 
390 
395  MSLane* getLastLane() const {
396  return myLastLane;
397  }
398 
399 
402  std::vector<MSLane*> getLanes();
403 
410  virtual void reset();
411 
412 
415 
417  int getCurrentVehicleNumber() const;
418 
420  double getCurrentOccupancy() const {
421  return myCurrentOccupancy;
422  }
423 
425  double getCurrentMeanSpeed() const {
426  return myCurrentMeanSpeed;
427  }
428 
430  double getCurrentMeanLength() const {
431  return myCurrentMeanLength;
432  }
433 
435  int getCurrentJamNumber() const {
436  return myCurrentJamNo;
437  }
438 
442  }
443 
447  }
448 
452  }
453 
457  }
458 
461  return myCurrentStartedHalts;
462  }
463 
472  }
473 
478  std::vector<std::string> getCurrentVehicleIDs() const;
479 
482  std::vector<VehicleInfo*> getCurrentVehicles() const;
483 
488  int getPassedVeh() {
490  }
491 
496  void subtractPassedVeh(int passed) {
497  myNumberOfEnteredVehicles -= passed;
498  }
499 
501 
502 
503 
504 
505 
509 
510  int getEstimatedCurrentVehicleNumber(double speedThreshold) const;
511 
513  double getEstimateQueueLength() const;
515 
516 
517 
518 private:
519 
527  bool checkJam(std::vector<MoveNotificationInfo*>::const_iterator mni, std::map<std::string, SUMOTime>& haltingVehicles, std::map<std::string, SUMOTime>& intervalHaltingVehicles);
528 
529 
537  void buildJam(bool isInJam, std::vector<MoveNotificationInfo*>::const_iterator mni, JamInfo*& currentJam, std::vector<JamInfo*>& jams);
538 
539 
544  void processJams(std::vector<JamInfo*>& jams, JamInfo* currentJam);
545 
555  void calculateTimeLossAndTimeOnDetector(const SUMOVehicle& veh, double oldPos, double newPos, const VehicleInfo& vi, double& timeOnDetector, double& timeLoss) const;
556 
561  void initAuxiliaries(std::vector<MSLane*>& lanes);
562 
565  void checkPositioning(bool posGiven = false, double desiredLength = 0.);
566 
569  static double snap(double value, double snapPoint, double snapDist);
570 
574 
575 
576 
587  std::vector<MSLane*> selectLanes(MSLane* endLane, double length, std::string dir);
588 
589 
592  void addDetectorToLanes(std::vector<MSLane*>& lanes);
593 
594 
597  void aggregateOutputValues();
598 
599 
606  void integrateMoveNotification(VehicleInfo* vi, const MoveNotificationInfo* mni);
607 
617  MoveNotificationInfo* makeMoveNotification(const SUMOVehicle& veh, double oldPos, double newPos, double newSpeed, const VehicleInfo& vehInfo) const;
618 
625  VehicleInfo* makeVehicleInfo(const SUMOVehicle& veh, const MSLane* enteredLane) const;
626 
635  static double calculateSegmentTimeLoss(double timespan, double initialSpeed, double accel, double vmax);
636 
640  return mni1->distToDetectorEnd < mni2->distToDetectorEnd;
641  }
642 
643 
644 private:
645 
648 
652  std::vector<std::string> myLanes;
654  std::vector<double> myOffsets;
660  double myStartPos;
662  double myEndPos;
665 
673 
674 
679 
682  std::vector<MoveNotificationInfo*> myMoveNotifications;
683 
687  std::set<std::string> myLeftVehicles;
688 
690  std::map<std::string, SUMOTime> myHaltingVehicleDurations;
691 
693  std::map<std::string, SUMOTime> myIntervalHaltingVehicleDurations;
694 
696  std::vector<SUMOTime> myPastStandingDurations;
697 
699  std::vector<SUMOTime> myPastIntervalStandingDurations;
701 
702 
703 
711  double mySpeedSum;
735 
736 
747 
769 
770 
771 private:
774 
777 };
778 
779 
780 #endif
781 
782 /****************************************************************************/
783 
MSE2Collector::MSE2Collector
MSE2Collector(const std::string &id, DetectorUsage usage, MSLane *lane, double startPos, double endPos, double length, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string &vTypes)
Constructor with given end position and detector length.
Definition: MSE2Collector.cpp:61
SUMOTrafficObject
Representation of a vehicle or person.
Definition: SUMOTrafficObject.h:48
MSE2Collector::getEstimateQueueLength
double getEstimateQueueLength() const
Returns an estimate of the lenght of the queue of vehicles currently stopped on the detector.
Definition: MSE2Collector.cpp:1451
MSE2Collector::MoveNotificationInfo::newPos
double newPos
Position after the last integration step (relative to the vehicle's entry lane on the detector)
Definition: MSE2Collector.h:181
MSE2Collector::VehicleInfo::~VehicleInfo
virtual ~VehicleInfo()
Definition: MSE2Collector.h:111
MSE2Collector::myMaxOccupancy
double myMaxOccupancy
The maximum occupancy [%].
Definition: MSE2Collector.h:723
MSE2Collector::myTotalTimeLoss
double myTotalTimeLoss
The total amount of all time losses [time x vehicle] since the last reset.
Definition: MSE2Collector.h:709
MSE2Collector::getCurrentJamLengthInVehicles
int getCurrentJamLengthInVehicles() const
Returns the length of all jams in vehicles.
Definition: MSE2Collector.h:450
MSE2Collector::myVehicleSamples
double myVehicleSamples
Definition: MSE2Collector.h:707
MSE2Collector::JamInfo
Internal representation of a jam.
Definition: MSE2Collector.h:205
MSNet.h
MSDetectorFileOutput
Base of value-generating classes (detectors)
Definition: MSDetectorFileOutput.h:64
MSE2Collector::checkJam
bool checkJam(std::vector< MoveNotificationInfo * >::const_iterator mni, std::map< std::string, SUMOTime > &haltingVehicles, std::map< std::string, SUMOTime > &intervalHaltingVehicles)
checks whether the vehicle stands in a jam
Definition: MSE2Collector.cpp:1102
MSE2Collector::getCurrentMeanLength
double getCurrentMeanLength() const
Returns the mean vehicle length of vehicles currently on the detector.
Definition: MSE2Collector.h:430
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
MSE2Collector::getCurrentOccupancy
double getCurrentOccupancy() const
Returns the current detector occupancy.
Definition: MSE2Collector.h:420
MSE2Collector::MoveNotificationInfo::onDetector
bool onDetector
whether the vehicle is on the detector at the end of the current timestep
Definition: MSE2Collector.h:195
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
MSE2Collector::VehicleInfo::lastAccel
double lastAccel
Last value of the acceleration.
Definition: MSE2Collector.h:145
MSE2Collector::myNumberOfEnteredVehicles
int myNumberOfEnteredVehicles
Definition: MSE2Collector.h:740
MSE2Collector::getEndPos
double getEndPos() const
Returns the end position of the detector.
Definition: MSE2Collector.h:378
MSE2Collector::myMeanVehicleNumber
int myMeanVehicleNumber
The mean number of vehicles [#veh].
Definition: MSE2Collector.h:733
MSE2Collector::JamInfo::lastStandingVehicle
std::vector< MoveNotificationInfo * >::const_iterator lastStandingVehicle
The last standing vehicle.
Definition: MSE2Collector.h:210
MSE2Collector::myCurrentStartedHalts
int myCurrentStartedHalts
The number of started halts in the last step.
Definition: MSE2Collector.h:765
MSE2Collector::myMoveNotifications
std::vector< MoveNotificationInfo * > myMoveNotifications
Temporal storage for notifications from vehicles that did call the detector's notifyMove() in the las...
Definition: MSE2Collector.h:682
MSE2Collector::VehicleInfo::currentOffsetIndex
std::size_t currentOffsetIndex
Index of currentLane in the detector's myLanes vector.
Definition: MSE2Collector.h:129
MSE2Collector::notifyLeave
virtual bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Removes a known vehicle due to its lane-change.
Definition: MSE2Collector.cpp:676
MSE2Collector::MoveNotificationInfo
Values collected in notifyMove and needed in detectorUpdate() to calculate the accumulated quantities...
Definition: MSE2Collector.h:161
MSE2Collector::myMeanMaxJamInVehicles
int myMeanMaxJamInVehicles
The mean jam length [#veh].
Definition: MSE2Collector.h:725
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
SUMOVehicle
Representation of a vehicle.
Definition: SUMOVehicle.h:61
MSE2Collector::MoveNotificationInfo::id
std::string id
Vehicle's id.
Definition: MSE2Collector.h:174
MSE2Collector::VehicleInfo::totalTimeOnDetector
double totalTimeOnDetector
Accumulated time that this vehicle has spent on the detector since its last entry.
Definition: MSE2Collector.h:136
MSE2Collector::checkPositioning
void checkPositioning(bool posGiven=false, double desiredLength=0.)
Adjusts positioning if the detector length is less than POSITION_EPS and tests some assertions.
Definition: MSE2Collector.cpp:202
MSE2Collector::VehicleInfo::lastSpeed
double lastSpeed
Last value of the speed.
Definition: MSE2Collector.h:147
MSE2Collector::recalculateDetectorLength
void recalculateDetectorLength()
Updates the detector length after myStartPos and myEndPos have been modified.
Definition: MSE2Collector.cpp:263
MSE2Collector::VehicleInfo::minGap
double minGap
vehicle's minGap
Definition: MSE2Collector.h:119
MSE2Collector
An areal detector corresponding to a sequence of consecutive lanes.
Definition: MSE2Collector.h:81
MSE2Collector::myTimeSamples
int myTimeSamples
The current aggregation duration [#steps].
Definition: MSE2Collector.h:719
MSE2Collector::compareMoveNotification
static bool compareMoveNotification(MoveNotificationInfo *mni1, MoveNotificationInfo *mni2)
Definition: MSE2Collector.h:639
MSE2Collector::getCurrentVehicles
std::vector< VehicleInfo * > getCurrentVehicles() const
Returns the VehicleInfos for the vehicles currently on the detector.
Definition: MSE2Collector.cpp:1413
MSE2Collector::~MSE2Collector
virtual ~MSE2Collector()
Destructor.
Definition: MSE2Collector.cpp:297
MSE2Collector::myCurrentMeanLength
double myCurrentMeanLength
The current mean length.
Definition: MSE2Collector.h:753
MSE2Collector::JamInfo::firstStandingVehicle
std::vector< MoveNotificationInfo * >::const_iterator firstStandingVehicle
The first standing vehicle.
Definition: MSE2Collector.h:207
MSE2Collector::getLength
double getLength() const
Returns the length of the detector.
Definition: MSE2Collector.h:386
MSE2Collector::snap
static double snap(double value, double snapPoint, double snapDist)
Snaps value to snpPoint if they are closer than snapDist.
Definition: MSE2Collector.cpp:253
MSE2Collector::myCurrentJamLengthInVehicles
int myCurrentJamLengthInVehicles
The overall jam length in vehicles.
Definition: MSE2Collector.h:763
MSE2Collector::myJamHaltingSpeedThreshold
double myJamHaltingSpeedThreshold
A vehicle must driver slower than this to be counted as a part of a jam.
Definition: MSE2Collector.h:667
MSE2Collector::writeXMLDetectorProlog
virtual void writeXMLDetectorProlog(OutputDevice &dev) const
Open the XML-output.
Definition: MSE2Collector.cpp:1270
MSE2Collector::myPastStandingDurations
std::vector< SUMOTime > myPastStandingDurations
Halting durations of ended halts [s].
Definition: MSE2Collector.h:696
MSE2Collector::myLanes
std::vector< std::string > myLanes
Definition: MSE2Collector.h:652
MSE2Collector::makeVehicleInfo
VehicleInfo * makeVehicleInfo(const SUMOVehicle &veh, const MSLane *enteredLane) const
Creates and returns a VehicleInfo (called at the vehicle's entry)
Definition: MSE2Collector.cpp:816
MSDetectorFileOutput.h
MSE2Collector::getStartPos
double getStartPos() const
Returns the begin position of the detector.
Definition: MSE2Collector.h:369
MSE2Collector::mySpeedSum
double mySpeedSum
The sum of collected vehicle speeds [m/s].
Definition: MSE2Collector.h:711
MSE2Collector::myCurrentMaxJamLengthInVehicles
int myCurrentMaxJamLengthInVehicles
The current maximum jam length in vehicles.
Definition: MSE2Collector.h:759
MSE2Collector::VehicleInfo::VehicleInfo
VehicleInfo(std::string id, std::string type, double length, double minGap, const MSLane *entryLane, double entryOffset, std::size_t currentOffsetIndex, double exitOffset, double distToDetectorEnd, bool onDetector)
Definition: MSE2Collector.h:90
MSMoveReminder
Something on a lane to be noticed about vehicle movement.
Definition: MSMoveReminder.h:64
MSE2Collector::MoveNotificationInfo::lengthOnDetector
double lengthOnDetector
The length of the part of the vehicle on the detector at the end of the last time step.
Definition: MSE2Collector.h:191
MSE2Collector::MoveNotificationInfo::timeOnDetector
double timeOnDetector
Time spent on the detector during the last integration step.
Definition: MSE2Collector.h:189
MSE2Collector::getCurrentMeanSpeed
double getCurrentMeanSpeed() const
Returns the mean vehicle speed of vehicles currently on the detector.
Definition: MSE2Collector.h:425
MSE2Collector::VehicleInfo::id
std::string id
vehicle's ID
Definition: MSE2Collector.h:111
MSE2Collector::myCurrentMeanSpeed
double myCurrentMeanSpeed
The current mean speed.
Definition: MSE2Collector.h:751
MSE2Collector::operator=
MSE2Collector & operator=(const MSE2Collector &)
Invalidated assignment operator.
MSMoveReminder.h
MSE2Collector::processJams
void processJams(std::vector< JamInfo * > &jams, JamInfo *currentJam)
Calculates aggregated values from the given jam structure, deletes all jam-pointers.
Definition: MSE2Collector.cpp:1158
MSE2Collector::aggregateOutputValues
void aggregateOutputValues()
Aggregates and normalize some values for the detector output during detectorUpdate()
Definition: MSE2Collector.cpp:941
MSE2Collector::VehicleInfoMap
std::map< std::string, VehicleInfo * > VehicleInfoMap
Definition: MSE2Collector.h:153
MSE2Collector::myNumberOfSeenVehicles
int myNumberOfSeenVehicles
The number of vehicles, present on the detector at the last reset.
Definition: MSE2Collector.h:742
MSE2Collector::myJamLengthInVehiclesSum
int myJamLengthInVehiclesSum
The sum of jam lengths [#veh].
Definition: MSE2Collector.h:717
MSE2Collector::myJamDistanceThreshold
double myJamDistanceThreshold
Two standing vehicles must be closer than this to be counted into the same jam.
Definition: MSE2Collector.h:671
MSE2Collector::myMaxJamInMeters
double myMaxJamInMeters
The max jam length [m].
Definition: MSE2Collector.h:731
MSE2Collector::getCurrentJamNumber
int getCurrentJamNumber() const
Returns the current number of jams.
Definition: MSE2Collector.h:435
MSE2Collector::myDetectorLength
double myDetectorLength
The total detector length.
Definition: MSE2Collector.h:664
MSE2Collector::VehicleInfo
A VehicleInfo stores values that are tracked for the individual vehicles on the detector,...
Definition: MSE2Collector.h:87
MSE2Collector::initAuxiliaries
void initAuxiliaries(std::vector< MSLane * > &lanes)
Checks integrity of myLanes, adds internal-lane information, inits myLength, myFirstLane,...
Definition: MSE2Collector.cpp:440
MSE2Collector::MoveNotificationInfo::oldPos
double oldPos
Position before the last integration step (relative to the vehicle's entry lane on the detector)
Definition: MSE2Collector.h:179
MSE2Collector::VehicleInfo::lastPos
double lastPos
Definition: MSE2Collector.h:150
MSE2Collector::VehicleInfo::exitOffset
double exitOffset
Definition: MSE2Collector.h:132
MSE2Collector::myStartedHalts
double myStartedHalts
The number of started halts [#].
Definition: MSE2Collector.h:713
MSE2Collector::getCurrentHaltingNumber
int getCurrentHaltingNumber() const
Returns the number of current haltings within the area.
Definition: MSE2Collector.h:470
MSE2Collector::myStartPos
double myStartPos
The position the detector starts at on the first lane.
Definition: MSE2Collector.h:660
MSE2Collector::notifyMove
virtual bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Adds/removes vehicles from the list of vehicles to regard.
Definition: MSE2Collector.cpp:599
MSE2Collector::selectLanes
std::vector< MSLane * > selectLanes(MSLane *endLane, double length, std::string dir)
This is called if no lane sequence is given to the constructor. Builds myLanes from the given informa...
Definition: MSE2Collector.cpp:313
UtilExceptions.h
MSE2Collector::myJamLengthInMetersSum
double myJamLengthInMetersSum
The sum of jam lengths [m].
Definition: MSE2Collector.h:715
MSE2Collector::VehicleInfo::hasEntered
bool hasEntered
Whether the vehicle has already entered the detector (don't count twice!)
Definition: MSE2Collector.h:143
MSE2Collector::MoveNotificationInfo::timeLoss
double timeLoss
timeloss during the last integration step
Definition: MSE2Collector.h:193
MSE2Collector::VehicleInfo::accumulatedTimeLoss
double accumulatedTimeLoss
Accumulated time loss that this vehicle suffered since it entered the detector.
Definition: MSE2Collector.h:138
MSE2Collector::VehicleInfo::distToDetectorEnd
double distToDetectorEnd
Distance left till the detector end after the last integration step (may become negative if the vehic...
Definition: MSE2Collector.h:134
MSE2Collector::getCurrentMaxJamLengthInVehicles
int getCurrentMaxJamLengthInVehicles() const
Returns the length in vehicles of the currently largest jam.
Definition: MSE2Collector.h:440
MSE2Collector::myUsage
DetectorUsage myUsage
Information about how this detector is used.
Definition: MSE2Collector.h:647
MSE2Collector::buildJam
void buildJam(bool isInJam, std::vector< MoveNotificationInfo * >::const_iterator mni, JamInfo *&currentJam, std::vector< JamInfo * > &jams)
Either adds the vehicle to the end of an existing jam, or closes the last jam, and/or creates a new j...
Definition: MSE2Collector.cpp:1047
MSE2Collector::myCurrentJamNo
int myCurrentJamNo
The current jam number.
Definition: MSE2Collector.h:755
MSE2Collector::reset
virtual void reset()
Resets all values.
Definition: MSE2Collector.cpp:1358
MSE2Collector::calculateTimeLossAndTimeOnDetector
void calculateTimeLossAndTimeOnDetector(const SUMOVehicle &veh, double oldPos, double newPos, const VehicleInfo &vi, double &timeOnDetector, double &timeLoss) const
Calculates the time spent on the detector in the last step and the timeloss suffered in the last step...
Definition: MSE2Collector.cpp:1210
MSE2Collector::myHaltingVehicleDurations
std::map< std::string, SUMOTime > myHaltingVehicleDurations
Storage for halting durations of known vehicles (for halting vehicles)
Definition: MSE2Collector.h:690
MSE2Collector::myVehicleInfos
VehicleInfoMap myVehicleInfos
Definition: MSE2Collector.h:678
MSE2Collector::myNumberOfLeftVehicles
int myNumberOfLeftVehicles
The number of vehicles, which have left the detector since the last reset.
Definition: MSE2Collector.h:744
MSE2Collector::VehicleInfo::currentLane
const MSLane * currentLane
Lane, on which the vehicle currently resides (always the one for which the last notifyEnter was recei...
Definition: MSE2Collector.h:127
DetectorUsage
DetectorUsage
Definition: MSDetectorFileOutput.h:51
MSE2Collector::myCurrentMaxJamLengthInMeters
double myCurrentMaxJamLengthInMeters
the current maximum jam length in meters
Definition: MSE2Collector.h:757
MSE2Collector::myFirstLane
MSLane * myFirstLane
The first lane of the detector's lane sequence.
Definition: MSE2Collector.h:656
MSE2Collector::myEndPos
double myEndPos
The position the detector ends at on the last lane.
Definition: MSE2Collector.h:662
MSE2Collector::myLastLane
MSLane * myLastLane
The last lane of the detector's lane sequence.
Definition: MSE2Collector.h:658
MSE2Collector::getLanes
std::vector< MSLane * > getLanes()
Returns a vector containing pointers to the lanes covered by the detector ordered from its first to i...
Definition: MSE2Collector.cpp:589
MSE2Collector::VehicleInfo::entryLaneID
std::string entryLaneID
ID of the lane, on which the vehicle entered the detector.
Definition: MSE2Collector.h:121
MSE2Collector::MoveNotificationInfo::speed
double speed
Speed after the last integration step.
Definition: MSE2Collector.h:183
MSE2Collector::integrateMoveNotification
void integrateMoveNotification(VehicleInfo *vi, const MoveNotificationInfo *mni)
This updates the detector values and the VehicleInfo of a vehicle on the detector with the given Move...
Definition: MSE2Collector.cpp:965
MSE2Collector::myCurrentHaltingsNumber
int myCurrentHaltingsNumber
The number of halted vehicles [#].
Definition: MSE2Collector.h:767
MSE2Collector::addDetectorToLanes
void addDetectorToLanes(std::vector< MSLane * > &lanes)
This adds the detector as a MoveReminder to the associated lanes.
Definition: MSE2Collector.cpp:423
MSE2Collector::writeXMLOutput
virtual void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Write the generated output to the given device.
Definition: MSE2Collector.cpp:1275
MSE2Collector::MoveNotificationInfo::MoveNotificationInfo
MoveNotificationInfo(std::string _vehID, double _oldPos, double _newPos, double _speed, double _accel, double _distToDetectorEnd, double _timeOnDetector, double _lengthOnDetector, double _timeLoss, bool _onDetector)
Definition: MSE2Collector.h:162
MSE2Collector::getUsageType
virtual DetectorUsage getUsageType() const
Returns the detector's usage type.
Definition: MSE2Collector.h:266
MSE2Collector::myIntervalHaltingVehicleDurations
std::map< std::string, SUMOTime > myIntervalHaltingVehicleDurations
Storage for halting durations of known vehicles (current interval)
Definition: MSE2Collector.h:693
MSE2Collector::getLastLane
MSLane * getLastLane() const
Returns the id of the detector's last lane.
Definition: MSE2Collector.h:395
MSE2Collector::subtractPassedVeh
void subtractPassedVeh(int passed)
Subtract the number of vehicles indicated from passed from the sensor count.
Definition: MSE2Collector.h:496
MSE2Collector::myJamHaltingTimeThreshold
SUMOTime myJamHaltingTimeThreshold
A vehicle must be that long beyond myJamHaltingSpeedThreshold to be counted as a part of a jam.
Definition: MSE2Collector.h:669
MSE2Collector::getCurrentJamLengthInMeters
double getCurrentJamLengthInMeters() const
Returns the length of all jams in meters.
Definition: MSE2Collector.h:455
MSE2Collector::MoveNotificationInfo::~MoveNotificationInfo
virtual ~MoveNotificationInfo()
Definition: MSE2Collector.h:174
MSE2Collector::getCurrentMaxJamLengthInMeters
double getCurrentMaxJamLengthInMeters() const
Returns the length in meters of the currently largest jam.
Definition: MSE2Collector.h:445
MSE2Collector::getPassedVeh
int getPassedVeh()
Returns the number of vehicles passed over the sensor (i.e. entered the sensor)
Definition: MSE2Collector.h:488
config.h
MSE2Collector::getCurrentStartedHalts
int getCurrentStartedHalts() const
Returns the length of all jams in meters.
Definition: MSE2Collector.h:460
MSE2Collector::MoveNotificationInfo::accel
double accel
Acceleration in the last integration step.
Definition: MSE2Collector.h:185
MSE2Collector::getCurrentVehicleNumber
int getCurrentVehicleNumber() const
Returns the number of vehicles currently on the detector.
Definition: MSE2Collector.cpp:1387
MSE2Collector::detectorUpdate
virtual void detectorUpdate(const SUMOTime step)
Computes the detector values in each time step.
Definition: MSE2Collector.cpp:838
MSE2Collector::myOffsets
std::vector< double > myOffsets
The distances of the lane-beginnings from the detector start-point.
Definition: MSE2Collector.h:654
MSE2Collector::makeMoveNotification
MoveNotificationInfo * makeMoveNotification(const SUMOVehicle &veh, double oldPos, double newPos, double newSpeed, const VehicleInfo &vehInfo) const
Creates and returns a MoveNotificationInfo containing detector specific information on the vehicle's ...
Definition: MSE2Collector.cpp:1001
MSE2Collector::VehicleInfo::type
std::string type
vehicle's type
Definition: MSE2Collector.h:115
MSLane.h
MSE2Collector::getEstimatedCurrentVehicleNumber
int getEstimatedCurrentVehicleNumber(double speedThreshold) const
Returns an estimate of the number of vehicles currently on the detector.
Definition: MSE2Collector.cpp:1427
MSE2Collector::VehicleInfo::length
double length
vehicle's length
Definition: MSE2Collector.h:117
MSE2Collector::myPastIntervalStandingDurations
std::vector< SUMOTime > myPastIntervalStandingDurations
Halting durations of ended halts for the current interval [s].
Definition: MSE2Collector.h:699
MSE2Collector::myMeanMaxJamInMeters
double myMeanMaxJamInMeters
The mean jam length [m].
Definition: MSE2Collector.h:727
MSE2Collector::MoveNotificationInfo::distToDetectorEnd
double distToDetectorEnd
Distance left till the detector end after the last integration step (may become negative if the vehic...
Definition: MSE2Collector.h:187
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:77
MSMoveReminder::Notification
Notification
Definition of a vehicle state.
Definition: MSMoveReminder.h:89
MSE2Collector::calculateSegmentTimeLoss
static double calculateSegmentTimeLoss(double timespan, double initialSpeed, double accel, double vmax)
Calculates the time loss for a segment with constant vmax.
MSE2Collector::getCurrentVehicleIDs
std::vector< std::string > getCurrentVehicleIDs() const
Returns the IDs of the vehicles within the area.
Definition: MSE2Collector.cpp:1400
MSE2Collector::myMaxJamInVehicles
int myMaxJamInVehicles
The max jam length [#veh].
Definition: MSE2Collector.h:729
MSE2Collector::myCurrentOccupancy
double myCurrentOccupancy
The current occupancy.
Definition: MSE2Collector.h:749
MSE2Collector::VehicleInfo::entryOffset
double entryOffset
Definition: MSE2Collector.h:125
MSE2Collector::myMaxVehicleNumber
int myMaxVehicleNumber
The maximal number of vehicles located on the detector simultaneously since the last reset.
Definition: MSE2Collector.h:746
MSE2Collector::VehicleInfo::onDetector
bool onDetector
whether the vehicle is on the detector at the end of the current timestep
Definition: MSE2Collector.h:141
MSE2Collector::notifyEnter
virtual bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane)
Adds the vehicle to known vehicles if not beyond the dector.
Definition: MSE2Collector.cpp:730
MSE2Collector::myLeftVehicles
std::set< std::string > myLeftVehicles
Keep track of vehicles that left the detector by a regular move along a junction (not lanechange,...
Definition: MSE2Collector.h:687
MSE2Collector::myOccupancySum
double myOccupancySum
The sum of occupancies [%].
Definition: MSE2Collector.h:721
MSE2Collector::myCurrentJamLengthInMeters
double myCurrentJamLengthInMeters
The overall jam length in meters.
Definition: MSE2Collector.h:761