Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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:
[legend]

Data Structures

struct  compare
 Compares encounters regarding to their start time. More...
struct  ConflictPointInfo
 ConflictPointInfo stores some information on a specific conflict point (used to store information on ssm-extremal values). 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, std::string egoLane, double egoLanePos, Position egoV, Position foeX, std::string foeLane, double foeLanePos, Position foeV, Position conflictPoint, double egoDistToConflict, double foeDistToConflict, double ttc, double drac, std::pair< double, double > pet, double ppet, double mdrac)
 add a new data point and update encounter type
void countDownExtraTime (double amount)
 decreases myRemaingExtraTime by given amount in seconds
 Encounter (const MSVehicle *_ego, const MSVehicle *const _foe, double _begin, double extraTime)
 Constructor.
double getRemainingExtraTime () const
 returns the remaining extra time
void resetExtraTime (double value)
 resets remainingExtraTime to the given value
std::size_t size () const
 Returns the number of trajectory points stored.
 ~Encounter ()
 Destructor.

Data Fields

double begin
bool closingRequested
 this flag is set by updateEncounter() or directly in processEncounters(), where encounters are closed if it is true.
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.
EncounterType currentType
std::vector< double > DRACspan
 All values for DRAC.
const MSVehicleego
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).
double egoConflictExitTime
std::vector< double > egoDistsToConflict
 Evolution of the ego vehicle's distance to the conflict point.
const std::string egoID
Trajectory egoTrajectory
 Trajectory of the ego vehicle.
double end
const MSVehiclefoe
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).
double foeConflictExitTime
std::vector< double > foeDistsToConflict
 Evolution of the foe vehicle's distance to the conflict point.
const std::string foeID
Trajectory foeTrajectory
 Trajectory of the foe vehicle.
std::vector< double > MDRACspan
 All values for MDRAC.
std::vector< double > PPETspan
 All values for PPET.
double remainingExtraTime
 Remaining extra time (decreases after an encounter ended).
std::vector< double > timeSpan
 time points corresponding to the trajectories
std::vector< double > TTCspan
 All values for TTC.
std::vector< int > typeSpan
 Evolution of the encounter classification (.
Extremal values for the SSMs
ConflictPointInfo minTTC
ConflictPointInfo maxDRAC
ConflictPointInfo maxMDRAC
ConflictPointInfo PET
ConflictPointInfo minPPET

Private Member Functions

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

Detailed Description

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

Definition at line 172 of file MSDevice_SSM.h.

Constructor & Destructor Documentation

◆ Encounter() [1/2]

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

Constructor.

Definition at line 361 of file MSDevice_SSM.cpp.

References begin, closingRequested, currentType, ego, egoConflictEntryTime, egoConflictExitTime, egoID, MSDevice_SSM::ENCOUNTER_TYPE_NOCONFLICT_AHEAD, end, foe, foeConflictEntryTime, foeConflictExitTime, foeID, Named::getID(), INVALID_DOUBLE, maxDRAC, maxMDRAC, minPPET, minTTC, PET, remainingExtraTime, and SIMTIME.

Referenced by Encounter(), MSDevice_SSM::Encounter::compare::operator()(), and operator=().

Here is the caller graph for this function:

◆ ~Encounter()

MSDevice_SSM::Encounter::~Encounter ( )

Destructor.

Definition at line 387 of file MSDevice_SSM.cpp.

References begin, egoID, foeID, and SIMTIME.

◆ Encounter() [2/2]

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

Invalidated Constructor.

References Encounter().

Member Function Documentation

◆ add()

void MSDevice_SSM::Encounter::add ( double time,
EncounterType type,
Position egoX,
std::string egoLane,
double egoLanePos,
Position egoV,
Position foeX,
std::string foeLane,
double foeLanePos,
Position foeV,
Position conflictPoint,
double egoDistToConflict,
double foeDistToConflict,
double ttc,
double drac,
std::pair< double, double > pet,
double ppet,
double mdrac )

add a new data point and update encounter type

Definition at line 397 of file MSDevice_SSM.cpp.

References conflictPointSpan, currentType, Position::distanceTo(), DRACspan, egoDistsToConflict, egoID, egoTrajectory, MSDevice_SSM::ENCOUNTER_TYPE_COLLISION, foeDistsToConflict, foeID, foeTrajectory, INVALID_DOUBLE, maxDRAC, maxMDRAC, MDRACspan, minPPET, minTTC, PET, PPETspan, timeSpan, toString(), TTCspan, and typeSpan.

Referenced by MSDevice_SSM::updateEncounter().

Here is the caller graph for this function:

◆ countDownExtraTime()

void MSDevice_SSM::Encounter::countDownExtraTime ( double amount)

decreases myRemaingExtraTime by given amount in seconds

Definition at line 477 of file MSDevice_SSM.cpp.

References remainingExtraTime.

Referenced by MSDevice_SSM::updatePassedEncounter().

Here is the caller graph for this function:

◆ getRemainingExtraTime()

double MSDevice_SSM::Encounter::getRemainingExtraTime ( ) const

returns the remaining extra time

Definition at line 483 of file MSDevice_SSM.cpp.

References remainingExtraTime.

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

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

References Encounter().

◆ resetExtraTime()

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

resets remainingExtraTime to the given value

Definition at line 471 of file MSDevice_SSM.cpp.

References invalid_return< std::string >::value, and remainingExtraTime.

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

Here is the caller graph for this function:

◆ size()

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

Returns the number of trajectory points stored.

Definition at line 218 of file MSDevice_SSM.h.

References timeSpan.

Referenced by MSDevice_SSM::checkConflictEntryAndExit(), MSDevice_SSM::closeEncounter(), MSDevice_SSM::determineConflictPoint(), MSDevice_SSM::determinePET(), and MSDevice_SSM::updateEncounter().

Here is the caller graph for this function:

Field Documentation

◆ begin

◆ closingRequested

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 300 of file MSDevice_SSM.h.

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

◆ conflictPointSpan

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 275 of file MSDevice_SSM.h.

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

◆ currentType

◆ DRACspan

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

All values for DRAC.

Definition at line 280 of file MSDevice_SSM.h.

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

◆ ego

◆ egoConflictEntryTime

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 255 of file MSDevice_SSM.h.

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

◆ egoConflictExitTime

double MSDevice_SSM::Encounter::egoConflictExitTime

◆ egoDistsToConflict

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

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

Definition at line 268 of file MSDevice_SSM.h.

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

◆ egoID

◆ egoTrajectory

Trajectory MSDevice_SSM::Encounter::egoTrajectory

Trajectory of the ego vehicle.

Definition at line 264 of file MSDevice_SSM.h.

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

◆ end

double MSDevice_SSM::Encounter::end

◆ foe

◆ foeConflictEntryTime

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 257 of file MSDevice_SSM.h.

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

◆ foeConflictExitTime

double MSDevice_SSM::Encounter::foeConflictExitTime

◆ foeDistsToConflict

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

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

Definition at line 270 of file MSDevice_SSM.h.

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

◆ foeID

◆ foeTrajectory

Trajectory MSDevice_SSM::Encounter::foeTrajectory

Trajectory of the foe vehicle.

Definition at line 266 of file MSDevice_SSM.h.

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

◆ maxDRAC

ConflictPointInfo MSDevice_SSM::Encounter::maxDRAC

◆ maxMDRAC

ConflictPointInfo MSDevice_SSM::Encounter::maxMDRAC

◆ MDRACspan

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

All values for MDRAC.

Definition at line 282 of file MSDevice_SSM.h.

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

◆ minPPET

ConflictPointInfo MSDevice_SSM::Encounter::minPPET

◆ minTTC

ConflictPointInfo MSDevice_SSM::Encounter::minTTC

◆ PET

◆ PPETspan

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

All values for PPET.

Definition at line 284 of file MSDevice_SSM.h.

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

◆ remainingExtraTime

double MSDevice_SSM::Encounter::remainingExtraTime

Remaining extra time (decreases after an encounter ended).

Definition at line 252 of file MSDevice_SSM.h.

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

◆ timeSpan

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

time points corresponding to the trajectories

Definition at line 260 of file MSDevice_SSM.h.

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

◆ TTCspan

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

All values for TTC.

Definition at line 278 of file MSDevice_SSM.h.

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

◆ typeSpan

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

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