SUMO - Simulation of Urban MObility
MSDevice_SSM::Encounter Class Reference

An encounter is an episode involving two vehicles, which are closer to each other than some specified distance. More...

Collaboration diagram for MSDevice_SSM::Encounter:
Collaboration graph

Data Structures

struct  compare
 Compares encounters regarding to their start time. More...
 
struct  Trajectory
 A trajectory encloses a series of positions x and speeds v for one vehicle (the times are stored only once in the enclosing encounter) More...
 

Public Member Functions

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 More...
 
void countDownExtraTime (double amount)
 decreases myRemaingExtraTime by given amount in seconds More...
 
 Encounter (const MSVehicle *_ego, const MSVehicle *const _foe, double _begin, double extraTime)
 Constructor. More...
 
double getRemainingExtraTime () const
 returns the remaining extra time More...
 
void resetExtraTime (double value)
 resets remainingExtraTime to the given value More...
 
std::size_t size () const
 Returns the number of trajectory points stored. More...
 
 ~Encounter ()
 Destructor. More...
 

Data Fields

double begin
 
bool closingRequested
 this flag is set by updateEncounter() or directly in processEncounters(), where encounters are closed if it is true. More...
 
PositionVector conflictPointSpan
 Predicted location of the conflict: In case of MERGING and CROSSING: entry point to conflict area for follower In case of FOLLOWING: position of leader's back. More...
 
EncounterType currentType
 
std::vector< double > DRACspan
 All values for DRAC. More...
 
const MSVehicle * ego
 
double egoConflictEntryTime
 Times when the ego vehicle entered/left the conflict area. Currently only applies for crossing situations. Used for PET calculation. (May be defined for merge conflicts in the future) More...
 
double egoConflictExitTime
 
std::vector< double > egoDistsToConflict
 Evolution of the ego vehicle's distance to the conflict point. More...
 
const std::string egoID
 
std::vector< std::pair< std::pair< const MSLane *, double >, double > > egoPETCrossSections
 Cross sections at which a PET shall be calculated for the corresponding vehicle. More...
 
Trajectory egoTrajectory
 Trajectory of the ego vehicle. More...
 
double end
 
const MSVehicle * foe
 
double foeConflictEntryTime
 Times when the foe vehicle entered/left the conflict area. Currently only applies for crossing situations. Used for PET calculation. (May be defined for merge conflicts in the future) More...
 
double foeConflictExitTime
 
std::vector< double > foeDistsToConflict
 Evolution of the foe vehicle's distance to the conflict point. More...
 
const std::string foeID
 
std::vector< std::pair< std::pair< const MSLane *, double >, double > > foePETCrossSections
 
Trajectory foeTrajectory
 Trajectory of the foe vehicle. More...
 
double remainingExtraTime
 Remaining extra time (decreases after an encounter ended) More...
 
std::vector< double > timeSpan
 time points corresponding to the trajectories More...
 
std::vector< double > TTCspan
 All values for TTC. More...
 
std::vector< int > typeSpan
 Evolution of the encounter classification (. More...
 
Extremal values for the SSMs (as < <time,value>,Position>-pairs)
std::pair< std::pair< double, double >, Position > minTTC
 
std::pair< std::pair< double, double >, Position > maxDRAC
 
std::pair< std::pair< double, double >, Position > PET
 

Private Member Functions

 Encounter (const Encounter &)
 Invalidated Constructor. More...
 
Encounter & operator= (const Encounter &)
 Invalidated assignment operator. More...
 

Detailed Description

An encounter is an episode involving two vehicles, which are closer to each other than some specified distance.

Definition at line 129 of file MSDevice_SSM.h.

Constructor & Destructor Documentation

MSDevice_SSM::Encounter::Encounter ( const MSVehicle *  _ego,
const MSVehicle *const  _foe,
double  _begin,
double  extraTime 
)

Constructor.

Definition at line 242 of file MSDevice_SSM.cpp.

References ego, foe, MSBaseVehicle::getID(), and SIMTIME.

MSDevice_SSM::Encounter::~Encounter ( )

Destructor.

Definition at line 265 of file MSDevice_SSM.cpp.

References begin, egoID, foeID, and SIMTIME.

MSDevice_SSM::Encounter::Encounter ( const Encounter &  )
private

Invalidated Constructor.

Member Function Documentation

void MSDevice_SSM::Encounter::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 
)
void MSDevice_SSM::Encounter::countDownExtraTime ( double  amount)

decreases myRemaingExtraTime by given amount in seconds

Definition at line 320 of file MSDevice_SSM.cpp.

References remainingExtraTime.

Referenced by size(), and MSDevice_SSM::updatePassedEncounter().

double MSDevice_SSM::Encounter::getRemainingExtraTime ( ) const

returns the remaining extra time

Definition at line 326 of file MSDevice_SSM.cpp.

References remainingExtraTime.

Referenced by MSDevice_SSM::processEncounters(), size(), and MSDevice_SSM::updatePassedEncounter().

Encounter& MSDevice_SSM::Encounter::operator= ( const Encounter &  )
private

Invalidated assignment operator.

void MSDevice_SSM::Encounter::resetExtraTime ( double  value)

resets remainingExtraTime to the given value

Definition at line 314 of file MSDevice_SSM.cpp.

References remainingExtraTime.

Referenced by size(), MSDevice_SSM::updateEncounter(), and MSDevice_SSM::updatePassedEncounter().

std::size_t MSDevice_SSM::Encounter::size ( ) const
inline

Returns the number of trajectory points stored.

Definition at line 152 of file MSDevice_SSM.h.

References countDownExtraTime(), getRemainingExtraTime(), resetExtraTime(), and timeSpan.

Referenced by MSDevice_SSM::determinePET().

Field Documentation

bool MSDevice_SSM::Encounter::closingRequested

this flag is set by updateEncounter() or directly in processEncounters(), where encounters are closed if it is true.

Definition at line 224 of file MSDevice_SSM.h.

Referenced by MSDevice_SSM::processEncounters(), and MSDevice_SSM::updatePassedEncounter().

PositionVector MSDevice_SSM::Encounter::conflictPointSpan

Predicted location of the conflict: In case of MERGING and CROSSING: entry point to conflict area for follower In case of FOLLOWING: position of leader's back.

Definition at line 205 of file MSDevice_SSM.h.

Referenced by add(), MSDevice_SSM::determineConflictPoint(), and MSDevice_SSM::writeOutConflict().

EncounterType MSDevice_SSM::Encounter::currentType

Definition at line 179 of file MSDevice_SSM.h.

Referenced by add(), and MSDevice_SSM::checkConflictEntryAndExit().

std::vector<double> MSDevice_SSM::Encounter::DRACspan

All values for DRAC.

Definition at line 210 of file MSDevice_SSM.h.

Referenced by add(), and MSDevice_SSM::writeOutConflict().

double MSDevice_SSM::Encounter::egoConflictEntryTime

Times when the ego vehicle entered/left the conflict area. Currently only applies for crossing situations. Used for PET calculation. (May be defined for merge conflicts in the future)

Definition at line 185 of file MSDevice_SSM.h.

Referenced by MSDevice_SSM::checkConflictEntryAndExit(), and MSDevice_SSM::determinePET().

double MSDevice_SSM::Encounter::egoConflictExitTime
std::vector<double> MSDevice_SSM::Encounter::egoDistsToConflict

Evolution of the ego vehicle's distance to the conflict point.

Definition at line 198 of file MSDevice_SSM.h.

Referenced by add(), MSDevice_SSM::determinePET(), and MSDevice_SSM::updatePassedEncounter().

std::vector<std::pair<std::pair<const MSLane*, double>, double> > MSDevice_SSM::Encounter::egoPETCrossSections

Cross sections at which a PET shall be calculated for the corresponding vehicle.

Definition at line 213 of file MSDevice_SSM.h.

Referenced by MSDevice_SSM::checkConflictEntryAndExit().

Trajectory MSDevice_SSM::Encounter::egoTrajectory

Trajectory of the ego vehicle.

Definition at line 194 of file MSDevice_SSM.h.

Referenced by add(), and MSDevice_SSM::writeOutConflict().

double MSDevice_SSM::Encounter::end

Definition at line 178 of file MSDevice_SSM.h.

Referenced by MSDevice_SSM::closeEncounter(), and MSDevice_SSM::writeOutConflict().

double MSDevice_SSM::Encounter::foeConflictEntryTime

Times when the foe vehicle entered/left the conflict area. Currently only applies for crossing situations. Used for PET calculation. (May be defined for merge conflicts in the future)

Definition at line 187 of file MSDevice_SSM.h.

Referenced by MSDevice_SSM::checkConflictEntryAndExit(), and MSDevice_SSM::determinePET().

double MSDevice_SSM::Encounter::foeConflictExitTime
std::vector<double> MSDevice_SSM::Encounter::foeDistsToConflict

Evolution of the foe vehicle's distance to the conflict point.

Definition at line 200 of file MSDevice_SSM.h.

Referenced by add(), MSDevice_SSM::determinePET(), and MSDevice_SSM::updatePassedEncounter().

std::vector<std::pair<std::pair<const MSLane*, double>, double> > MSDevice_SSM::Encounter::foePETCrossSections

Definition at line 214 of file MSDevice_SSM.h.

Referenced by MSDevice_SSM::checkConflictEntryAndExit().

Trajectory MSDevice_SSM::Encounter::foeTrajectory

Trajectory of the foe vehicle.

Definition at line 196 of file MSDevice_SSM.h.

Referenced by add(), and MSDevice_SSM::writeOutConflict().

std::pair<std::pair<double, double>, Position> MSDevice_SSM::Encounter::maxDRAC
std::pair<std::pair<double, double>, Position> MSDevice_SSM::Encounter::minTTC
std::pair<std::pair<double, double>, Position> MSDevice_SSM::Encounter::PET
double MSDevice_SSM::Encounter::remainingExtraTime

Remaining extra time (decreases after an encounter ended)

Definition at line 182 of file MSDevice_SSM.h.

Referenced by countDownExtraTime(), getRemainingExtraTime(), and resetExtraTime().

std::vector<double> MSDevice_SSM::Encounter::timeSpan

time points corresponding to the trajectories

Definition at line 190 of file MSDevice_SSM.h.

Referenced by add(), MSDevice_SSM::checkConflictEntryAndExit(), MSDevice_SSM::closeEncounter(), size(), and MSDevice_SSM::writeOutConflict().

std::vector<double> MSDevice_SSM::Encounter::TTCspan

All values for TTC.

Definition at line 208 of file MSDevice_SSM.h.

Referenced by add(), and MSDevice_SSM::writeOutConflict().

std::vector<int> MSDevice_SSM::Encounter::typeSpan

Evolution of the encounter classification (.

See also
EncounterType)

Definition at line 192 of file MSDevice_SSM.h.

Referenced by add(), MSDevice_SSM::classifyEncounter(), MSDevice_SSM::determinePET(), MSDevice_SSM::updatePassedEncounter(), and MSDevice_SSM::writeOutConflict().


The documentation for this class was generated from the following files: