SUMO - Simulation of Urban MObility
MSDevice_SSM.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // An SSM-device logs encounters / conflicts of the carrying vehicle with other surrounding vehicles.
10 // XXX: Preliminary implementation. Use with care. Especially rerouting vehicles could be problematic.
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2013-2017 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 #ifndef MSDevice_SSM_h
24 #define MSDevice_SSM_h
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 <queue>
37 #include "MSDevice.h"
38 #include <utils/common/SUMOTime.h>
40 #include <utils/geom/Position.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class SUMOVehicle;
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
61 class MSCrossSection;
62 
63 class MSDevice_SSM : public MSDevice {
64 
65 private:
67  static std::set<MSDevice*>* instances;
68 
69 public:
73  // Other vehicle is closer than range, but not on a lane conflicting with the ego's route ahead
75  // Ego and foe vehicles' edges form a part of a consecutive sequence of edges
76  // This type may be specified further by ENCOUNTER_TYPE_FOLLOWING_LEADER or ENCOUNTER_TYPE_FOLLOWING_FOLLOWER
78  // Ego vehicle is on an edge that has a sequence of successors connected to the other vehicle's edge
80  // Other vehicle is on an edge that has a sequence of successors connected to the ego vehicle's current edge
82  // Other vehicle is on an edge that has a sequence of successors connected to the ego vehicle's current edge
84  // Ego and foe share an upcoming edge of their routes while the merging point for the routes is still ahead
85  // This type may be specified further by ENCOUNTER_TYPE_MERGING_LEADER or ENCOUNTER_TYPE_MERGING_FOLLOWER
87  // Other vehicle is on an edge that has a sequence of successors connected to an edge on the ego vehicle's route
88  // and the estimated arrival vehicle at the merge point is earlier for the ego than for the foe
90  // Other vehicle is on an edge that has a sequence of successors connected to an edge on the ego vehicle's route
91  // and the estimated arrival vehicle at the merge point is earlier for the foe than for the ego
93  // Vehicles' bestlanes lead to the same edge but to adjacent lanes
95  // Ego's and foe's routes have crossing edges
96  // This type may be specified further by ENCOUNTER_TYPE_CROSSING_LEADER or ENCOUNTER_TYPE_CROSSING_FOLLOWER
98  // Other vehicle is on an edge that has a sequence of successors leading to an internal edge that crosses the ego vehicle's edge at a junction
99  // and the estimated arrival vehicle at the merge point is earlier for the ego than for the foe
101  // Other vehicle is on an edge that has a sequence of successors leading to an internal edge that crosses the ego vehicle's edge at a junction
102  // and the estimated arrival vehicle at the merge point is earlier for the foe than for the ego
104  // TODO: use ENTERED types for indicating an ongoing conflict.
105  // The encounter is a possible crossing conflict, and the ego vehicle has entered the conflict area
107  // The encounter is a possible crossing conflict, and the foe vehicle has entered the conflict area
109  // The encounter has been a possible crossing conflict, but the ego vehicle has left the conflict area
111  // The encounter has been a possible crossing conflict, but the foe vehicle has left the conflict area
113  // The encounter has been a possible crossing conflict, and both vehicles have entered the conflict area (one must have already left, otherwise this must be a collision)
115  // The encounter has been a possible crossing conflict, but both vehicle have left the conflict area
117  // FOLLOWING_PASSED and MERGING_PASSED are reserved to achieve that these encounter types may be tracked longer (see updatePassedEncounter)
118  // The encounter has been a following situation, but is not active any more
120  // The encounter has been a merging situation, but is not active any more
122  // Collision (currently unused, might be differentiated further)
124  };
125 
126 private:
129  class Encounter {
130  // TODO: Shouldn't the time lines for the conflict point locations be stored? YES!
131  private:
134  struct Trajectory {
135  // positions
137  // momentary speeds
139  };
140 
141  public:
143  Encounter(const MSVehicle* _ego, const MSVehicle* const _foe, double _begin, double extraTime);
145  ~Encounter();
146 
148  void add(double time, EncounterType type, Position egoX, Position egoV, Position foeX, Position foeV,
149  Position conflictPoint, double egoDistToConflict, double foeDistToConflict, double ttc, double drac, std::pair<double, double> pet);
150 
152  std::size_t size() const {
153  return timeSpan.size();
154  }
155 
157  void resetExtraTime(double value);
159  void countDownExtraTime(double amount);
161  double getRemainingExtraTime() const;
162 
164  struct compare {
165  typedef bool value_type;
166  bool operator()(Encounter* e1, Encounter* e2) {
167  return e1->begin <= e2->begin;
168  };
169  };
170 
171 
172 
173  public:
174  const MSVehicle* ego;
175  const MSVehicle* foe;
176  const std::string egoID;
177  const std::string foeID;
178  double begin, end;
180 
183 
188 
190  std::vector<double> timeSpan;
192  std::vector<int> typeSpan;
198  std::vector<double> egoDistsToConflict;
200  std::vector<double> foeDistsToConflict;
201 
206 
208  std::vector<double> TTCspan;
210  std::vector<double> DRACspan;
211 
213  std::vector<std::pair<std::pair<const MSLane*, double>, double> > egoPETCrossSections;
214  std::vector<std::pair<std::pair<const MSLane*, double>, double> > foePETCrossSections;
215 
218  std::pair<std::pair<double, double>, Position> minTTC;
219  std::pair<std::pair<double, double>, Position> maxDRAC;
220  std::pair<std::pair<double, double>, Position> PET;
222 
225 
226  private:
228  Encounter(const Encounter&);
230  Encounter& operator=(const Encounter&);
232  };
233 
234 
253  double ttc;
254  double drac;
255  std::pair<double, double> pet;
256  std::pair<const MSLane*, double> egoConflictEntryCrossSection;
257  std::pair<const MSLane*, double> foeConflictEntryCrossSection;
258  };
259 
260 
264  struct FoeInfo {
267  };
268  // TODO: consider introducing a class foeCollector, which holds the foe info content
269  // plus a vehicle container to be used in findSurrounding vehicles.
270  // findSurroundingVehicles() would then deliver a vector of such foeCollectors
271  // (one for each possible egoConflictLane) instead of a map vehicle->foeInfo
272 
273 
274  typedef std::priority_queue<Encounter*, std::vector<Encounter*>, Encounter::compare> EncounterQueue;
275  typedef std::vector<Encounter*> EncounterVector;
276  typedef std::map<const MSVehicle*, FoeInfo*> FoeInfoMap;
277 public:
278 
282  static void insertOptions(OptionsCont& oc);
283 
284 
295  static void buildVehicleDevices(SUMOVehicle& v, std::vector<MSDevice*>& into);
296 
297 
300  static const std::set<MSDevice*>& getInstances();
301 
307  void updateAndWriteOutput();
308 
309 private:
310  void update();
311  void writeOutConflict(Encounter* e);
312 
314  static void toGeo(Position& x);
316  static void toGeo(PositionVector& x);
317 
318 public:
321  static void cleanup();
322 
323 
324 public:
326  ~MSDevice_SSM();
327 
328 
340  static void findSurroundingVehicles(const MSVehicle& veh, double range, FoeInfoMap& foeCollector);
341 
344  static void getUpstreamVehicles(const MSEdge* edge, double pos, double range, double egoDistToConflictLane, const MSLane* const egoConflictLane, FoeInfoMap& foeCollector, std::set<const MSJunction*> seenJunctions);
345 
348  static void getVehiclesOnJunction(const MSJunction*, double egoDistToConflictLane, const MSLane* const egoConflictLane, FoeInfoMap& foeCollector);
349 
350 
353 
363  bool notifyMove(SUMOVehicle& veh, double oldPos,
364  double newPos, double newSpeed);
365 
366 
376  bool notifyEnter(SUMOVehicle& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
377 
378 
387  bool notifyLeave(SUMOVehicle& veh, double lastPos,
388  MSMoveReminder::Notification reason, const MSLane* enteredLane = 0);
390 
391 
393  const std::string deviceName() const {
394  return "ssm";
395  }
396 
403  void generateOutput() const;
404 
405 
406 
407 private:
419  MSDevice_SSM(SUMOVehicle& holder, const std::string& id, std::string outputFilename, std::map<std::string, double> thresholds,
420  bool trajectories, double range, double extraTime, bool useGeoCoords);
421 
430  void processEncounters(FoeInfoMap& foes, bool forceClose = false);
431 
432 
437 
438 
439 
442  void createEncounters(FoeInfoMap& foes);
443 
444 
447  void resetEncounters();
448 
452  void flushConflicts(bool all = false);
453 
456  void updateEncounter(Encounter* e, FoeInfo* foeInfo);
457 
468 
469 
480  EncounterType classifyEncounter(const FoeInfo* foeInfo, EncounterApproachInfo& eInfo) const;
481 
482 
488  static void determineConflictPoint(EncounterApproachInfo& eInfo);
489 
490 
500  static void estimateConflictTimes(EncounterApproachInfo& eInfo);
501 
502 
510 
511 
520  const MSLane* findFoeConflictLane(const MSVehicle* foe, const MSLane* egoConflictLane, double& distToConflictLane) const;
521 
524  void closeEncounter(Encounter* e);
525 
529 
534  void computeSSMs(EncounterApproachInfo& e) const;
535 
536 
540  void determinePET(EncounterApproachInfo& eInfo) const;
541 
542 
546  void determineTTCandDRAC(EncounterApproachInfo& eInfo) const;
547 
548 
552  double computeTTC(double gap, double followerSpeed, double leaderSpeed) const;
553 
554 
559  static double computeDRAC(double gap, double followerSpeed, double leaderSpeed);
560 
569  static double computeDRAC(double d1, double d2, double v1, double v2, double t1, double t2);
570 
578  static std::string makeStringWithNAs(std::vector<double> v, double NA, std::string sep = " ");
579 
582  static std::string getOutputFilename(const SUMOVehicle& v, std::string deviceID);
583  static double getDetectionRange(const SUMOVehicle& v);
584  static double getExtraTime(const SUMOVehicle& v);
585  static bool useGeoCoords(const SUMOVehicle& v, std::string deviceID);
586  static bool requestsTrajectories(const SUMOVehicle& v);
587  static bool getMeasuresAndThresholds(const SUMOVehicle& v, std::string deviceID,
588  std::map<std::string, double>& thresholds);
590 
591 private:
596  std::map<std::string, double> myThresholds;
601  double myRange;
603  double myExtraTime;
610 
611 
615  EncounterVector myActiveEncounters;
619  EncounterQueue myPastConflicts;
621 
624 
625 private:
627  MSDevice_SSM(const MSDevice_SSM&);
628 
631 
632 
633 };
634 
635 #endif
636 
637 /****************************************************************************/
638 
bool myUseGeoCoords
Whether to use the original coordinate system for output.
Definition: MSDevice_SSM.h:605
static void determineConflictPoint(EncounterApproachInfo &eInfo)
Calculates the (x,y)-coordinate for the eventually predicted conflict point and stores the result in ...
void determinePET(EncounterApproachInfo &eInfo) const
Discriminates between different encounter types and correspondingly determines the PET for those case...
std::pair< const MSLane *, double > egoConflictEntryCrossSection
Definition: MSDevice_SSM.h:256
ENCOUNTER_TYPE_MERGING_ADJACENT.
Definition: MSDevice_SSM.h:94
const std::string egoID
Definition: MSDevice_SSM.h:176
static const std::set< MSDevice * > & getInstances()
returns all currently existing SSM devices
static void getVehiclesOnJunction(const MSJunction *, double egoDistToConflictLane, const MSLane *const egoConflictLane, FoeInfoMap &foeCollector)
Collects all vehicles on the junction into foeCollector.
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:83
void createEncounters(FoeInfoMap &foes)
Makes new encounters for all given vehicles (these should be the ones entering the device&#39;s range in ...
std::pair< std::pair< double, double >, Position > maxDRAC
Definition: MSDevice_SSM.h:219
bool notifyLeave(SUMOVehicle &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called whenever the holder leaves a lane.
std::pair< std::pair< double, double >, Position > minTTC
Definition: MSDevice_SSM.h:218
bool operator()(Encounter *e1, Encounter *e2)
Definition: MSDevice_SSM.h:166
A simple description of a position on a lane (crossing of a lane)
static void cleanup()
Clean up remaining devices instances.
EncounterType
Different types of encounters corresponding to relative positions of the vehicles. The name describes the type from the ego perspective.
Definition: MSDevice_SSM.h:72
PositionVector conflictPointSpan
Predicted location of the conflict: In case of MERGING and CROSSING: entry point to conflict area for...
Definition: MSDevice_SSM.h:205
void updatePassedEncounter(Encounter *e, FoeInfo *foeInfo, EncounterApproachInfo &eInfo)
Updates an encounter, which was classified as ENCOUNTER_TYPE_NOCONFLICT_AHEAD this may be the case be...
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_SSM-options.
MSVehicle * myHolderMS
Definition: MSDevice_SSM.h:608
double egoConflictEntryTime
Times when the ego vehicle entered/left the conflict area. Currently only applies for crossing situat...
Definition: MSDevice_SSM.h:185
A device which collects info on the vehicle trip (mainly on departure and arrival) ...
Definition: MSDevice_SSM.h:63
The base class for an intersection.
Definition: MSJunction.h:64
const MSVehicle * foe
Definition: MSDevice_SSM.h:175
EncounterVector myActiveEncounters
Definition: MSDevice_SSM.h:615
Notification
Definition of a vehicle state.
std::vector< std::pair< std::pair< const MSLane *, double >, double > > foePETCrossSections
Definition: MSDevice_SSM.h:214
std::size_t size() const
Returns the number of trajectory points stored.
Definition: MSDevice_SSM.h:152
ENCOUNTER_TYPE_FOLLOWING_PASSED.
Definition: MSDevice_SSM.h:119
void closeEncounter(Encounter *e)
Finalizes the encounter and calculates SSM values.
static double getDetectionRange(const SUMOVehicle &v)
ENCOUNTER_TYPE_COLLISION.
Definition: MSDevice_SSM.h:123
static void toGeo(Position &x)
convert SUMO-positions to geo coordinates (in place)
std::vector< double > TTCspan
All values for TTC.
Definition: MSDevice_SSM.h:208
ENCOUNTER_TYPE_EGO_ENTERED_CONFLICT_AREA.
Definition: MSDevice_SSM.h:106
ENCOUNTER_TYPE_CROSSING.
Definition: MSDevice_SSM.h:97
const std::string foeID
Definition: MSDevice_SSM.h:177
void updateEncounter(Encounter *e, FoeInfo *foeInfo)
Updates the encounter (adds a new trajectory point) and deletes the foeInfo.
void resetExtraTime(double value)
resets remainingExtraTime to the given value
MSDevice_SSM(SUMOVehicle &holder, const std::string &id, std::string outputFilename, std::map< std::string, double > thresholds, bool trajectories, double range, double extraTime, bool useGeoCoords)
Constructor.
ENCOUNTER_TYPE_CROSSING_FOLLOWER.
Definition: MSDevice_SSM.h:103
ENCOUNTER_TYPE_BOTH_ENTERED_CONFLICT_AREA.
Definition: MSDevice_SSM.h:114
std::pair< const MSLane *, double > foeConflictEntryCrossSection
Definition: MSDevice_SSM.h:257
static bool requestsTrajectories(const SUMOVehicle &v)
Encounter(const MSVehicle *_ego, const MSVehicle *const _foe, double _begin, double extraTime)
Constructor.
ENCOUNTER_TYPE_CROSSING_LEADER.
Definition: MSDevice_SSM.h:100
EncounterType currentType
Definition: MSDevice_SSM.h:179
std::vector< double > DRACspan
All values for DRAC.
Definition: MSDevice_SSM.h:210
std::vector< std::pair< std::pair< const MSLane *, double >, double > > egoPETCrossSections
Cross sections at which a PET shall be calculated for the corresponding vehicle.
Definition: MSDevice_SSM.h:213
ENCOUNTER_TYPE_FOLLOWING_LEADER.
Definition: MSDevice_SSM.h:81
static void getUpstreamVehicles(const MSEdge *edge, double pos, double range, double egoDistToConflictLane, const MSLane *const egoConflictLane, FoeInfoMap &foeCollector, std::set< const MSJunction * > seenJunctions)
Collects all vehicles within range &#39;range&#39; upstream of the position &#39;pos&#39; on the edge &#39;edge&#39; into foe...
A road/street connecting two junctions.
Definition: MSEdge.h:81
ENCOUNTER_TYPE_MERGING_FOLLOWER.
Definition: MSDevice_SSM.h:92
ENCOUNTER_TYPE_MERGING.
Definition: MSDevice_SSM.h:86
static bool getMeasuresAndThresholds(const SUMOVehicle &v, std::string deviceID, std::map< std::string, double > &thresholds)
ENCOUNTER_TYPE_BOTH_LEFT_CONFLICT_AREA.
Definition: MSDevice_SSM.h:116
static bool useGeoCoords(const SUMOVehicle &v, std::string deviceID)
Representation of a vehicle.
Definition: SUMOVehicle.h:67
double getRemainingExtraTime() const
returns the remaining extra time
static double computeDRAC(double gap, double followerSpeed, double leaderSpeed)
Computes the DRAC (deceleration to avoid a collision) for a lead/follow situation as defined...
void processEncounters(FoeInfoMap &foes, bool forceClose=false)
Finds encounters for which the foe vehicle has disappeared from range. remainingExtraTime is decrease...
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A trajectory encloses a series of positions x and speeds v for one vehicle (the times are stored only...
Definition: MSDevice_SSM.h:134
bool myComputeTTC
Flags for switching on / off comutation of different SSMs, derived from myMeasures.
Definition: MSDevice_SSM.h:607
void determineTTCandDRAC(EncounterApproachInfo &eInfo) const
Discriminates between different encounter types and correspondingly determines TTC and DRAC for those...
A list of positions.
OutputDevice * myOutputFile
Output device.
Definition: MSDevice_SSM.h:623
ENCOUNTER_TYPE_FOE_LEFT_CONFLICT_AREA.
Definition: MSDevice_SSM.h:112
void resetEncounters()
Closes all current Encounters and moves conflicts to myPastConflicts,.
double myRange
Detection range. For vehicles closer than this distance from the ego vehicle, SSMs are traced...
Definition: MSDevice_SSM.h:601
std::vector< double > egoDistsToConflict
Evolution of the ego vehicle&#39;s distance to the conflict point.
Definition: MSDevice_SSM.h:198
ENCOUNTER_TYPE_FOLLOWING_FOLLOWER.
Definition: MSDevice_SSM.h:79
void generateOutput() const
Finalizes output. Called on vehicle removal.
ENCOUNTER_TYPE_NOCONFLICT_AHEAD.
Definition: MSDevice_SSM.h:74
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called whenever the holder enteres a lane.
void computeSSMs(EncounterApproachInfo &e) const
Compute current values of the logged SSMs (myMeasures) for the given encounter &#39;e&#39; and update &#39;e&#39; acc...
bool qualifiesAsConflict(Encounter *e)
Tests if the SSM values exceed the threshold for qualification as conflict.
static void checkConflictEntryAndExit(EncounterApproachInfo &eInfo)
Checks whether ego or foe have entered or left the conflict area in the last step and eventually writ...
ENCOUNTER_TYPE_MERGING_LEADER.
Definition: MSDevice_SSM.h:89
ENCOUNTER_TYPE_FOE_ENTERED_CONFLICT_AREA.
Definition: MSDevice_SSM.h:108
void updateAndWriteOutput()
This is called once per time step in MSNet::writeOutput() and collects the surrounding vehicles...
double myOldestActiveEncounterBegin
begin time of the oldest active encounter
Definition: MSDevice_SSM.h:617
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
void storeEncountersExceedingMaxLength()
Closes encounters, whose duration exceeds the maximal encounter length. If it is classified as confli...
ENCOUNTER_TYPE_FOLLOWING.
Definition: MSDevice_SSM.h:77
bool mySaveTrajectories
This determines whether the whole trajectories of the vehicles (position, speed, ssms) shall be saved...
Definition: MSDevice_SSM.h:599
static std::string getOutputFilename(const SUMOVehicle &v, std::string deviceID)
const MSVehicle * ego
Definition: MSDevice_SSM.h:174
static double getExtraTime(const SUMOVehicle &v)
void flushConflicts(bool all=false)
Writes out all past conflicts that have begun earlier than the oldest active encounter.
static std::string makeStringWithNAs(std::vector< double > v, double NA, std::string sep=" ")
make a string of a double vector and treat a special value as invalid ("NA")
Compares encounters regarding to their start time.
Definition: MSDevice_SSM.h:164
std::vector< double > foeDistsToConflict
Evolution of the foe vehicle&#39;s distance to the conflict point.
Definition: MSDevice_SSM.h:200
double computeTTC(double gap, double followerSpeed, double leaderSpeed) const
Computes the time to collision (in seconds) for two vehicles with a given initial gap under the assum...
bool closingRequested
this flag is set by updateEncounter() or directly in processEncounters(), where encounters are closed...
Definition: MSDevice_SSM.h:224
Abstract in-vehicle device.
Definition: MSDevice.h:71
bool myComputeDRAC
Definition: MSDevice_SSM.h:607
ENCOUNTER_TYPE_FOLLOWING_PASSED.
Definition: MSDevice_SSM.h:121
std::vector< Encounter * > EncounterVector
Definition: MSDevice_SSM.h:275
void countDownExtraTime(double amount)
decreases myRemaingExtraTime by given amount in seconds
double foeConflictEntryTime
Times when the foe vehicle entered/left the conflict area. Currently only applies for crossing situat...
Definition: MSDevice_SSM.h:187
std::map< const MSVehicle *, FoeInfo * > FoeInfoMap
Definition: MSDevice_SSM.h:276
const MSLane * egoConflictLane
Definition: MSDevice_SSM.h:265
Trajectory egoTrajectory
Trajectory of the ego vehicle.
Definition: MSDevice_SSM.h:194
static std::set< MSDevice * > * instances
All currently existing SSM devices.
Definition: MSDevice_SSM.h:67
~MSDevice_SSM()
Destructor.
Structure to collect some info on the encounter needed during ssm calculation by various functions...
Definition: MSDevice_SSM.h:236
std::vector< double > timeSpan
time points corresponding to the trajectories
Definition: MSDevice_SSM.h:190
A storage for options typed value containers)
Definition: OptionsCont.h:99
const MSLane * findFoeConflictLane(const MSVehicle *foe, const MSLane *egoConflictLane, double &distToConflictLane) const
Computes the conflict lane for the foe.
ENCOUNTER_TYPE_EGO_LEFT_CONFLICT_AREA.
Definition: MSDevice_SSM.h:110
std::pair< double, double > pet
Definition: MSDevice_SSM.h:255
const std::string deviceName() const
return the name for this type of device
Definition: MSDevice_SSM.h:393
std::map< std::string, double > myThresholds
Definition: MSDevice_SSM.h:596
Encounter & operator=(const Encounter &)
Invalidated assignment operator.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
An encounter is an episode involving two vehicles, which are closer to each other than some specified...
Definition: MSDevice_SSM.h:129
double myExtraTime
Extra time in seconds to be logged after a conflict is over.
Definition: MSDevice_SSM.h:603
std::vector< int > typeSpan
Evolution of the encounter classification (.
Definition: MSDevice_SSM.h:192
double remainingExtraTime
Remaining extra time (decreases after an encounter ended)
Definition: MSDevice_SSM.h:182
ENCOUNTER_TYPE_ON_ADJACENT_LANES.
Definition: MSDevice_SSM.h:83
static void estimateConflictTimes(EncounterApproachInfo &eInfo)
Estimates the time until conflict for the vehicles based on the distance to the conflict entry points...
void writeOutConflict(Encounter *e)
bool notifyMove(SUMOVehicle &veh, double oldPos, double newPos, double newSpeed)
Checks for waiting steps when the vehicle moves.
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
EncounterType classifyEncounter(const FoeInfo *foeInfo, EncounterApproachInfo &eInfo) const
Classifies the current type of the encounter provided some information on the opponents.
std::pair< std::pair< double, double >, Position > PET
Definition: MSDevice_SSM.h:220
EncounterQueue myPastConflicts
Past encounters that where qualified as conflicts and are not yet flushed to the output file...
Definition: MSDevice_SSM.h:619
Trajectory foeTrajectory
Trajectory of the foe vehicle.
Definition: MSDevice_SSM.h:196
static void findSurroundingVehicles(const MSVehicle &veh, double range, FoeInfoMap &foeCollector)
Returns all vehicles, which are within the given range of the given vehicle.
std::priority_queue< Encounter *, std::vector< Encounter * >, Encounter::compare > EncounterQueue
Definition: MSDevice_SSM.h:274
void add(double time, EncounterType type, Position egoX, Position egoV, Position foeX, Position foeV, Position conflictPoint, double egoDistToConflict, double foeDistToConflict, double ttc, double drac, std::pair< double, double > pet)
add a new data point and update encounter type