ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
larcfm::CDII Class Reference

#include <CDII.h>

Inheritance diagram for larcfm::CDII:
larcfm::ErrorReporter larcfm::Detection3DAcceptor

Public Member Functions

 CDII ()
 
CDIICore const & getCore () const
 
double getDistance (const std::string &units) const
 
double getHeight (const std::string &units) const
 
void setDistance (double distance, const std::string &units)
 
void setHeight (double height, const std::string &units)
 
double getFilterTime ()
 
void setFilterTime (double cdfilter)
 
int size () const
 
bool conflict () const
 
double getTimeIn (int i) const
 
double getTimeOut (int i) const
 
int getSegmentIn (int i) const
 
int getSegmentOut (int i) const
 
double getCriticalTime (int i) const
 
double getDistanceAtCriticalTime (int i) const
 
bool conflictBetween (double start, double end) const
 
bool detection (const Plan &ownship, const Plan &traffic, double startT, double endT, bool interpolateVirtuals)
 
bool detection (const Plan &ownship, const Plan &traffic, double startT, double endT)
 
bool detectionExtended (const Plan &ownship, const Plan &traffic, double startT, double endT, bool interpolateVirtuals)
 
bool detectionExtended (const Plan &ownship, const Plan &traffic, double startT, double endT)
 
void setCoreDetectionPtr (const Detection3D *c)
 
void setCoreDetectionRef (const Detection3D &c)
 
Detection3DgetCoreDetectionPtr () const
 
Detection3DgetCoreDetectionRef () const
 
bool hasError () const
 
bool hasMessage () const
 
std::string getMessage ()
 
std::string getMessageNoClear () const
 

Static Public Member Functions

static CDII make (double distance, const std::string &dUnits, double height, const std::string &hUnits)
 
static CDII mk (double distance, double height)
 

Private Member Functions

 CDII (double distance, double height)
 
double getDistance () const
 
double getHeight () const
 
void setDistance (double distance)
 
void setHeight (double height)
 

Private Attributes

CDIICore cdii_core
 
ErrorLog error
 

Detailed Description

This class implements the algorithm for conflict detection between an ownship and a traffic aircraft, where the trajectories of both aircraft are modeled with intent information.

This class can be used two ways: through an object or through a static method. The static method approach has the advantage that an object does not need to be created. The object approach has the advantage that more information is available. Specifically, the start and end times for every conflict are available in the object approach.

When using the object method, all method getTimeIn(), etc, assume that the detection() method has been called first.

Usage: CDII.detection(ownship,traffic,B,T)

If there are long legs in the ownship Plan, then it is prudent to call

PlanUtil.interpolateVirtuals(ownship, Units.from("NM",0.1) ,0 , Tinfinity);

before the detection call.

Constructor & Destructor Documentation

◆ CDII() [1/2]

larcfm::CDII::CDII ( double  distance,
double  height 
)
private

Create a new conflict detection (intent information for both the ownship and traffic) object.

Parameters
distancethe minimum horizontal separation distance [m]
heightthe minimum vertical separation height [m].

◆ CDII() [2/2]

larcfm::CDII::CDII ( )

Create a new conflict detection (intent information for both the ownship and traffic) object.

Member Function Documentation

◆ conflict()

bool larcfm::CDII::conflict ( ) const

Returns if there were any conflicts

◆ conflictBetween()

bool larcfm::CDII::conflictBetween ( double  start,
double  end 
) const

Is there a conflict at any time in the interval from start to end (inclusive). This method assumes that the detection() method has been called first.

Parameters
startthe time to begin looking for conflicts [s]
endthe time to end looking for conflicts [s]
Returns
true if there is a conflict

◆ detection()

bool larcfm::CDII::detection ( const Plan ownship,
const Plan traffic,
double  startT,
double  endT,
bool  interpolateVirtuals 
)

Returns if there is a conflict between two aircraft: the ownship and the traffic aircraft.

Parameters
ownshipthe trajectory intent of the ownship
trafficthe trajectory intent of the traffic
startTthe time, in [s], to start looking for conflicts. This can be 0.0.
endTthe time, in [s], to end looking for conflicts (absolute time)
Returns
true if there is a conflict

Note: If the aircraft are in loss of separation at time startT, the time in reported for that conflict will be startT.

◆ detectionExtended()

bool larcfm::CDII::detectionExtended ( const Plan ownship,
const Plan traffic,
double  startT,
double  endT,
bool  interpolateVirtuals 
)

Returns if there is a conflict between two aircraft: the ownship and the traffic aircraft. This version can be less efficient than the normal detection() call, but all reported conflict time in and time out values will not be constrained to be within the lookahead times used.

Parameters
ownshipthe trajectory intent of the ownship
trafficthe trajectory intent of the traffic
startTthe time, in [s], to start looking for conflicts. This can be 0.0.
endTthe time, in [s], to end looking for conflicts (absolute time)
Returns
true if there is a conflict

Note: All time in and time out data reported will be accurate within the length of the given plans.

◆ getCoreDetectionPtr()

Detection3D * larcfm::CDII::getCoreDetectionPtr ( ) const
virtual

Return a pointer to this object's Detection3D instance.

Implements larcfm::Detection3DAcceptor.

◆ getCoreDetectionRef()

Detection3D & larcfm::CDII::getCoreDetectionRef ( ) const
virtual

Return a reference to this object's Detection3D instance.

Implements larcfm::Detection3DAcceptor.

◆ getDistance() [1/2]

double larcfm::CDII::getDistance ( ) const
private

Returns the minimum horizontal separation distance in [m]

◆ getDistance() [2/2]

double larcfm::CDII::getDistance ( const std::string &  units) const

Returns the minimum horizontal separation distance in the given units

◆ getFilterTime()

double larcfm::CDII::getFilterTime ( )

Returns the conflict detection filter time.

Returns
the conflict detection filter time seconds

◆ getHeight() [1/2]

double larcfm::CDII::getHeight ( ) const
private

Returns the minimum vertical separation distance in [m]

◆ getHeight() [2/2]

double larcfm::CDII::getHeight ( const std::string &  units) const

Returns the minimum vertical separation distance in the given units

◆ getMessage()

std::string larcfm::CDII::getMessage ( )
inlinevirtual

Return a string representation of any errors or warnings. Calling this method will clear any messages and reset both the error and warning status to none.

Returns
error and warning messages. If there are no messages, an empty string is returned.

Implements larcfm::ErrorReporter.

◆ getMessageNoClear()

std::string larcfm::CDII::getMessageNoClear ( ) const
inlinevirtual

Return a string representation of any errors or warnings. Calling this method will not clear the error or warning status (i.e., hasError() will return the same value before and after this call.)

Returns
error and warning messages. If there are no messages, an empty string is returned.

Implements larcfm::ErrorReporter.

◆ getSegmentIn()

int larcfm::CDII::getSegmentIn ( int  i) const

Returns the segment number of the entry into a conflict from the ownship aircraft's flight plan. If there was not a conflict, then this value is meaningless.

Parameters
ithe i-th conflict, must be between 0..size()-1

◆ getSegmentOut()

int larcfm::CDII::getSegmentOut ( int  i) const

Returns the segment number of the exit from a conflict from the ownship aircraft's flight plan. If there was not a conflict, then this value is meaningless.

Parameters
ithe i-th conflict, must be between 0..size()-1

◆ getTimeIn()

double larcfm::CDII::getTimeIn ( int  i) const

Returns the start time of the conflict in [s]. This value is in absolute time. If there was not a conflict, then this value is meaningless.

Parameters
ithe i-th conflict, must be between 0..size()-1

◆ getTimeOut()

double larcfm::CDII::getTimeOut ( int  i) const

Returns the end time of the conflict in [s]. This value is in absolute time. If there was not a conflict, then this value is meaningless.

Parameters
ithe i-th conflict, must be between 0..size()-1

◆ hasError()

bool larcfm::CDII::hasError ( ) const
inlinevirtual

Does this object have an error?

Returns
true if there is an error.

Implements larcfm::ErrorReporter.

◆ hasMessage()

bool larcfm::CDII::hasMessage ( ) const
inlinevirtual

Does this object have an error or a warning?

Returns
true if there is an error or warning.

Implements larcfm::ErrorReporter.

◆ make()

CDII larcfm::CDII::make ( double  distance,
const std::string &  dUnits,
double  height,
const std::string &  hUnits 
)
static

Factory method for cylindrical detection

Parameters
distance
dUnits
height
hUnits
Returns
CDII object

◆ mk()

CDII larcfm::CDII::mk ( double  distance,
double  height 
)
static

Factory method for cylindrical detection

Parameters
distance
dUnits
height
hUnits
Returns
CDII object

◆ setCoreDetectionPtr()

void larcfm::CDII::setCoreDetectionPtr ( const Detection3D c)
virtual

Experimental. You are responsible for deleting c after this call.

Implements larcfm::Detection3DAcceptor.

◆ setCoreDetectionRef()

void larcfm::CDII::setCoreDetectionRef ( const Detection3D cd)
virtual

Apply a deep copy of the referenced Detection3D object to this object at the lowest level. The user is responsible for cleaning up the original instance.

Implements larcfm::Detection3DAcceptor.

◆ setDistance() [1/2]

void larcfm::CDII::setDistance ( double  distance)
private

Sets the minimum horizontal separation distance in [m]

◆ setDistance() [2/2]

void larcfm::CDII::setDistance ( double  distance,
const std::string &  units 
)

Sets the minimum horizontal separation distance in the specified units

◆ setFilterTime()

void larcfm::CDII::setFilterTime ( double  cdfilter)

Sets the conflict detection filter time.

Parameters
cdfilterthe conflict detection filter time in seconds.

◆ setHeight() [1/2]

void larcfm::CDII::setHeight ( double  height)
private

Sets the minimum vertical separation distance in [m]

◆ setHeight() [2/2]

void larcfm::CDII::setHeight ( double  height,
const std::string &  units 
)

Sets the minimum vertical separation distance in the specified units

◆ size()

int larcfm::CDII::size ( ) const

Returns the number of conflicts


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