Skip to content

Commit

Permalink
Fixed bug in Daidalus class, where numberOfAircraft was used instead …
Browse files Browse the repository at this point in the history
…of lastTrafficIndex
  • Loading branch information
Cesar Munoz committed Oct 6, 2020
1 parent 1087cfb commit 08650e3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions C++/RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Rights Reserved.

Release DAIDALUS-v2.0.1:
------------------
* October 5, 2020
- Fixed bug in Daidalus class, where numberOfAircraft was used instead
of lastTrafficIndex.

* September 29, 2020
- Added documentation (automatically generated from code), updated README.

Expand Down
12 changes: 6 additions & 6 deletions C++/src/Daidalus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void Daidalus::setAlerter(int ac_idx, const std::string& alerter) {
* at ac_idx.
*/
int Daidalus::alerterIndexBasedOnAlertingLogic(int ac_idx) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
return core_.alerter_index_of(getAircraftStateAt(ac_idx));
}
return 0;
Expand Down Expand Up @@ -527,7 +527,7 @@ int Daidalus::mostSevereAlertLevel(int ac_idx) {
* s_EN_std: East/North position standard deviation in internal units
*/
void Daidalus::setHorizontalPositionUncertainty(int ac_idx, double s_EW_std, double s_NS_std, double s_EN_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setHorizontalPositionUncertainty(s_EW_std,s_NS_std,s_EN_std);
} else {
Expand All @@ -552,7 +552,7 @@ void Daidalus::setHorizontalPositionUncertainty(int ac_idx, double s_EW_std, dou
* sz_std : Vertical position standard deviation in internal units
*/
void Daidalus::setVerticalPositionUncertainty(int ac_idx, double sz_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setVerticalPositionUncertainty(sz_std);
} else {
Expand All @@ -577,7 +577,7 @@ void Daidalus::setVerticalPositionUncertainty(int ac_idx, double sz_std, const s
* v_EN_std: East/North position standard deviation in internal units
*/
void Daidalus::setHorizontalVelocityUncertainty(int ac_idx, double v_EW_std, double v_NS_std, double v_EN_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setHorizontalVelocityUncertainty(v_EW_std,v_NS_std,v_EN_std);
} else {
Expand All @@ -602,7 +602,7 @@ void Daidalus::setHorizontalVelocityUncertainty(int ac_idx, double v_EW_std, dou
* vz_std : Vertical speed standard deviation in internal units
*/
void Daidalus::setVerticalSpeedUncertainty(int ac_idx, double vz_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setVerticalSpeedUncertainty(vz_std);
} else {
Expand All @@ -624,7 +624,7 @@ void Daidalus::setVerticalSpeedUncertainty(int ac_idx, double vz_std, const std:
* Reset all uncertainties of aircraft at index ac_idx
*/
void Daidalus::resetUncertainty(int ac_idx) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.resetUncertainty();
} else {
Expand Down
4 changes: 4 additions & 0 deletions Java/RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Rights Reserved.

Release DAIDALUS-v2.0.1:
------------------
* October 5, 2020
- Fixed bug in Daidalus class, where numberOfAircraft was used instead
of lastTrafficIndex.

* September 29, 2020
- Added documentation (automatically generated from code), updated README.

Expand Down
12 changes: 6 additions & 6 deletions Java/src/gov/nasa/larcfm/ACCoRD/Daidalus.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public void setAlerter(int ac_idx, String alerter) {
* at ac_idx.
*/
public int alerterIndexBasedOnAlertingLogic(int ac_idx) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
return core_.alerter_index_of(getAircraftStateAt(ac_idx));
}
return 0;
Expand Down Expand Up @@ -579,7 +579,7 @@ public int mostSevereAlertLevel(int ac_idx) {
* s_EN_std: East/North position standard deviation in internal units
*/
public void setHorizontalPositionUncertainty(int ac_idx, double s_EW_std, double s_NS_std, double s_EN_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setHorizontalPositionUncertainty(s_EW_std,s_NS_std,s_EN_std);
} else {
Expand All @@ -604,7 +604,7 @@ public void setHorizontalPositionUncertainty(int ac_idx, double s_EW_std, double
* sz_std : Vertical position standard deviation in internal units
*/
public void setVerticalPositionUncertainty(int ac_idx, double sz_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setVerticalPositionUncertainty(sz_std);
} else {
Expand All @@ -629,7 +629,7 @@ public void setVerticalPositionUncertainty(int ac_idx, double sz_std, String u)
* v_EN_std: East/North position standard deviation in internal units
*/
public void setHorizontalVelocityUncertainty(int ac_idx, double v_EW_std, double v_NS_std, double v_EN_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setHorizontalVelocityUncertainty(v_EW_std,v_NS_std,v_EN_std);
} else {
Expand All @@ -654,7 +654,7 @@ public void setHorizontalVelocityUncertainty(int ac_idx, double v_EW_std, double
* vz_std : Vertical speed standard deviation in internal units
*/
public void setVerticalSpeedUncertainty(int ac_idx, double vz_std) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.setVerticalSpeedUncertainty(vz_std);
} else {
Expand All @@ -676,7 +676,7 @@ public void setVerticalSpeedUncertainty(int ac_idx, double vz_std, String u) {
* Reset all uncertainties of aircraft at index ac_idx
*/
public void resetUncertainty(int ac_idx) {
if (0 <= ac_idx && ac_idx <= numberOfAircraft()) {
if (0 <= ac_idx && ac_idx <= lastTrafficIndex()) {
if (ac_idx == 0) {
core_.ownship.resetUncertainty();
} else {
Expand Down

0 comments on commit 08650e3

Please sign in to comment.