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

#include <Bands.h>

Inheritance diagram for larcfm::Bands:
larcfm::GenericDHStateBands larcfm::ErrorReporter larcfm::GenericStateBands larcfm::GenericBands

Public Member Functions

 Bands (double D, const std::string &dunit, double H, const std::string &hunit, double T, const std::string &tunit, double max_gs, const std::string &gsunit, double max_vs, const std::string &vsunit)
 
 Bands ()
 
void setConflictBands (bool cb)
 
void doConflictBands ()
 
bool areConflictBands () const
 
void setTrackBands (bool dotrk)
 
void enableTrackBands ()
 
void setGroundSpeedBands (bool dogs)
 
void enableGroundSpeedBands ()
 
void setVerticalSpeedBands (bool dovs)
 
void enableVerticalSpeedBands ()
 
void onlyTrackBands ()
 
void onlyGroundSpeedBands ()
 
void onlyVerticalSpeedBands ()
 
void allBands ()
 
void setLookaheadTime (double t, const std::string &unit)
 
void setTime (double t)
 
double getLookaheadTime (const std::string &unit) const
 
double getTime () const
 
void setTimeRange (double b, double t)
 
void setTimeRange (double b, double t, const std::string &tunit)
 
double getStartTime () const
 
double getStartTime (const std::string &unit) const
 
bool isLatLon () const
 
void setDistance (double d, const std::string &unit)
 
double getDistance (const std::string &unit) const
 
void setHeight (double h, const std::string &unit)
 
double getHeight (const std::string &unit) const
 
void setMaxGroundSpeed (double gs, const std::string &unit)
 
double getMaxGroundSpeed () const
 
double getMaxGroundSpeed (const std::string &unit) const
 
void setMaxVerticalSpeed (double vs, const std::string &unit)
 
double getMaxVerticalSpeed () const
 
double getMaxVerticalSpeed (const std::string &unit) const
 
void setTrackTolerance (double trk, const std::string &unit)
 
double getTrackTolerance (const std::string &unit) const
 
void setGroundSpeedTolerance (double gs, const std::string &unit)
 
double getGroundSpeedTolerance (const std::string &unit) const
 
void setVerticalSpeedTolerance (double vs, const std::string &unit)
 
double getVerticalSpeedTolerance (const std::string &unit) const
 
void setOwnship (const TrafficState &o)
 
void setOwnship (const std::string &id, const Position &p, const Velocity &v)
 
void setOwnship (const Position &p, const Velocity &v)
 
void addTraffic (const TrafficState &ac)
 
void addTraffic (const std::string &id, const Position &pi, const Velocity &vi)
 
void addTraffic (const Position &pi, const Velocity &vi)
 
void clear ()
 
bool turnTrackBandsOn ()
 
bool turnGroundSpeedBandsOn ()
 
bool turnVerticalSpeedBandsOn ()
 
int trackLength ()
 
Interval track (int i, const std::string &unit)
 
BandsRegion::Region trackRegion (int i)
 
BandsRegion::Region regionOfTrack (double trk, const std::string &unit)
 
int groundSpeedLength ()
 
Interval groundSpeed (int i, const std::string &unit)
 
BandsRegion::Region groundSpeedRegion (int i)
 
BandsRegion::Region regionOfGroundSpeed (double gs, const std::string &unit)
 
int verticalSpeedLength ()
 
Interval verticalSpeed (int i, const std::string &unit)
 
BandsRegion::Region verticalSpeedRegion (int i)
 
BandsRegion::Region regionOfVerticalSpeed (double vs, const std::string &unit)
 
bool solidTrackBand (BandsRegion::Region br)
 
bool solidGroundSpeedBand (BandsRegion::Region br)
 
bool solidVerticalSpeedBand (BandsRegion::Region br)
 
void mergeTrackBands (Bands &bands)
 
void mergeGroundSpeedBands (Bands &bands)
 
void mergeVerticalSpeedBands (Bands &bands)
 
void mergeBands (Bands &bands)
 
std::string toString () const
 
std::string strBands ()
 
bool hasError () const
 
bool hasMessage () const
 
std::string getMessage ()
 
std::string getMessageNoClear () const
 

Public Attributes

TrafficState ownship
 

Protected Attributes

ErrorLog error
 

Private Member Functions

void init (double D, const std::string &dunit, double H, const std::string &hunit, double T, const std::string &tunit, double max_gs, const std::string &gsunit, double max_vs, const std::string &vsunit)
 
void needComputeBands ()
 
void recompute ()
 
void resetRegions ()
 
void trackCompute ()
 
void groundCompute ()
 
void verticalCompute ()
 
Interval track (int i, double unit)
 
Interval groundSpeed (int i, double unit)
 
Interval verticalSpeed (int i, double unit)
 
int find_first_band (bool eq, BandsRegion::Region br, double tolerance, const std::vector< Interval > &arraylist, const std::vector< BandsRegion::Region > &regions, double lb, double ub)
 
int firstTrackBand (bool eq, BandsRegion::Region br, double trk)
 
int firstGroundSpeedBand (bool eq, BandsRegion::Region br, double gs)
 
int firstVerticalSpeedBand (bool eq, BandsRegion::Region br, double vs)
 
void toIntervalArray_fromIntervalSet (std::vector< Interval > &intervalarray, std::vector< BandsRegion::Region > &regions, const IntervalSet &intervalset, double lowBound, double upBound)
 

Static Private Member Functions

static int order (const std::vector< Interval > &arr, const Interval &n)
 
static int find_first_explicit_band (bool eq, BandsRegion::Region br, double tolerance, const std::vector< Interval > &arraylist, const std::vector< BandsRegion::Region > &regions)
 
static int find_first_implicit_none (double tolerance, const std::vector< Interval > &arraylist, double lb, double ub)
 
static void toIntervalSet_fromIntervalArray (IntervalSet &intervalset, const std::vector< Interval > &intervalarray, const std::vector< BandsRegion::Region > &regions, BandsRegion::Region br)
 
static void toArrays (std::vector< Interval > &intervalarray, std::vector< BandsRegion::Region > &regions, const IntervalSet &red, const IntervalSet &green)
 
static void toIntervalArray_fromIntervalSet (std::vector< Interval > &intervalarray, std::vector< BandsRegion::Region > &regions, const IntervalSet &intervalset)
 

Private Attributes

BandsCore red
 
int traffic
 
std::vector< IntervaltrackArray
 
std::vector< BandsRegion::Region > trackRegionArray
 
std::vector< IntervalgroundArray
 
std::vector< BandsRegion::Region > groundRegionArray
 
std::vector< IntervalverticalArray
 
std::vector< BandsRegion::Region > verticalRegionArray
 
bool conflictBands
 
bool doTrk
 
bool doGs
 
bool doVs
 
bool computeTrk
 
bool computeGs
 
bool computeVs
 

Detailed Description

Objects of class "Bands" compute the conflict prevention bands using linear state-based preditions of ownship and (multiple) traffic aircraft positions. The bands consist of ranges of guidance maneuvers: track angles, ground speeds, and vertical speeds.

An assumption of the bands information is that the traffic aircraft do not maneuver. If the ownship immediately executes a NONE guidance maneuver, then the new path is conflict free (within a lookahead time of the parameter). If the ownship immediately executes a NEAR guidance maneuver and no traffic aircraft maneuvers, then there will be a loss of separation within the lookahead time.

If bands are set to conflict bands only, e.g, setConflictBands, only NEAR bands are computed. In this case, guidance maneuvers for avoiding conflicts, which are represented by NONE bands, are not computed. Furthermore, bands can be set to certain types of maneuvers by using the methods: setTrackBands, setGroundSpeedBands, and setVerticalSpeedBands. These methods have to be used before adding any traffic information.

Note that in the case of geodetic coordinates, bands performs an internal projection of the coordinates and velocities into the Euclidean frame (see Util/Projection). An error will be logged if the distance between traffic and ownship exceeds Util.Projection.projectionMaxRange().

Disclaimers: Only parts of these algorithms have been formally verified. We plan to advance the formal verifcation, but it is currently not complete. Even with a 'complete' verification, there will still be certain assumptions. For instance, the formal proofs use real numbers while these implementations use floating point numbers, so numerical differences could result. In addition, the geodesic computations include certain inaccuracies, especially near the poles.

The basic usages is

Bands b(..with configuration parameters..);
b.setOwnship(position of ownship, velocity of ownship);
b.addTraffic(position of (one) traffic aircraft, velocity of traffic);
b.addTraffic(position of (another) traffic aircraft, velocity of traffic);
... add other traffic aircraft ...

for (int i = 0; i < b.trackLength(); i++ ) {  
   intrval = b.track(i);
   lower_ang = intrval.low;
   upper_ang = intrval.up;
   regionType = b.trackRegion(i);
   ..do something with this information..
} 

...similar for ground speed and vertical speed...

<p<blockquote>

The variable b may be reused for a different set of aircraft, but it has to be cleared first, i.e.,

b.clear();
b.setOwnship(...);
b.addTraffic(...);
... etc ...

When any "parameter" to this class is set (separation distance, lookahead time, positions in latitude/longitude, etc.), all previous bands information is cleared; therefore, all traffic aircraft must be added after the parameters are configured. For more complete example usage see the file Batch.java

Constructor & Destructor Documentation

◆ Bands() [1/2]

larcfm::Bands::Bands ( double  D,
const std::string &  dunit,
double  H,
const std::string &  hunit,
double  T,
const std::string &  tunit,
double  max_gs,
const std::string &  gsunit,
double  max_vs,
const std::string &  vsunit 
)

Construct a Bands object with the given configuration parameters. The bands always begin as 'no conflict' bands: track bands from 0 to 2pi, ground speed bands from 0 to max_gs, and vertical speed bands from -max_vs to max_vs. Both the positions and velocities of the aircraft are assumed to be in Euclidean coordinates (see setLatLon() and setTrackVelocity() to change this behavior).

Parameters
Dthe minimum horizontal separation distance [nmi]
Hthe minimum vertical separation distance [feet]
Tthe near-term lookahead time [s]
max_gsthe maximum ground speed that is output by Bands, the minimum is 0. [knots]
max_vsthe range of vertical speeds is -max_vs to max_vs [feet/min]

◆ Bands() [2/2]

larcfm::Bands::Bands ( )

Construct a Bands object with default values for configuration parameters. These default values include: 5 nmi horizontal separation, 1000 ft vertical separation, 3 minutes for the lookahead time, 1000 knots max ground speed, 5000 fpm max vertical speed. The bands always begin as 'no conflict' bands: track bands from 0 to 2pi, ground speed bands from 0 to max_gs, and vertical speed bands from -max_vs to max_vs. Both the positions and velocities of the aircraft are assumed to be in Euclidean coordinates (see setLatLon() and setTrackVelocity() to change this behavior).

Member Function Documentation

◆ addTraffic()

void larcfm::Bands::addTraffic ( const std::string &  id,
const Position si,
const Velocity vi 
)
virtual

Add a traffic aircraft to this set of the conflict prevention bands. No traffic aircraft can be added until the ownship is set (see setOwnship()). The coordinate frame of the traffic position must be the same as that of the object.

Parameters
siposition of the traffic
vivelocity of the traffic

Implements larcfm::GenericStateBands.

◆ clear()

void larcfm::Bands::clear ( )
virtual

Clear all bands information.

Implements larcfm::GenericBands.

◆ getDistance()

double larcfm::Bands::getDistance ( const std::string &  uni) const
virtual

Returns the minimum horizontal separation distance [nmi]

Implements larcfm::GenericDHStateBands.

◆ getHeight()

double larcfm::Bands::getHeight ( const std::string &  unit) const
virtual

Returns the minimum vertical separation distance. [feet]

Implements larcfm::GenericDHStateBands.

◆ getLookaheadTime()

double larcfm::Bands::getLookaheadTime ( const std::string &  unit) const
virtual

Returns the time of the lookahead time in specified units

Implements larcfm::GenericBands.

◆ getMaxGroundSpeed()

double larcfm::Bands::getMaxGroundSpeed ( const std::string &  unit) const
virtual

Returns the maximum ground speed that is output by Bands in knots.

Implements larcfm::GenericBands.

◆ getMaxVerticalSpeed()

double larcfm::Bands::getMaxVerticalSpeed ( const std::string &  unit) const
virtual

Returns the range of vertical speeds output by Bands [fpm]. Any existing bands information is cleared.

Implements larcfm::GenericBands.

◆ getMessage()

std::string larcfm::Bands::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::Bands::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.

◆ getTime()

double larcfm::Bands::getTime ( ) const

Returns the time of the lookahead time in seconds

◆ groundCompute()

void larcfm::Bands::groundCompute ( )
private

Provide a copy of the ground speed bands [knots]. The range of ground speed bands is from 0 to max_gs.

◆ groundSpeed()

Interval larcfm::Bands::groundSpeed ( int  i,
const std::string &  unit 
)
virtual

Return i-th interval of the ground speed bands in the given unit.

Implements larcfm::GenericBands.

◆ groundSpeedLength()

int larcfm::Bands::groundSpeedLength ( )
virtual

Return the number of bands of ground speeds

Implements larcfm::GenericBands.

◆ groundSpeedRegion()

BandsRegion::Region larcfm::Bands::groundSpeedRegion ( int  i)
virtual

Return the region type of the i-th ground speed band. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ hasError()

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

Does this object have an error?

Returns
true if there is an error.

Implements larcfm::ErrorReporter.

◆ hasMessage()

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

Does this object have an error or a warning?

Returns
true if there is an error or warning.

Implements larcfm::ErrorReporter.

◆ isLatLon()

bool larcfm::Bands::isLatLon ( ) const
virtual

Returns whether the aircraft positions are specified in latitude/longitude or Euclidean coordinates. If the ownship has not been set, then this value is undefined.

Implements larcfm::GenericBands.

◆ regionOfGroundSpeed()

BandsRegion::Region larcfm::Bands::regionOfGroundSpeed ( double  gs,
const std::string &  unit 
)
virtual

Return the region type of the given ground speed in knots, out of range speeds are returned as NEAR. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ regionOfTrack()

BandsRegion::Region larcfm::Bands::regionOfTrack ( double  trk,
const std::string &  unit 
)
virtual

Return the region type of the given track angle [degrees, clockwise from true north]. An angle outside of a 0..360 degree range returns NEAR. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ regionOfVerticalSpeed()

BandsRegion::Region larcfm::Bands::regionOfVerticalSpeed ( double  vs,
const std::string &  unit 
)
virtual

Return the region type of the given vertical speed [feet/min], out of range speeds are returned as red. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ setDistance()

void larcfm::Bands::setDistance ( double  d,
const std::string &  unit 
)
virtual

Sets the minimum horizontal separation distance [nmi]. When this parameter is set any existing band information is cleared.

Implements larcfm::GenericDHStateBands.

◆ setHeight()

void larcfm::Bands::setHeight ( double  h,
const std::string &  unit 
)
virtual

Sets the minimum vertical separation distance [feet]. When this parameter is set any existing band information is cleared.

Implements larcfm::GenericDHStateBands.

◆ setLookaheadTime()

void larcfm::Bands::setLookaheadTime ( double  t,
const std::string &  unit 
)
virtual

Set the lookahead time [s]. When this parameter is set any existing band information is cleared.

Implements larcfm::GenericBands.

◆ setMaxGroundSpeed()

void larcfm::Bands::setMaxGroundSpeed ( double  gs,
const std::string &  unit 
)
virtual

Sets the maximum ground speed that is output by Bands, the minimum is 0 [knots]. When this parameter is set any existing band information is cleared.

Implements larcfm::GenericBands.

◆ setMaxVerticalSpeed()

void larcfm::Bands::setMaxVerticalSpeed ( double  vs,
const std::string &  unit 
)
virtual

Sets the range of vertical speeds output by Bands, -max_vs to max_vs [fpm]. When this parameter is set any existing band information is cleared.

Implements larcfm::GenericBands.

◆ setOwnship()

void larcfm::Bands::setOwnship ( const std::string &  id,
const Position s,
const Velocity v 
)
virtual

Specify the ownship's position and velocity. Once the ownship is set, any existing 'band' information is cleared. This also sets the coordinate frame for this object.

Parameters
sownship position
vownship velocity

Implements larcfm::GenericStateBands.

◆ solidGroundSpeedBand()

bool larcfm::Bands::solidGroundSpeedBand ( BandsRegion::Region  br)

Return true if ground speed bands consist of a region band of the given color

◆ solidTrackBand()

bool larcfm::Bands::solidTrackBand ( BandsRegion::Region  br)

Return true if track bands consist of a solid region of the given color

◆ solidVerticalSpeedBand()

bool larcfm::Bands::solidVerticalSpeedBand ( BandsRegion::Region  br)

Return true if vertical speed bands consist of a region band of the given color

◆ toString()

std::string larcfm::Bands::toString ( ) const
virtual

Return a string representing this object.

Implements larcfm::GenericBands.

◆ track()

Interval larcfm::Bands::track ( int  i,
const std::string &  unit 
)
virtual

Return the i-th interval of the track bands in the given unit.

Implements larcfm::GenericBands.

◆ trackCompute()

void larcfm::Bands::trackCompute ( )
private

Provide a copy of the track angle bands. The angles are in 'compass' angles: 0 to 360 degrees, counter-clockwise from true north.

◆ trackLength()

int larcfm::Bands::trackLength ( )
virtual

Return the number of bands of track angles

Implements larcfm::GenericBands.

◆ trackRegion()

BandsRegion::Region larcfm::Bands::trackRegion ( int  i)
virtual

Return the region type of the i-th track band. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.

◆ verticalCompute()

void larcfm::Bands::verticalCompute ( )
private

Provide a copy of the vertical speed bands [feet/min]. The range of vertical speeds is -max_vs to max_vs.

◆ verticalSpeed()

Interval larcfm::Bands::verticalSpeed ( int  i,
const std::string &  unit 
)
virtual

Return the i-th interval of the vertical speed band in the given unit.

Implements larcfm::GenericBands.

◆ verticalSpeedLength()

int larcfm::Bands::verticalSpeedLength ( )
virtual

Return the number of bands of vertical speeds

Implements larcfm::GenericBands.

◆ verticalSpeedRegion()

BandsRegion::Region larcfm::Bands::verticalSpeedRegion ( int  i)
virtual

Return the region type of the i-th vertical speed band. If a single time version of bands is used, then [NEAR|NONE] is returned. If a version of bands with two times is used, then [NEAR|MID|NONE] is returned.

Implements larcfm::GenericBands.


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