diff --git a/CMakeLists.txt b/CMakeLists.txt index ab4a2d7..42ae41a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.26...4.1.2) -project(im_sample_algorithm VERSION 5.2.0.0) # the nano value is a boolean. 1 == SNAPSHOT, 0 == release +cmake_minimum_required(VERSION 3.26...4.2) +project(im_sample_algorithm VERSION 5.3.0.0) # the nano value is a boolean. 1 == SNAPSHOT, 0 == release set (CMAKE_CXX_STANDARD 20) @@ -32,19 +32,12 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -Wno-unused-functi CPMAddPackage( NAME fmacm GITHUB_REPOSITORY mitre/FMACM - GIT_TAG v5.2.0 + GIT_TAG v5.3.0 OPTIONS "BUILD_SHARED_LIBS FALSE" "BUILD_TESTING ${BUILD_TESTING}" ) -# CPMAddPackage( -# NAME unitslib -# GIT_REPOSITORY https://mustache.mitre.org/scm/aaes/cpp-uom.git # FIXME use external repo when available -# GIT_TAG 07445f7ec0f98b55cdd6e6188083145a293415a7 -# DOWNLOAD_ONLY TRUE -# ) - CPMAddPackage( NAME log4cplus GITHUB_REPOSITORY log4cplus/log4cplus diff --git a/IntervalManagement/AchieveObserver.cpp b/IntervalManagement/AchieveObserver.cpp index 78aa1ed..453ad6a 100644 --- a/IntervalManagement/AchieveObserver.cpp +++ b/IntervalManagement/AchieveObserver.cpp @@ -14,33 +14,36 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/AchieveObserver.h" #include +#include using namespace std; using namespace interval_management::open_source; -AchieveObserver::AchieveObserver() : m_iteration(-1), m_id(-1) { - m_time = Units::SecondsTime(-99999.0); - m_targ_ttg_to_ach = Units::SecondsTime(-99999.0); - m_own_ttg_to_ach = Units::SecondsTime(-99999.0); - m_curr_dist = Units::MetersLength(-99999.0); - m_ref_dist = Units::MetersLength(-99999.0); -} +AchieveObserver::AchieveObserver() + : m_iteration(-1), + m_id(-1), + m_time(Units::SecondsTime(-99999.0)), + m_targ_ttg_to_ach(Units::SecondsTime(-99999.0)), + m_own_ttg_to_ach(Units::SecondsTime(-99999.0)), + m_curr_dist(Units::MetersLength(-99999.0)), + m_ref_dist(Units::MetersLength(-99999.0)) {} AchieveObserver::AchieveObserver(const int iter, const int aircraft_id, const double tm, const double target_ttg_to_ach, const double own_ttg_to_ach, const double curr_distance, const double reference_distance) - : m_iteration(iter), m_id(aircraft_id), m_time(tm) { - m_targ_ttg_to_ach = Units::SecondsTime(target_ttg_to_ach); - m_own_ttg_to_ach = Units::SecondsTime(own_ttg_to_ach); - m_curr_dist = Units::MetersLength(curr_distance); - m_ref_dist = Units::MetersLength(reference_distance); -} + : m_iteration(iter), + m_id(aircraft_id), + m_time(tm), + m_targ_ttg_to_ach(Units::SecondsTime(target_ttg_to_ach)), + m_own_ttg_to_ach(Units::SecondsTime(own_ttg_to_ach)), + m_curr_dist(Units::MetersLength(curr_distance)), + m_ref_dist(Units::MetersLength(reference_distance)) {} AchieveObserver::~AchieveObserver() { // Destructor. @@ -59,15 +62,13 @@ string AchieveObserver::ToString() { string str; - char *txt = new char[301]; + char txt[301]; - snprintf(txt, 301, "%d,%d,%lf,%lf,%lf,%lf,%lf", m_iteration, m_id, Units::SecondsTime(m_time).value(), + snprintf(txt, sizeof(txt), "%d,%d,%lf,%lf,%lf,%lf,%lf", m_iteration, m_id, Units::SecondsTime(m_time).value(), Units::SecondsTime(m_targ_ttg_to_ach).value(), Units::SecondsTime(m_own_ttg_to_ach).value(), Units::MetersLength(m_curr_dist).value(), Units::MetersLength(m_ref_dist).value()); str = txt; - delete[] txt; - return str; } diff --git a/IntervalManagement/AchievePointCalcs.cpp b/IntervalManagement/AchievePointCalcs.cpp index 4375fb8..e664858 100644 --- a/IntervalManagement/AchievePointCalcs.cpp +++ b/IntervalManagement/AchievePointCalcs.cpp @@ -14,15 +14,18 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/AchievePointCalcs.h" -#include "utility/CustomUnits.h" -#include "public/CustomMath.h" -#include #include +#include +#include +#include + +#include "public/CustomMath.h" +#include "utility/CustomUnits.h" using namespace std; using namespace aaesim::open_source; @@ -89,7 +92,6 @@ AchievePointCalcs::AchievePointCalcs(const string &waypoint, const AircraftInten } void AchievePointCalcs::Clear() { - m_waypoint_name = ""; m_waypoint_is_set = false; @@ -110,7 +112,6 @@ void AchievePointCalcs::ComputeDefaultTRP(const AchievePointCalcs &ownship_calcs const vector &target_horizontal_path, Waypoint &traffic_reference_point, Units::Length &waypoint_x, Units::Length &waypoint_y, size_t &waypoint_index_in_target_intent) { - // Get ABP index from ownship int ix0 = ownship_intent.GetWaypointIndexByName(ownship_calcs.GetWaypointName()); if (ix0 < 0) { @@ -317,7 +318,7 @@ void AchievePointCalcs::ComputeDefaultTRP(const AchievePointCalcs &ownship_calcs throw logic_error("Failed to calculate circular arc intersection."); } } // end if turn - } // end if not first + } // end if not first x0 = x1; y0 = y1; d0 = d1; @@ -390,9 +391,7 @@ void AchievePointCalcs::ComputeDefaultTRP(const AchievePointCalcs &ownship_calcs } void AchievePointCalcs::ComputePositions(const AircraftIntent &intent) { - if (this->HasWaypoint()) { - int ix = intent.GetWaypointIndexByName(m_waypoint_name); if (ix > -1) { @@ -410,7 +409,6 @@ void AchievePointCalcs::ComputePositions(const AircraftIntent &intent) { } void AchievePointCalcs::ComputeAlongPathDistanceFromWaypointToEnd() { - if (this->HasWaypoint()) { Units::Length distance_from_waypoint_to_end; m_distance_calculator.CalculateAlongPathDistanceFromPosition(this->m_waypoint_x, this->m_waypoint_y, @@ -422,7 +420,6 @@ void AchievePointCalcs::ComputeAlongPathDistanceFromWaypointToEnd() { } void AchievePointCalcs::ComputeEndValues(const VerticalPath &vertical_path) { - if (this->HasWaypoint()) { // compute achieve by distance ComputeAlongPathDistanceFromWaypointToEnd(); @@ -433,7 +430,6 @@ void AchievePointCalcs::ComputeEndValues(const VerticalPath &vertical_path) { m_time_to_go_to_waypoint = Units::ZERO_TIME; } else { - // compute time to go from achieve point to the end. // get index at achieve by distance from end of route (beginning of our search). @@ -449,7 +445,6 @@ void AchievePointCalcs::ComputeEndValues(const VerticalPath &vertical_path) { // Compute the time to go from the achieve by point to the end. if (ix < firsttimeix) { - // ttg:time to go at points 1 and 0. // dtg:distance to go at points 1 and 0. const double ttg0 = vertical_path.time_to_go_sec[ix]; diff --git a/IntervalManagement/AircraftState.cpp b/IntervalManagement/AircraftState.cpp index 532a9e0..e3c7513 100644 --- a/IntervalManagement/AircraftState.cpp +++ b/IntervalManagement/AircraftState.cpp @@ -14,13 +14,14 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/AircraftState.h" + +#include "imalgs/IMUtils.h" #include "public/CustomMath.h" #include "utility/CustomUnits.h" -#include "imalgs/IMUtils.h" log4cplus::Logger interval_management::open_source::AircraftState::m_logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("AircraftState")); @@ -55,7 +56,6 @@ const Units::Speed interval_management::open_source::AircraftState::GetGroundSpe interval_management::open_source::AircraftState &interval_management::open_source::AircraftState::Interpolate( const AircraftState &a, const AircraftState &b, const Units::SecondsTime time) { - const double dt = Units::SecondsTime(b.GetTimeStamp() - a.GetTimeStamp()).value(); double weight_a, weight_b; if (a.GetTimeStamp() == b.GetTimeStamp()) { @@ -107,7 +107,6 @@ interval_management::open_source::AircraftState &interval_management::open_sourc const Units::Speed &sensed_wind_north, const Units::Speed &sensed_wind_parallel, const Units::Speed &sensed_wind_perpendicular, const Units::Temperature &sensed_temperature, const Units::Angle &psi_enu) { - this->m_id = id; this->m_time = time; this->m_x = Units::FeetLength(enu_position.x).value(); @@ -124,4 +123,4 @@ interval_management::open_source::AircraftState &interval_management::open_sourc this->m_sensed_temperature = sensed_temperature; this->m_psi_enu = psi_enu; return *this; -} \ No newline at end of file +} diff --git a/IntervalManagement/ClosestPointMetric.cpp b/IntervalManagement/ClosestPointMetric.cpp index c8ce503..b315196 100644 --- a/IntervalManagement/ClosestPointMetric.cpp +++ b/IntervalManagement/ClosestPointMetric.cpp @@ -14,10 +14,11 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/ClosestPointMetric.h" + #include "public/AircraftCalculations.h" using namespace interval_management::open_source; @@ -25,7 +26,6 @@ using namespace interval_management::open_source; ClosestPointMetric::ClosestPointMetric() = default; void ClosestPointMetric::update(double imx, double imy, double targx, double targy) { - // Computes the distance between im and target aircraft based on the input // positions and replaces the minimum distance if the new distance closer. // Distance is in nmi. @@ -42,7 +42,6 @@ void ClosestPointMetric::update(double imx, double imy, double targx, double tar } Units::Length ClosestPointMetric::getMinDist() { - // Gets minimum distance. // // returns minimum distance. diff --git a/IntervalManagement/CrossTrackObserver.cpp b/IntervalManagement/CrossTrackObserver.cpp index f2d4a28..82aa0eb 100644 --- a/IntervalManagement/CrossTrackObserver.cpp +++ b/IntervalManagement/CrossTrackObserver.cpp @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/CrossTrackObserver.h" diff --git a/IntervalManagement/FIMAlgorithmAdapter.cpp b/IntervalManagement/FIMAlgorithmAdapter.cpp index 6c47c48..fc8e9f5 100644 --- a/IntervalManagement/FIMAlgorithmAdapter.cpp +++ b/IntervalManagement/FIMAlgorithmAdapter.cpp @@ -14,17 +14,20 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/FIMAlgorithmAdapter.h" -#include +#include +#include +#include -#include "imalgs/IMUtils.h" #include "imalgs/FIMAlgorithmInitializer.h" -#include "public/SingleTangentPlaneSequence.h" +#include "imalgs/IMUtils.h" +#include "nlohmann/json.hpp" #include "public/CoreUtils.h" +#include "public/SingleTangentPlaneSequence.h" using namespace interval_management::open_source; using json = nlohmann::json; @@ -65,7 +68,6 @@ aaesim::open_source::Guidance interval_management::open_source::FIMAlgorithmAdap const aaesim::open_source::SimulationTime &simtime, const aaesim::open_source::Guidance ¤t_guidance, const aaesim::open_source::DynamicsState &dynamics_state, const aaesim::open_source::AircraftState &own_truth_state) { - aaesim::open_source::Guidance im_algorithm_guidance = current_guidance; im_algorithm_guidance.SetValid(false); if (current_guidance.m_active_guidance_phase != aaesim::open_source::GuidanceFlightPhase::CRUISE_DESCENT) diff --git a/IntervalManagement/FIMAlgorithmDataWriter.cpp b/IntervalManagement/FIMAlgorithmDataWriter.cpp index b62fbe8..f020a5c 100644 --- a/IntervalManagement/FIMAlgorithmDataWriter.cpp +++ b/IntervalManagement/FIMAlgorithmDataWriter.cpp @@ -14,11 +14,14 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/FIMAlgorithmDataWriter.h" +#include +#include + #include "imalgs/FIMAlgorithmAdapter.h" #include "imalgs/IMKinematicAchieve.h" #include "public/AircraftSpeed.h" @@ -129,9 +132,8 @@ void interval_management::open_source::FIMAlgorithmDataWriter::Finish() { } void interval_management::open_source::FIMAlgorithmDataWriter::Gather( - const int iteration_number, const aaesim::open_source::SimulationTime &time, std::string aircraft_id, + const int iteration_number, const aaesim::open_source::SimulationTime &time, const std::string &aircraft_id, std::shared_ptr application) { - const bool is_fim_application = CoreUtils::InstanceOf(application.get()); if (!is_fim_application) { diff --git a/IntervalManagement/FIMAlgorithmInitializer.cpp b/IntervalManagement/FIMAlgorithmInitializer.cpp index f1ad80d..2929fbc 100644 --- a/IntervalManagement/FIMAlgorithmInitializer.cpp +++ b/IntervalManagement/FIMAlgorithmInitializer.cpp @@ -14,11 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/FIMAlgorithmInitializer.h" +#include + using namespace interval_management::open_source; interval_management::open_source::FIMAlgorithmInitializer::FIMAlgorithmInitializer( @@ -94,14 +96,14 @@ const interval_management::open_source::FIMAlgorithmInitializer interval_management::open_source::FIMAlgorithmInitializer::Builder * interval_management::open_source::FIMAlgorithmInitializer::Builder::AddOwnshipPerformanceParameters( - aaesim::open_source::OwnshipPerformanceParameters performance_parameters) { + const aaesim::open_source::OwnshipPerformanceParameters &performance_parameters) { m_performance_parameters = performance_parameters; return this; } interval_management::open_source::FIMAlgorithmInitializer::Builder * interval_management::open_source::FIMAlgorithmInitializer::Builder::AddOwnshipFmsPredictionParameters( - aaesim::open_source::OwnshipFmsPredictionParameters prediction_parameters) { + const aaesim::open_source::OwnshipFmsPredictionParameters &prediction_parameters) { m_prediction_parameters = prediction_parameters; return this; } diff --git a/IntervalManagement/FIMConfiguration.cpp b/IntervalManagement/FIMConfiguration.cpp index 71b14b6..454feff 100644 --- a/IntervalManagement/FIMConfiguration.cpp +++ b/IntervalManagement/FIMConfiguration.cpp @@ -14,11 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/FIMConfiguration.h" +#include + using namespace interval_management::open_source; log4cplus::Logger FIMConfiguration::m_logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("FIMConfiguration")); @@ -62,4 +64,4 @@ bool FIMConfiguration::load(DecodedStream *input) { } return m_loaded; -} \ No newline at end of file +} diff --git a/IntervalManagement/FIMSpeedLimiter.cpp b/IntervalManagement/FIMSpeedLimiter.cpp index 03995b2..3d328ed 100644 --- a/IntervalManagement/FIMSpeedLimiter.cpp +++ b/IntervalManagement/FIMSpeedLimiter.cpp @@ -14,12 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/FIMSpeedLimiter.h" -#include "public/CustomMath.h" + +#include + #include "imalgs/IMUtils.h" +#include "public/CustomMath.h" using namespace interval_management::open_source; @@ -31,16 +34,19 @@ FIMSpeedLimiter::FIMSpeedLimiter(bool use_speed_quantization, bool use_speed_lim aaesim::open_source::bada_utils::FlapSpeeds flap_speeds, aaesim::open_source::bada_utils::FlightEnvelope flight_envelope, aaesim::open_source::bada_utils::Mass mass_data, - aaesim::open_source::bada_utils::Aerodynamics aerodynamics, + const aaesim::open_source::bada_utils::Aerodynamics &aerodynamics, const FIMSpeedQuantizer &speed_quantizer) - : m_rf_leg_limits(), m_active_filter_flag(0L), m_low_speed_coef(0), m_high_speed_coef(0) { - m_limit_flag = use_speed_limiting; - m_quantize_flag = use_speed_quantization; - m_fim_quantizer = speed_quantizer; - m_flap_speeds = flap_speeds; - m_aircraft_flight_envelope = flight_envelope; - m_aerodynamics = aerodynamics; - m_mass_data = mass_data; + : m_rf_leg_limits(), + m_active_filter_flag(0L), + m_limit_flag(use_speed_limiting), + m_quantize_flag(use_speed_quantization), + m_low_speed_coef(0), + m_high_speed_coef(0), + m_fim_quantizer(speed_quantizer), + m_flap_speeds(flap_speeds), + m_aircraft_flight_envelope(flight_envelope), + m_mass_data(mass_data), + m_aerodynamics(aerodynamics) { SetMaxSpeedDeviationPercentage(DEFAULT_SPEED_DEVIATION_PERCENTAGE); } @@ -58,7 +64,6 @@ Units::Speed FIMSpeedLimiter::LimitSpeedCommand( const Units::Speed nominal_reference_speed, const Units::Length distance_to_go_to_abp, const Units::Length distance_to_end_of_route, const Units::Length ownship_altitude, const aaesim::open_source::bada_utils::FlapConfiguration flap_configuration) { - Units::Speed limitedspeed = current_ias_speed_command; Units::Speed llim = Units::ZERO_SPEED; Units::Speed hlim = Units::ZERO_SPEED; @@ -180,7 +185,6 @@ BoundedValue FIMSpeedLimiter::LimitMachCommand( const BoundedValue ¤t_mach_command, const BoundedValue &nominal_mach, const Units::Mass ¤t_mass, const Units::Length ¤t_ownship_altitude, const aaesim::open_source::WeatherPrediction &weather_prediction) { - BoundedValue limited_mach = current_mach_command; BoundedValue maximum_mach(m_aircraft_flight_envelope.M_mo); m_active_filter_flag = 0L; @@ -195,7 +199,7 @@ BoundedValue FIMSpeedLimiter::LimitMachCommand( const Units::Speed tasmin = weather_prediction.getAtmosphere()->CAS2TAS(casmin, current_ownship_altitude); const BoundedValue minimum_mach = BoundedValue( Units::MetersPerSecondSpeed(tasmin).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * weather_prediction.getAtmosphere()->GetTemperature(current_ownship_altitude).value())); double mach(nominal_mach); @@ -242,4 +246,4 @@ const Units::Speed FIMSpeedLimiter::GetRFLegSpeedLimit(const Units::Length dtg_t void FIMSpeedLimiter::AddRfLegSpeedLimit(const Units::Length distance_to_go, const Units::Speed upper_ias_limit) { RfLegLimit rf_leg_limit(distance_to_go, upper_ias_limit); m_rf_leg_limits.push_back(rf_leg_limit); -} \ No newline at end of file +} diff --git a/IntervalManagement/FIMSpeedQuantizer.cpp b/IntervalManagement/FIMSpeedQuantizer.cpp index a8fc5e2..c4283a4 100644 --- a/IntervalManagement/FIMSpeedQuantizer.cpp +++ b/IntervalManagement/FIMSpeedQuantizer.cpp @@ -14,13 +14,14 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/FIMSpeedQuantizer.h" -#include "utility/CustomUnits.h" -#include "public/CustomMath.h" + #include "imalgs/IMUtils.h" +#include "public/CustomMath.h" +#include "utility/CustomUnits.h" using namespace interval_management::open_source; @@ -34,18 +35,17 @@ FIMSpeedQuantizer::FIMSpeedQuantizer() m_first_to_middle_quantize_transition_distance(IMUtils::DIST_QUANTIZE_2_DEFAULT), m_speed_quantize_final_phase(IMUtils::SPEED_QUANTIZE_1_DEFAULT_1_KNOT), m_speed_quantize_middle_phase(IMUtils::SPEED_QUANTIZE_2_DEFAULT), - m_speed_quantize_first_phase(IMUtils::SPEED_QUANTIZE_3_DEFAULT){}; + m_speed_quantize_first_phase(IMUtils::SPEED_QUANTIZE_3_DEFAULT) {}; FIMSpeedQuantizer::FIMSpeedQuantizer(Units::Length middle_to_final_quantize_transition_distance, Units::Length first_to_middle_quantize_transition_distance, Units::Speed speed_quantize_final_phase, Units::Speed speed_quantize_middle_phase, - Units::Speed speed_quantize_first_phase) { - m_middle_to_final_quantize_transition_distance = middle_to_final_quantize_transition_distance; - m_first_to_middle_quantize_transition_distance = first_to_middle_quantize_transition_distance; - m_speed_quantize_final_phase = speed_quantize_final_phase; - m_speed_quantize_middle_phase = speed_quantize_middle_phase; - m_speed_quantize_first_phase = speed_quantize_first_phase; -} + Units::Speed speed_quantize_first_phase) + : m_middle_to_final_quantize_transition_distance(middle_to_final_quantize_transition_distance), + m_first_to_middle_quantize_transition_distance(first_to_middle_quantize_transition_distance), + m_speed_quantize_final_phase(speed_quantize_final_phase), + m_speed_quantize_middle_phase(speed_quantize_middle_phase), + m_speed_quantize_first_phase(speed_quantize_first_phase) {} Units::Speed FIMSpeedQuantizer::QuantizeForDistanceToGo(const Units::Length dtg_to_abp_in, const Units::Speed computed_ias_command, diff --git a/IntervalManagement/IMAchieve.cpp b/IntervalManagement/IMAchieve.cpp index 9544ff4..a8af112 100644 --- a/IntervalManagement/IMAchieve.cpp +++ b/IntervalManagement/IMAchieve.cpp @@ -14,14 +14,18 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMAchieve.h" -#include "public/Environment.h" +#include +#include +#include + #include "imalgs/MOPSPredictedWindEvaluatorVersion1.h" #include "imalgs/MOPSPredictedWindEvaluatorVersion2.h" +#include "public/Environment.h" using namespace std; using namespace interval_management::open_source; @@ -103,7 +107,7 @@ aaesim::open_source::Guidance IMAchieve::Update( void IMAchieve::DumpParameters(const string ¶meters_to_print) { LOG4CPLUS_DEBUG(IMAchieve::m_logger, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl); - LOG4CPLUS_DEBUG(IMAchieve::m_logger, "IMAlgorithm parms for " << parameters_to_print.c_str() << endl << endl); + LOG4CPLUS_DEBUG(IMAchieve::m_logger, "IMAlgorithm parms for " << parameters_to_print << endl << endl); IMAlgorithm::DumpParameters(parameters_to_print); @@ -114,14 +118,13 @@ void IMAchieve::DumpParameters(const string ¶meters_to_print) { LOG4CPLUS_DEBUG(IMAchieve::m_logger, "mBlendWind " << IsBlendWind() << endl); LOG4CPLUS_DEBUG(IMAchieve::m_logger, "threshold flag " << m_threshold_flag << endl); LOG4CPLUS_DEBUG(IMAchieve::m_logger, "time threshold " << Units::SecondsTime(m_time_threshold).value() << endl); - LOG4CPLUS_DEBUG(IMAchieve::m_logger, "ownship achieve-by waypoint " << m_achieve_by_point.c_str() << std::endl); + LOG4CPLUS_DEBUG(IMAchieve::m_logger, "ownship achieve-by waypoint " << m_achieve_by_point << std::endl); LOG4CPLUS_DEBUG(IMAchieve::m_logger, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl); } void IMAchieve::Initialize(const OwnshipPredictionParameters &ownship_prediction_parameters, const AircraftIntent &ownship_aircraft_intent, aaesim::open_source::WeatherPrediction &weather_prediction) { - IMAlgorithm::Initialize(ownship_prediction_parameters, ownship_aircraft_intent, weather_prediction); m_achieve_by_point.assign(m_im_clearance.GetAchieveByPoint()); diff --git a/IntervalManagement/IMAlgorithm.cpp b/IntervalManagement/IMAlgorithm.cpp index a727b1c..7d1fae6 100644 --- a/IntervalManagement/IMAlgorithm.cpp +++ b/IntervalManagement/IMAlgorithm.cpp @@ -14,15 +14,19 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** +#include "imalgs/IMAlgorithm.h" + #include +#include #include -#include "public/CustomMath.h" -#include "public/CoreUtils.h" -#include "imalgs/IMAlgorithm.h" +#include + #include "imalgs/InternalObserver.h" +#include "public/CoreUtils.h" +#include "public/CustomMath.h" using namespace aaesim::open_source; using namespace interval_management::open_source; @@ -81,15 +85,25 @@ IMAlgorithm::IMAlgorithm() IterClearIMAlg(); } -IMAlgorithm::IMAlgorithm(const IMAlgorithm &obj) : m_initiate_signal_receipt_time(Units::Infinity()) { - m_total_number_of_im_speed_changes = 0; - m_target_reference_lookup_index = 0; - m_ownship_reference_lookup_index = 0; - m_reference_precalc_index = 0; - m_previous_reference_im_speed_command_mach = 0.0; - m_loaded = false; - m_im_operation_is_complete = false; - m_ownship_kinematic_dtg_to_ptp = Units::Infinity(); +IMAlgorithm::IMAlgorithm(const IMAlgorithm &obj) + : m_initiate_signal_receipt_time(Units::Infinity()), + m_total_number_of_im_speed_changes(0), + m_target_reference_lookup_index(0), + m_ownship_reference_lookup_index(0), + m_reference_precalc_index(0), + m_previous_reference_im_speed_command_mach(0.0), + m_loaded(false), + m_im_operation_is_complete(false), + m_has_maintain_stage(false), + m_ownship_kinematic_dtg_to_ptp(Units::Infinity()), + m_loaded_middle_to_final_quantize_transition_distance(IMUtils::DIST_QUANTIZE_1_DEFAULT), + m_loaded_first_to_middle_quantize_transition_distance(IMUtils::DIST_QUANTIZE_2_DEFAULT), + m_loaded_speed_quantize_final_phase(IMUtils::SPEED_QUANTIZE_1_DEFAULT_1_KNOT), + m_loaded_speed_quantize_middle_phase(IMUtils::SPEED_QUANTIZE_2_DEFAULT), + m_loaded_speed_quantize_first_phase(IMUtils::SPEED_QUANTIZE_3_DEFAULT), + m_loaded_use_speed_limiting(IMUtils::LIMIT_FLAG_DEFAULT), + m_loaded_use_wind_blending(IMUtils::WIND_BLENDING_FLAG_DEFAULT), + m_loaded_use_speed_quantization(IMUtils::QUANTIZE_FLAG_DEFAULT) { Copy(obj); } @@ -203,7 +217,6 @@ aaesim::open_source::Guidance IMAlgorithm::Update( const interval_management::open_source::AircraftState &owntruthstate, const interval_management::open_source::AircraftState &targettruthstate, const std::vector &targethistory) { - return prevguidance; } @@ -270,8 +283,7 @@ void IMAlgorithm::UpdatePositionMetrics(const interval_management::open_source:: void IMAlgorithm::DumpParameters(const std::string ¶meters_to_print) { LOG4CPLUS_DEBUG(IMAlgorithm::m_logger, "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl); - LOG4CPLUS_DEBUG(IMAlgorithm::m_logger, "IMAlgorithm parms for " << parameters_to_print.c_str() << std::endl - << std::endl); + LOG4CPLUS_DEBUG(IMAlgorithm::m_logger, "IMAlgorithm parms for " << parameters_to_print << std::endl << std::endl); LOG4CPLUS_DEBUG(IMAlgorithm::m_logger, "mLoaded " << m_loaded << std::endl); diff --git a/IntervalManagement/IMClearance.cpp b/IntervalManagement/IMClearance.cpp index 6c030f7..b1e9fd1 100644 --- a/IntervalManagement/IMClearance.cpp +++ b/IntervalManagement/IMClearance.cpp @@ -14,12 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMClearance.h" +#include #include +#include +#include #include "imalgs/IMClearanceLoader.h" #include "imalgs/IMUtils.h" diff --git a/IntervalManagement/IMClearanceLoader.cpp b/IntervalManagement/IMClearanceLoader.cpp index 713d63e..1df6038 100644 --- a/IntervalManagement/IMClearanceLoader.cpp +++ b/IntervalManagement/IMClearanceLoader.cpp @@ -14,12 +14,16 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMClearanceLoader.h" -#include "utility/CustomUnits.h" + +#include +#include + #include "loader/LoadError.h" +#include "utility/CustomUnits.h" using namespace interval_management; using namespace interval_management::open_source; @@ -53,7 +57,6 @@ IMClearanceLoader::IMClearanceLoader(void) { IMClearanceLoader::~IMClearanceLoader(void) {} bool IMClearanceLoader::load(DecodedStream *strm) { - // Loads clearance data from input file and returns status. // // strm:input data stream. @@ -115,7 +118,6 @@ bool IMClearanceLoader::load(DecodedStream *strm) { } const IMClearance IMClearanceLoader::BuildClearance(void) { - // Builds clearance object. if (!m_loaded) return m_empty_clearance; diff --git a/IntervalManagement/IMDistBasedAchieve.cpp b/IntervalManagement/IMDistBasedAchieve.cpp index 01c9d50..eb3d33a 100644 --- a/IntervalManagement/IMDistBasedAchieve.cpp +++ b/IntervalManagement/IMDistBasedAchieve.cpp @@ -14,14 +14,19 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMDistBasedAchieve.h" -#include "public/SimulationTime.h" -#include "public/CustomMath.h" +#include +#include +#include +#include + #include "public/CoreUtils.h" +#include "public/CustomMath.h" +#include "public/SimulationTime.h" using namespace interval_management::open_source; using namespace aaesim::open_source; @@ -31,7 +36,6 @@ const Units::Length IMDistBasedAchieve::DEFAULT_DISTANCE_BASED_ASSIGNED_SPACING_ IMDistBasedAchieve::IMDistBasedAchieve() : m_true_distances(nullptr), m_assigned_spacing_goal(DEFAULT_DISTANCE_BASED_ASSIGNED_SPACING_GOAL) { - if (m_im_kinematic_dist_based_maintain == nullptr) { m_im_kinematic_dist_based_maintain = std::make_shared(); } @@ -191,7 +195,7 @@ aaesim::open_source::Guidance IMDistBasedAchieve::Update( m_ownship_kinematic_trajectory_predictor.GetVerticalPathVelocities().back()); m_previous_reference_im_speed_command_mach = Units::MetersPerSecondSpeed(m_previous_reference_im_speed_command_tas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::MetersLength( m_ownship_kinematic_trajectory_predictor.GetVerticalPathAltitudes().back())) @@ -263,7 +267,6 @@ aaesim::open_source::Guidance IMDistBasedAchieve::Update( m_ownship_kinematic_trajectory_predictor.GetVerticalPathTimes()); if (m_reference_precalc_index >= m_ownship_kinematic_trajectory_predictor.GetVerticalPathTimes().size() - 1) { - m_reference_precalc_index = static_cast(m_ownship_kinematic_trajectory_predictor.GetVerticalPathTimes().size() - 1); @@ -284,7 +287,6 @@ aaesim::open_source::Guidance IMDistBasedAchieve::Update( m_ownship_reference_altitude = Units::MetersLength(m_ownship_kinematic_trajectory_predictor.GetVerticalPathAltitudeByIndex(0)); } else { - ownship_reference_dtg_to_ptp = Units::MetersLength( -CoreUtils::LinearlyInterpolate(m_reference_precalc_index, Units::SecondsTime(ownrefttgtoend).value(), m_ownship_kinematic_trajectory_predictor.GetVerticalPathTimes(), @@ -516,7 +518,7 @@ void IMDistBasedAchieve::CalculateMach(const Units::Time reference_ttg, const Un highbound_estimated_mach = BoundedValue(Units::MetersPerSecondSpeed(estimated_true_airspeed).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::FeetLength(current_ownship_altitude)) .value())); @@ -529,7 +531,7 @@ void IMDistBasedAchieve::CalculateMach(const Units::Time reference_ttg, const Un m_weather_prediction.getAtmosphere()->CAS2TAS(nominal_indicated_airspeed, current_ownship_altitude); BoundedValue nominal_mach = BoundedValue(Units::MetersPerSecondSpeed(nominal_true_airspeed).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::FeetLength(current_ownship_altitude)) .value())); @@ -553,7 +555,7 @@ void IMDistBasedAchieve::CalculateMach(const Units::Time reference_ttg, const Un Units::Speed nominal_true_airspeed = m_weather_prediction.getAtmosphere()->CAS2TAS(nominal_indicated_airspeed, current_ownship_altitude); double nominal_mach = Units::MetersPerSecondSpeed(nominal_true_airspeed).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::FeetLength(current_ownship_altitude)) .value()); @@ -688,7 +690,7 @@ IMDistBasedAchieve &IMDistBasedAchieve::operator=(const IMDistBasedAchieve &obj) void IMDistBasedAchieve::DumpParameters(const std::string ¶meters_to_print) { LOG4CPLUS_DEBUG(IMDistBasedAchieve::m_logger, "\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\" << std::endl); - LOG4CPLUS_DEBUG(IMDistBasedAchieve::m_logger, parameters_to_print.c_str() << std::endl << std::endl); + LOG4CPLUS_DEBUG(IMDistBasedAchieve::m_logger, parameters_to_print << std::endl << std::endl); IMKinematicAchieve::DumpParameters(parameters_to_print); diff --git a/IntervalManagement/IMKinematicAchieve.cpp b/IntervalManagement/IMKinematicAchieve.cpp index bdff8ff..8866cd1 100644 --- a/IntervalManagement/IMKinematicAchieve.cpp +++ b/IntervalManagement/IMKinematicAchieve.cpp @@ -14,22 +14,27 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMKinematicAchieve.h" +#include #include +#include +#include +#include +#include #include "MiniCSV/minicsv.h" -#include "public/Atmosphere.h" #include "imalgs/IMClearanceLoader.h" -#include "public/CustomMath.h" #include "public/AircraftCalculations.h" +#include "public/Atmosphere.h" #include "public/CoreUtils.h" +#include "public/CustomMath.h" #include "public/Environment.h" -#include "public/Wind.h" #include "public/ScenarioUtils.h" +#include "public/Wind.h" using namespace interval_management::open_source; using namespace aaesim::open_source; @@ -314,7 +319,7 @@ void IMKinematicAchieve::HandleTrajectoryPrediction( const Units::FeetLength estimated_cruise_altitude(target_adsb_history.front().m_z); const Units::Speed targetvtas = Units::sqrt(Units::sqr(targetgroundspeed - Vw_para) + Units::sqr(Vw_perp)); double estimated_cruise_mach = Units::MetersPerSecondSpeed(targetvtas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::FeetLength(targetsyncstate.m_z)) .value()); @@ -412,7 +417,6 @@ void IMKinematicAchieve::HandleTrajectoryPrediction( void IMKinematicAchieve::CheckPredictionAccuracy( const interval_management::open_source::AircraftState &owntruthstate, const interval_management::open_source::AircraftState &targettruthstate) { - if (IsBlendWind() && !m_compute_ownship_kinematic_trajectory) { CalculateOwnshipDtgToPlannedTerminationPoint(owntruthstate); @@ -450,7 +454,6 @@ void IMKinematicAchieve::CheckPredictionAccuracy( if (!m_predicted_wind_evaluator->ArePredictedWindsAccurate( // IMUtils::ConvertToAaesimAircraftState(owntruthstate), m_weather_prediction, m_ownship_reference_cas, m_ownship_reference_altitude, sensed_atmosphere)) { - m_wind_blender->BlendSensedWithPredicted(IMUtils::ConvertToAaesimAircraftState(owntruthstate), m_weather_prediction); m_compute_ownship_kinematic_trajectory = true; @@ -504,7 +507,6 @@ void IMKinematicAchieve::CheckPredictionAccuracy( void IMKinematicAchieve::CalculateOwnshipDtgToPlannedTerminationPoint( const interval_management::open_source::AircraftState ¤t_ownship_state) { - m_ownship_distance_calculator.CalculateAlongPathDistanceFromPosition( current_ownship_state.GetPositionX(), current_ownship_state.GetPositionY(), m_ownship_kinematic_dtg_to_ptp); } @@ -790,7 +792,6 @@ void IMKinematicAchieve::CalculateRFLegPhase(const std::vector void IMKinematicAchieve::ComputeFASTrajectories( const interval_management::open_source::AircraftState &owntruthstate, const interval_management::open_source::AircraftState &targettruthstate) { - using namespace std; LOG4CPLUS_TRACE(logger, "Calculating FAS trajectories on AC " << owntruthstate.GetId() << " at " @@ -981,7 +982,6 @@ const Units::SignedAngle IMKinematicAchieve::CalculateTargetTrackAngle( void IMKinematicAchieve::SetTrafficReferencePointConstraints( const interval_management::open_source::AircraftState &owntruthstate, const interval_management::open_source::AircraftState &targetsyncstate) { - // adjust TRP speed and altitude constraints LOG4CPLUS_TRACE(logger, "Old TRP constraints: " << m_traffic_reference_point); diff --git a/IntervalManagement/IMKinematicDistBasedMaintain.cpp b/IntervalManagement/IMKinematicDistBasedMaintain.cpp index 03f4926..489c95d 100644 --- a/IntervalManagement/IMKinematicDistBasedMaintain.cpp +++ b/IntervalManagement/IMKinematicDistBasedMaintain.cpp @@ -14,14 +14,18 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMKinematicDistBasedMaintain.h" -#include "public/CustomMath.h" -#include "public/CoreUtils.h" +#include +#include +#include + #include "imalgs/InternalObserver.h" +#include "public/CoreUtils.h" +#include "public/CustomMath.h" using namespace interval_management::open_source; @@ -51,7 +55,6 @@ aaesim::open_source::Guidance IMKinematicDistBasedMaintain::Update( const interval_management::open_source::AchievePointCalcs &ownship_achieve_point_calcs, const interval_management::open_source::AchievePointCalcs &traffic_reference_point_calcs, aaesim::open_source::StatisticalPilotDelay &pilot_delay) { - /* * Developer's note: In this level of the algorithm, all uses of the /target state/ * must be projected onto ownship's route prior to use. This includes all items @@ -81,7 +84,7 @@ aaesim::open_source::Guidance IMKinematicDistBasedMaintain::Update( Units::MetersPerSecondSpeed(ownship_kinematic_trajectory_predictor.GetVerticalPathVelocities().back()); m_previous_reference_im_speed_command_mach = Units::MetersPerSecondSpeed(m_previous_reference_im_speed_command_tas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::MetersLength( ownship_kinematic_trajectory_predictor.GetVerticalPathAltitudes().back())) @@ -185,7 +188,6 @@ void IMKinematicDistBasedMaintain::CalculateMach( const Units::Speed true_airspeed_command, const aaesim::open_source::KinematicTrajectoryPredictor &ownship_kinematic_trajectory_predictor, aaesim::open_source::StatisticalPilotDelay &pilot_delay, const Units::Mass current_mass) { - Units::Speed nominal_profile_ias = Units::MetersPerSecondSpeed( ownship_kinematic_trajectory_predictor.GetVerticalPathVelocityByIndex(m_ownship_reference_lookup_index)); Units::Speed nominal_profile_tas = @@ -193,12 +195,12 @@ void IMKinematicDistBasedMaintain::CalculateMach( BoundedValue nominal_mach( Units::MetersPerSecondSpeed(nominal_profile_tas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere()->GetTemperature(current_ownship_altitude).value())); BoundedValue temp_mach( Units::MetersPerSecondSpeed(true_airspeed_command).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere()->GetTemperature(current_ownship_altitude).value())); if (target_kinematic_dtg_to_end_of_route > Units::zero()) { @@ -234,7 +236,6 @@ void IMKinematicDistBasedMaintain::RecordInternalObserverData( const Units::Length target_true_dtg, const Units::Length ownship_true_dtg, const std::vector &target_aircraft_state_history, const aaesim::open_source::KinematicTrajectoryPredictor &ownship_kinematic_trajectory_predictor) { - InternalObserver::getInstance()->updateFinalGS( target_aircraft_state.GetId(), Units::MetersPerSecondSpeed(target_aircraft_state_history.back().GetGroundSpeed()).value()); diff --git a/IntervalManagement/IMKinematicTimeBasedMaintain.cpp b/IntervalManagement/IMKinematicTimeBasedMaintain.cpp index 99c8186..8d78a53 100644 --- a/IntervalManagement/IMKinematicTimeBasedMaintain.cpp +++ b/IntervalManagement/IMKinematicTimeBasedMaintain.cpp @@ -14,17 +14,19 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMKinematicTimeBasedMaintain.h" #include +#include +#include +#include "imalgs/InternalObserver.h" +#include "public/CoreUtils.h" #include "public/CustomMath.h" #include "public/SimulationTime.h" -#include "public/CoreUtils.h" -#include "imalgs/InternalObserver.h" using namespace interval_management::open_source; @@ -140,7 +142,7 @@ aaesim::open_source::Guidance IMKinematicTimeBasedMaintain::Update( ownship_kinematic_trajectory_predictor.GetVerticalPathVelocities().back()); m_previous_reference_im_speed_command_mach = Units::MetersPerSecondSpeed(m_previous_reference_im_speed_command_tas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::MetersLength( ownship_kinematic_trajectory_predictor.GetVerticalPathAltitudes().back())) @@ -279,7 +281,6 @@ void IMKinematicTimeBasedMaintain::CalculateMach( const Units::Length current_ownship_altitude, const Units::Speed true_airspeed_command, const aaesim::open_source::KinematicTrajectoryPredictor &ownship_kinematic_trajectory_predictor, aaesim::open_source::StatisticalPilotDelay &pilot_delay, const Units::Mass current_mass) { - // Make sure velocity is within nominal limits (AAES-694) Units::Speed nominal_profile_ias = Units::MetersPerSecondSpeed( ownship_kinematic_trajectory_predictor.GetVerticalPathVelocityByIndex(m_ownship_reference_lookup_index)); @@ -288,12 +289,12 @@ void IMKinematicTimeBasedMaintain::CalculateMach( BoundedValue estimated_mach = BoundedValue( Units::MetersPerSecondSpeed(true_airspeed_command).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere()->GetTemperature(current_ownship_altitude).value())); BoundedValue nominal_mach = BoundedValue( Units::MetersPerSecondSpeed(nominal_profile_tas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere()->GetTemperature(current_ownship_altitude).value())); estimated_mach = m_speed_limiter.LimitMachCommand( diff --git a/IntervalManagement/IMMaintain.cpp b/IntervalManagement/IMMaintain.cpp index 5fca8dd..d8fdceb 100644 --- a/IntervalManagement/IMMaintain.cpp +++ b/IntervalManagement/IMMaintain.cpp @@ -14,11 +14,14 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMMaintain.h" +#include +#include + using namespace interval_management::open_source; log4cplus::Logger IMMaintain::m_logger = log4cplus::Logger::getInstance(LOG4CPLUS_TEXT("IMMaintain")); diff --git a/IntervalManagement/IMTimeBasedAchieve.cpp b/IntervalManagement/IMTimeBasedAchieve.cpp index b150fec..1741232 100644 --- a/IntervalManagement/IMTimeBasedAchieve.cpp +++ b/IntervalManagement/IMTimeBasedAchieve.cpp @@ -14,15 +14,18 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMTimeBasedAchieve.h" +#include #include +#include +#include -#include "public/CustomMath.h" #include "public/CoreUtils.h" +#include "public/CustomMath.h" using namespace std; using namespace aaesim::open_source; @@ -246,7 +249,7 @@ aaesim::open_source::Guidance IMTimeBasedAchieve::HandleAchieveStage( m_previous_reference_im_speed_command_mach = Units::MetersPerSecondSpeed(m_previous_reference_im_speed_command_tas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere() ->GetTemperature(Units::MetersLength( m_ownship_kinematic_trajectory_predictor.GetVerticalPathAltitudes().back())) @@ -527,10 +530,8 @@ aaesim::open_source::Guidance IMTimeBasedAchieve::HandleMaintainStage( const Units::Time IMTimeBasedAchieve::CalculateMeasuredSpacingInterval( const interval_management::open_source::AircraftState ¤t_ownship_state, const interval_management::open_source::AircraftState ¤t_target_state) { - if (m_target_kinematic_traffic_reference_point_calcs.IsWaypointSet() && GetTargetKinematicDtgToTrp() > Units::zero()) { - // special calculation if target has not passed TRP Units::Length target_dtg_trp = m_target_kinematic_traffic_reference_point_calcs.ComputeDistanceToWaypoint(current_target_state); @@ -594,7 +595,7 @@ void IMTimeBasedAchieve::CalculateMach(const Units::Time reference_ttg, const Un double unbounded_estimated_mach = Units::MetersPerSecondSpeed(temptrue).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere()->GetTemperature(current_ownship_altitude).value()); BoundedValue estimated_mach(0); @@ -608,7 +609,7 @@ void IMTimeBasedAchieve::CalculateMach(const Units::Time reference_ttg, const Un Units::Speed nominal_tas = m_weather_prediction.getAtmosphere()->CAS2TAS(nominal_ias, current_ownship_altitude); BoundedValue nominal_mach( Units::MetersPerSecondSpeed(nominal_tas).value() / - sqrt(GAMMA * R.value() * + sqrt(kGamma * R.value() * m_weather_prediction.getAtmosphere()->GetTemperature(current_ownship_altitude).value())); estimated_mach = m_speed_limiter.LimitMachCommand( @@ -680,7 +681,7 @@ void IMTimeBasedAchieve::RecordInternalObserverMetrics( void IMTimeBasedAchieve::DumpParameters(const string ¶meters_to_print) { LOG4CPLUS_DEBUG(IMTimeBasedAchieve::m_logger, "--------------------------------------------------------------------" << endl); - LOG4CPLUS_DEBUG(IMTimeBasedAchieve::m_logger, parameters_to_print.c_str() << endl << endl); + LOG4CPLUS_DEBUG(IMTimeBasedAchieve::m_logger, parameters_to_print << endl << endl); IMKinematicAchieve::DumpParameters(parameters_to_print); diff --git a/IntervalManagement/IMTimeBasedAchieveMutableASG.cpp b/IntervalManagement/IMTimeBasedAchieveMutableASG.cpp index 12f9159..1dc1f35 100644 --- a/IntervalManagement/IMTimeBasedAchieveMutableASG.cpp +++ b/IntervalManagement/IMTimeBasedAchieveMutableASG.cpp @@ -14,14 +14,18 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** -#include #include -#include "public/CustomMath.h" +#include +#include +#include +#include + #include "public/CoreUtils.h" +#include "public/CustomMath.h" #include "public/SimulationTime.h" using namespace std; @@ -118,7 +122,7 @@ aaesim::open_source::Guidance IMTimeBasedAchieveMutableASG::Update( void IMTimeBasedAchieveMutableASG::DumpParameters(const string ¶meters_to_print) { LOG4CPLUS_DEBUG(IMTimeBasedAchieveMutableASG::logger, "--------------------------------------------------------------------" << endl); - LOG4CPLUS_DEBUG(IMTimeBasedAchieveMutableASG::logger, parameters_to_print.c_str() << endl << endl); + LOG4CPLUS_DEBUG(IMTimeBasedAchieveMutableASG::logger, parameters_to_print << endl << endl); LOG4CPLUS_DEBUG(logger, "dtg_trigger_nm = " << m_dtg_trigger); LOG4CPLUS_DEBUG(logger, "new_asg_sec = " << m_next_assigned_spacing_goal); LOG4CPLUS_DEBUG(logger, "asg_change_duration_sec = " << m_asg_change_duration); diff --git a/IntervalManagement/IMUtils.cpp b/IntervalManagement/IMUtils.cpp index 637410a..1b7e2d8 100644 --- a/IntervalManagement/IMUtils.cpp +++ b/IntervalManagement/IMUtils.cpp @@ -14,13 +14,17 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/IMUtils.h" #include +#include +#include #include +#include +#include #include "public/AircraftCalculations.h" #include "public/ScenarioUtils.h" diff --git a/IntervalManagement/InternalObserver.cpp b/IntervalManagement/InternalObserver.cpp index 3ea8518..0957c54 100644 --- a/IntervalManagement/InternalObserver.cpp +++ b/IntervalManagement/InternalObserver.cpp @@ -14,12 +14,17 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/InternalObserver.h" +#include #include +#include +#include +#include +#include #include "public/StereographicProjection.h" @@ -80,12 +85,11 @@ void InternalObserver::process_NM_aircraft() { NMObserver &nm_observer = ix->second.m_nm_observer; if (!nm_observer.entry_list.empty()) { - char *temp = new char[10]; + char temp[10]; - snprintf(temp, 10, "%d", ix->first); + snprintf(temp, sizeof(temp), "%d", ix->first); string output_file_name = scenario_name + "_aircraft_" + temp + "_nm_output.csv"; - delete[] temp; ofstream out; @@ -150,14 +154,12 @@ void InternalObserver::process_NM_stats() { NMObserver &nm_observer = ix->second.m_nm_observer; if (nm_observer.predictedDistance.size() > 0) { - char *temp = new char[10]; + char temp[10]; - snprintf(temp, 10, "%d", ix->first); + snprintf(temp, sizeof(temp), "%d", ix->first); string output_file_name = scenario_name + "_aircraft_" + temp + "_stats_nm_output.csv"; - delete[] temp; - ofstream out; out.open(output_file_name.c_str(), ios::out); @@ -419,12 +421,14 @@ string InternalObserver::predWindsHeading(int numVals) { return hdr; } -string InternalObserver::predWindsData(int id, int col, string field, const aaesim::open_source::WindStack &mat) { +string InternalObserver::predWindsData(int id, int col, const string &field, + const aaesim::open_source::WindStack &mat) { string str; - char *txt = new char[31]; + auto buffer_size = 31; + char *txt = new char[buffer_size]; - snprintf(txt, 301, "%d", id); + snprintf(txt, buffer_size, "%d", id); str = txt; str += ","; str += field.c_str(); @@ -432,10 +436,10 @@ string InternalObserver::predWindsData(int id, int col, string field, const aaes for (int i = 1; i <= mat.GetMaxRow(); i++) { switch (col) { case 1: - snprintf(txt, 301, ",%lf", mat.GetAltitude(i).value()); + snprintf(txt, buffer_size, ",%lf", mat.GetAltitude(i).value()); break; case 2: - snprintf(txt, 301, ",%lf", mat.GetSpeed(i).value()); + snprintf(txt, buffer_size, ",%lf", mat.GetSpeed(i).value()); } str += txt; } @@ -445,13 +449,13 @@ string InternalObserver::predWindsData(int id, int col, string field, const aaes return str; } -string InternalObserver::predTempData(int id, string field, +string InternalObserver::predTempData(int id, const string &field, const aaesim::open_source::WeatherPrediction &weatherPrediction) { string str; - char *txt = new char[31]; + char txt[31]; - snprintf(txt, 31, "%d", id); + snprintf(txt, sizeof(txt), "%d", id); str = txt; str += ","; @@ -461,12 +465,10 @@ string InternalObserver::predTempData(int id, string field, for (int i = 1; i <= mat.GetMaxRow(); i++) { Units::Length alt = mat.GetAltitude(i); Units::KelvinTemperature temperature = weatherPrediction.GetForecastAtmosphere()->GetTemperature(alt); - snprintf(txt, 31, ",%lf", temperature.value() - 273.15); + snprintf(txt, sizeof(txt), ",%lf", temperature.value() - 273.15); str += txt; } - delete[] txt; - return str; } diff --git a/IntervalManagement/InternalObserverScenarioWriter.cpp b/IntervalManagement/InternalObserverScenarioWriter.cpp index a93bcb2..f68a504 100644 --- a/IntervalManagement/InternalObserverScenarioWriter.cpp +++ b/IntervalManagement/InternalObserverScenarioWriter.cpp @@ -14,10 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/InternalObserverScenarioWriter.h" + +#include + #include "imalgs/InternalObserver.h" void interval_management::open_source::InternalObserverScenarioWriter::IterationBegin(const int &iteration_number) { diff --git a/IntervalManagement/MOPSPredictedWindEvaluatorVersion1.cpp b/IntervalManagement/MOPSPredictedWindEvaluatorVersion1.cpp index 10d0854..bfa63a6 100644 --- a/IntervalManagement/MOPSPredictedWindEvaluatorVersion1.cpp +++ b/IntervalManagement/MOPSPredictedWindEvaluatorVersion1.cpp @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** /* @@ -25,6 +25,9 @@ */ #include "imalgs/MOPSPredictedWindEvaluatorVersion1.h" + +#include + #include "public/Environment.h" using namespace interval_management::open_source; @@ -51,7 +54,6 @@ bool MOPSPredictedWindEvaluatorVersion1::ArePredictedWindsAccurate( const aaesim::open_source::AircraftState &state, const aaesim::open_source::WeatherPrediction &weatherPrediction, const Units::Speed reference_cas, const Units::Length reference_altitude, const std::shared_ptr &sensed_atmosphere) const { - Units::MetersPerSecondSpeed windeastcomp, windnorthcomp; Units::Frequency NOT_USED; weatherPrediction.east_west().CalculateWindGradientAtAltitude(state.GetAltitudeMsl(), windeastcomp, NOT_USED); diff --git a/IntervalManagement/MOPSPredictedWindEvaluatorVersion2.cpp b/IntervalManagement/MOPSPredictedWindEvaluatorVersion2.cpp index ffac99c..bf7dde1 100644 --- a/IntervalManagement/MOPSPredictedWindEvaluatorVersion2.cpp +++ b/IntervalManagement/MOPSPredictedWindEvaluatorVersion2.cpp @@ -14,10 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/MOPSPredictedWindEvaluatorVersion2.h" + +#include + #include "public/Environment.h" using namespace interval_management::open_source; @@ -45,7 +48,6 @@ bool MOPSPredictedWindEvaluatorVersion2::ArePredictedWindsAccurate( const aaesim::open_source::AircraftState &state, const aaesim::open_source::WeatherPrediction &weather_prediction, const Units::Speed reference_cas, const Units::Length reference_altitude, const std::shared_ptr &sensed_atmosphere) const { - Units::FeetLength true_altitude{state.GetAltitudeMsl()}; Units::KnotsSpeed tas1 = weather_prediction.CAS2TAS(reference_cas, reference_altitude); Units::KnotsSpeed tas2 = sensed_atmosphere->CAS2TAS(reference_cas, true_altitude); diff --git a/IntervalManagement/MaintainMetric.cpp b/IntervalManagement/MaintainMetric.cpp index 047eaa2..1e4d660 100644 --- a/IntervalManagement/MaintainMetric.cpp +++ b/IntervalManagement/MaintainMetric.cpp @@ -14,10 +14,11 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/MaintainMetric.h" + #include using namespace interval_management::open_source; @@ -25,7 +26,6 @@ using namespace interval_management::open_source; MaintainMetric::MaintainMetric() = default; void MaintainMetric::AddSpacingErrorSec(double err) { - // Adds data to be added for each pass through an IM::update method. // Also increments number of cycles if outside of threshold. // @@ -41,7 +41,6 @@ void MaintainMetric::AddSpacingErrorSec(double err) { } void MaintainMetric::SetTimeAtAbp(double aTime) { - // Sets time aircraft went by achieve by point. // // aTime:achieve by time. @@ -50,7 +49,6 @@ void MaintainMetric::SetTimeAtAbp(double aTime) { } void MaintainMetric::ComputeTotalMaintainTime(double cTime) { - // Computes total maintain time subtracting the achieveByTime // from the current time. // @@ -60,7 +58,6 @@ void MaintainMetric::ComputeTotalMaintainTime(double cTime) { } bool MaintainMetric::TimeAtAbpRecorded() { - // Boolean to determine if achieveBy set. // // return:true if achieve by has valid time. @@ -70,7 +67,6 @@ bool MaintainMetric::TimeAtAbpRecorded() { } double MaintainMetric::getMeanErr() { - // Gets mean spacing error. // // returns mean error. @@ -79,7 +75,6 @@ double MaintainMetric::getMeanErr() { } double MaintainMetric::getStdErr() { - // Gets standard deviation of spacing error. // // returns standard deviation of error. @@ -88,7 +83,6 @@ double MaintainMetric::getStdErr() { } double MaintainMetric::getBound95() { - // Gets 95th bound of spacing error. // // returns 95th bound of spacing error. @@ -97,7 +91,6 @@ double MaintainMetric::getBound95() { } double MaintainMetric::getTotMaintain() { - // Gets total maintain time. // // returns total maintain time. @@ -106,7 +99,6 @@ double MaintainMetric::getTotMaintain() { } int MaintainMetric::getNumCycles() { - // Gets number of cycles with spacing errors > cycle threshold // // returns number of cycles. @@ -115,7 +107,6 @@ int MaintainMetric::getNumCycles() { } bool MaintainMetric::hasSamples() { - // Determines whether there are any samples collected. // // returns true if there are samples diff --git a/IntervalManagement/MergePointMetric.cpp b/IntervalManagement/MergePointMetric.cpp index 01e410a..c24468a 100644 --- a/IntervalManagement/MergePointMetric.cpp +++ b/IntervalManagement/MergePointMetric.cpp @@ -14,12 +14,16 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/MergePointMetric.h" -#include "public/AircraftCalculations.h" + #include +#include +#include + +#include "public/AircraftCalculations.h" using namespace std; using namespace interval_management::open_source; @@ -30,7 +34,6 @@ MergePointMetric::MergePointMetric() = default; MergePointMetric::~MergePointMetric() = default; void MergePointMetric::determineMergePoint(const AircraftIntent &imintent, const AircraftIntent &targintent) { - // Determines and sets the merge point between the IM and target aircraft. // The merge point is defined as the first waypoint in the route where the // remainder of the IM and target route match @@ -65,7 +68,6 @@ void MergePointMetric::determineMergePoint(const AircraftIntent &imintent, const } void MergePointMetric::update(double imXNew, double imYNew, double targXNew, double targYNew) { - // Replaces the current IM and target position if the new IM position is closer to the // merge point than the current IM point. Distances are computed in nmi. // @@ -92,8 +94,7 @@ void MergePointMetric::update(double imXNew, double imYNew, double targXNew, dou } } -string MergePointMetric::getMergePoint() { - +const string &MergePointMetric::getMergePoint() { // Gets merge point. // // returns name of waypoint which is the merge point. @@ -102,7 +103,6 @@ string MergePointMetric::getMergePoint() { } Units::Length MergePointMetric::getDist() { - // Gets computed distance when IM aircraft was at merge point. // // returns distance in nmi. @@ -111,7 +111,6 @@ Units::Length MergePointMetric::getDist() { } bool MergePointMetric::newPointCloser(double x, double y) { - // Checks if newest IM position closer to waypoint than the stored IM position. // // x,y:new IM position in feet. @@ -124,7 +123,6 @@ bool MergePointMetric::newPointCloser(double x, double y) { } bool MergePointMetric::mergePointFound() { - // Determines whether merge point already found. // // returns true if merge point found. diff --git a/IntervalManagement/NMObserver.cpp b/IntervalManagement/NMObserver.cpp index 7999118..5bbfa7d 100644 --- a/IntervalManagement/NMObserver.cpp +++ b/IntervalManagement/NMObserver.cpp @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/NMObserver.h" diff --git a/IntervalManagement/NMObserverEntry.cpp b/IntervalManagement/NMObserverEntry.cpp index c33a0cd..aef7453 100644 --- a/IntervalManagement/NMObserverEntry.cpp +++ b/IntervalManagement/NMObserverEntry.cpp @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/NMObserverEntry.h" diff --git a/IntervalManagement/PredictionFileKinematic.cpp b/IntervalManagement/PredictionFileKinematic.cpp index 6cf6a2f..641c937 100644 --- a/IntervalManagement/PredictionFileKinematic.cpp +++ b/IntervalManagement/PredictionFileKinematic.cpp @@ -14,15 +14,20 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/PredictionFileKinematic.h" -#include "imalgs/IMKinematicAchieve.h" +#include +#include +#include +#include +#include + #include "imalgs/FIMAlgorithmAdapter.h" +#include "imalgs/IMKinematicAchieve.h" #include "public/CoreUtils.h" -#include using namespace interval_management::open_source; @@ -166,7 +171,6 @@ void PredictionFileKinematic::Gather( const bool PredictionFileKinematic::TrajectoryWasRegenerated( const std::vector &prediction_data_single_acid, const VerticalPath &vertical_path, const int iteration, const PredictionData::DataSource source) const { - if (!prediction_data_single_acid.empty()) { bool trajectory_was_regenerated = prediction_data_single_acid.back().iteration_number != iteration; trajectory_was_regenerated = trajectory_was_regenerated || prediction_data_single_acid.back().source != source; diff --git a/IntervalManagement/Statistics.cpp b/IntervalManagement/Statistics.cpp index 6af4f79..25a31f5 100644 --- a/IntervalManagement/Statistics.cpp +++ b/IntervalManagement/Statistics.cpp @@ -14,12 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/Statistics.h" + #include + #include +#include using namespace interval_management::open_source; @@ -45,7 +48,6 @@ double Statistics::ComputeStandardDeviation() const { double sDev = -1.0; if (!m_samples.empty()) { - double variance_sum = 0.0; for (int loop = 0; loop < static_cast(m_samples.size()); loop++) { if (loop != 0) { diff --git a/IntervalManagement/TrueDistances.cpp b/IntervalManagement/TrueDistances.cpp index db6c5e7..da10a8f 100644 --- a/IntervalManagement/TrueDistances.cpp +++ b/IntervalManagement/TrueDistances.cpp @@ -14,11 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #include "imalgs/TrueDistances.h" +#include + using namespace interval_management::open_source; const Units::Time TrueDistances::END_OF_ROUTE_CROSSING_TIME_TOLERANCE = Units::SecondsTime(1.1); @@ -56,13 +58,14 @@ const Units::Length TrueDistances::ComputeTrueDtgToPtpAtTime(const Units::Time & // Find time in vector. - int ix = -1; + const auto not_found = m_times.size(); + auto ix = not_found; if (!m_times.empty()) { if ((time_in > m_times.back()) && Units::abs(time_in - m_times.back()) < END_OF_ROUTE_CROSSING_TIME_TOLERANCE) { - ix = static_cast(m_times.size() - 1); + ix = m_times.size() - 1; } else { - for (int i = 1; (i < m_times.size()) && (ix == -1); ++i) { + for (std::size_t i = 1; (i < m_times.size()) && (ix == not_found); ++i) { if ((time_in >= m_times[i - 1]) && (time_in <= m_times[i])) { ix = i; } @@ -70,11 +73,11 @@ const Units::Length TrueDistances::ComputeTrueDtgToPtpAtTime(const Units::Time & } } - if (ix < 0) return Units::NegInfinity(); + if (ix == not_found) return Units::NegInfinity(); if (ix >= 1 && time_in == m_times[ix - 1]) { return m_true_distances[ix - 1]; } - if (ix >= 0 && time_in == m_times[ix]) { + if (time_in == m_times[ix]) { return m_true_distances[ix]; } if (ix == 0) return Units::NegInfinity(); @@ -87,4 +90,4 @@ const Units::Length TrueDistances::ComputeTrueDtgToPtpAtTime(const Units::Time & void TrueDistances::Clear() { m_times.clear(); m_true_distances.clear(); -} \ No newline at end of file +} diff --git a/include/.DS_Store b/include/.DS_Store deleted file mode 100644 index def036d..0000000 Binary files a/include/.DS_Store and /dev/null differ diff --git a/include/imalgs/AchieveObserver.h b/include/imalgs/AchieveObserver.h index a975f5f..208fc06 100644 --- a/include/imalgs/AchieveObserver.h +++ b/include/imalgs/AchieveObserver.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -49,4 +49,4 @@ class AchieveObserver final { Units::Length m_ref_dist; }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/AchievePointCalcs.h b/include/imalgs/AchievePointCalcs.h index eeba1f0..d28775e 100644 --- a/include/imalgs/AchievePointCalcs.h +++ b/include/imalgs/AchievePointCalcs.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** /* @@ -23,20 +23,23 @@ #pragma once -#include -#include #include -#include "public/AircraftIntent.h" + +#include +#include +#include +#include + #include "imalgs/AircraftState.h" -#include "public/VerticalPath.h" -#include "public/HorizontalPath.h" -#include "public/Logging.h" +#include "loader/Logging.h" +#include "public/AircraftIntent.h" #include "public/AlongPathDistanceCalculator.h" +#include "public/HorizontalPath.h" +#include "public/VerticalPath.h" namespace interval_management { namespace open_source { class AchievePointCalcs final { - public: AchievePointCalcs(); @@ -139,4 +142,4 @@ inline const bool AchievePointCalcs::IsWaypointSet() const { return m_waypoint_i inline const Units::Time AchievePointCalcs::GetCrossingTime() const { return m_crossing_time; } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/AircraftState.h b/include/imalgs/AircraftState.h index eb3497f..d34ccc3 100644 --- a/include/imalgs/AircraftState.h +++ b/include/imalgs/AircraftState.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -26,8 +26,8 @@ #include #include +#include "loader/Logging.h" #include "public/EarthModel.h" -#include "public/Logging.h" namespace interval_management { namespace open_source { @@ -140,4 +140,4 @@ inline EarthModel::LocalPositionEnu AircraftState::GetPosition() const { return EarthModel::LocalPositionEnu::Of(GetPositionX(), GetPositionY(), GetPositionZ()); } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/ClosestPointMetric.h b/include/imalgs/ClosestPointMetric.h index f415e2f..5400c0e 100644 --- a/include/imalgs/ClosestPointMetric.h +++ b/include/imalgs/ClosestPointMetric.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -49,4 +49,4 @@ class ClosestPointMetric final { Units::Length mMinDist{Units::Infinity()}; }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/CrossTrackObserver.h b/include/imalgs/CrossTrackObserver.h index 355c62a..b96b235 100644 --- a/include/imalgs/CrossTrackObserver.h +++ b/include/imalgs/CrossTrackObserver.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -39,4 +39,4 @@ class CrossTrackObserver final { double reported_distance; }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/FIMAlgorithmAdapter.h b/include/imalgs/FIMAlgorithmAdapter.h index ef5df30..bd8eb22 100644 --- a/include/imalgs/FIMAlgorithmAdapter.h +++ b/include/imalgs/FIMAlgorithmAdapter.h @@ -14,11 +14,14 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include +#include + #include "imalgs/IMAlgorithm.h" #include "public/ASSAP.h" #include "public/FlightDeckApplication.h" @@ -65,4 +68,4 @@ inline std::shared_ptr inline IMUtils::IMAlgorithmTypes FIMAlgorithmAdapter::GetImAlgorithmType() const { return m_im_algorithm_type; } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/FIMAlgorithmDataWriter.h b/include/imalgs/FIMAlgorithmDataWriter.h index 7d58917..fc0edb0 100644 --- a/include/imalgs/FIMAlgorithmDataWriter.h +++ b/include/imalgs/FIMAlgorithmDataWriter.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -25,14 +25,15 @@ #include #include +#include #include #include #include "imalgs/AircraftState.h" #include "imalgs/IMAlgorithm.h" +#include "loader/Logging.h" #include "public/FlightDeckApplication.h" #include "public/Guidance.h" -#include "public/Logging.h" #include "public/OutputHandler.h" #include "public/SimulationTime.h" @@ -45,7 +46,8 @@ class FIMAlgorithmDataWriter final : public OutputHandler { virtual void Finish(); - void Gather(const int iteration_number, const aaesim::open_source::SimulationTime &time, std::string aircraft_id, + void Gather(const int iteration_number, const aaesim::open_source::SimulationTime &time, + const std::string &aircraft_id, std::shared_ptr application); private: diff --git a/include/imalgs/FIMAlgorithmInitializer.h b/include/imalgs/FIMAlgorithmInitializer.h index 561c539..e7af120 100644 --- a/include/imalgs/FIMAlgorithmInitializer.h +++ b/include/imalgs/FIMAlgorithmInitializer.h @@ -14,11 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include + #include "imalgs/FIMAlgorithmAdapter.h" #include "imalgs/IMDistBasedAchieve.h" #include "imalgs/IMKinematicAchieve.h" @@ -26,6 +28,7 @@ #include "imalgs/IMTimeBasedAchieveMutableASG.h" #include "public/FlightDeckApplication.h" #include "public/PassThroughAssap.h" + namespace interval_management { namespace open_source { class FIMAlgorithmInitializer final : public aaesim::open_source::FlightDeckApplicationInitializer { @@ -48,15 +51,15 @@ class FIMAlgorithmInitializer final : public aaesim::open_source::FlightDeckAppl ~Builder() = default; const interval_management::open_source::FIMAlgorithmInitializer Build() const; Builder *AddOwnshipPerformanceParameters( - aaesim::open_source::OwnshipPerformanceParameters performance_parameters); + const aaesim::open_source::OwnshipPerformanceParameters &performance_parameters); Builder *AddOwnshipFmsPredictionParameters( - aaesim::open_source::OwnshipFmsPredictionParameters prediction_parameters); + const aaesim::open_source::OwnshipFmsPredictionParameters &prediction_parameters); Builder *AddSurveillanceProcessor(std::shared_ptr processor); - aaesim::open_source::OwnshipPerformanceParameters GetPerformanceParameters() const { + const aaesim::open_source::OwnshipPerformanceParameters &GetPerformanceParameters() const { return m_performance_parameters; }; - aaesim::open_source::OwnshipFmsPredictionParameters GetFmsPredictionParameters() const { + const aaesim::open_source::OwnshipFmsPredictionParameters &GetFmsPredictionParameters() const { return m_prediction_parameters; }; std::shared_ptr GetSurveillanceProcessor() const { diff --git a/include/imalgs/FIMConfiguration.h b/include/imalgs/FIMConfiguration.h index 115fa8d..39e99b1 100644 --- a/include/imalgs/FIMConfiguration.h +++ b/include/imalgs/FIMConfiguration.h @@ -14,16 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once -#include "loader/Loadable.h" - -#include "loader/DecodedStream.h" -#include "public/Logging.h" #include "imalgs/IMUtils.h" +#include "loader/DecodedStream.h" +#include "loader/Loadable.h" +#include "loader/Logging.h" namespace interval_management { namespace open_source { diff --git a/include/imalgs/FIMSpeedLimiter.h b/include/imalgs/FIMSpeedLimiter.h index d8e07ea..686cd2f 100644 --- a/include/imalgs/FIMSpeedLimiter.h +++ b/include/imalgs/FIMSpeedLimiter.h @@ -14,9 +14,11 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** +#include + #include "imalgs/FIMSpeedQuantizer.h" #include "public/BadaUtils.h" #include "public/SpeedCommandLimiter.h" @@ -48,7 +50,7 @@ class FIMSpeedLimiter final : public aaesim::open_source::SpeedCommandLimiter { aaesim::open_source::bada_utils::FlapSpeeds flap_speeds, aaesim::open_source::bada_utils::FlightEnvelope flight_envelope, aaesim::open_source::bada_utils::Mass mass_data, - aaesim::open_source::bada_utils::Aerodynamics aerodynamics, + const aaesim::open_source::bada_utils::Aerodynamics &aerodynamics, const FIMSpeedQuantizer &speed_quantizer); ~FIMSpeedLimiter(); @@ -110,16 +112,16 @@ class FIMSpeedLimiter final : public aaesim::open_source::SpeedCommandLimiter { std::vector m_rf_leg_limits; - unsigned long int m_active_filter_flag; - bool m_limit_flag; - bool m_quantize_flag; - double m_low_speed_coef; - double m_high_speed_coef; + unsigned long int m_active_filter_flag{0L}; + bool m_limit_flag{false}; + bool m_quantize_flag{false}; + double m_low_speed_coef{0}; + double m_high_speed_coef{0}; FIMSpeedQuantizer m_fim_quantizer; - aaesim::open_source::bada_utils::FlapSpeeds m_flap_speeds; - aaesim::open_source::bada_utils::FlightEnvelope m_aircraft_flight_envelope; - aaesim::open_source::bada_utils::Mass m_mass_data; - aaesim::open_source::bada_utils::Aerodynamics m_aerodynamics; + aaesim::open_source::bada_utils::FlapSpeeds m_flap_speeds{}; + aaesim::open_source::bada_utils::FlightEnvelope m_aircraft_flight_envelope{}; + aaesim::open_source::bada_utils::Mass m_mass_data{}; + aaesim::open_source::bada_utils::Aerodynamics m_aerodynamics{}; }; inline const interval_management::open_source::FIMSpeedQuantizer &FIMSpeedLimiter::GetSpeedQuantizer() const { @@ -151,4 +153,4 @@ inline const std::vector &FIMSpeedLimiter::GetRfLeg inline void FIMSpeedLimiter::ClearRfLegSpeedLimits() { m_rf_leg_limits.clear(); } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/FIMSpeedQuantizer.h b/include/imalgs/FIMSpeedQuantizer.h index 9bd65de..d3053df 100644 --- a/include/imalgs/FIMSpeedQuantizer.h +++ b/include/imalgs/FIMSpeedQuantizer.h @@ -14,10 +14,10 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** -#include "public/Logging.h" +#include "loader/Logging.h" #include "scalar/Length.h" #include "scalar/Speed.h" #include "utility/BoundedValue.h" @@ -94,4 +94,4 @@ inline Units::Length FIMSpeedQuantizer::GetFirstToMiddleQuantizationTransitionDi } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/IMAchieve.h b/include/imalgs/IMAchieve.h index df84869..bae8b3c 100644 --- a/include/imalgs/IMAchieve.h +++ b/include/imalgs/IMAchieve.h @@ -14,20 +14,24 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once -#include "imalgs/IMAlgorithm.h" #include + +#include +#include +#include + +#include "imalgs/IMAlgorithm.h" #include "public/PredictedWindEvaluator.h" namespace interval_management { namespace open_source { class IMAchieve : public IMAlgorithm { - public: static const Units::Angle TOLERANCE_ANGLE; @@ -57,8 +61,6 @@ class IMAchieve : public IMAlgorithm { virtual const bool InAchieveStage() const; - const Units::Length GetTargetKinematicDtgToTrp() const; - const bool IsWithinErrorThreshold() const; void SetBlendWind(bool wind_blending_enabled) override; @@ -87,10 +89,10 @@ class IMAchieve : public IMAlgorithm { static const std::shared_ptr m_predicted_wind_evaluator; - bool m_transitioned_to_maintain; - bool m_within_error_threshold; - bool m_received_one_valid_target_state; - std::string m_achieve_by_point; + bool m_transitioned_to_maintain{false}; + bool m_within_error_threshold{false}; + bool m_received_one_valid_target_state{false}; + std::string m_achieve_by_point{}; private: void IterClearIMAch(); @@ -106,8 +108,6 @@ inline const bool IMAchieve::IsTargetPassedLastWaypoint() const { return m_target_kinematic_dtg_to_last_waypoint <= Units::zero(); } -inline const Units::Length IMAchieve::GetTargetKinematicDtgToTrp() const { return m_target_kinematic_dtg_to_trp; } - inline const bool IMAchieve::IsWithinErrorThreshold() const { return m_within_error_threshold; } inline const bool IMAchieve::IsOwnshipBelowTransitionAltitude(Units::Length current_ownship_altitude) { return false; } @@ -134,4 +134,4 @@ inline void IMAchieve::SetBlendWind(bool wind_blending_enabled) { /* required by class */ } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/IMAlgorithm.h b/include/imalgs/IMAlgorithm.h index 2b5467b..9fe00aa 100644 --- a/include/imalgs/IMAlgorithm.h +++ b/include/imalgs/IMAlgorithm.h @@ -14,26 +14,31 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include +#include +#include +#include + +#include +#include +#include + +#include "imalgs/AircraftState.h" #include "imalgs/FIMConfiguration.h" -#include "public/Guidance.h" +#include "imalgs/FIMSpeedLimiter.h" +#include "imalgs/IMClearance.h" +#include "loader/Logging.h" #include "public/AircraftIntent.h" -#include "imalgs/AircraftState.h" -#include "public/Logging.h" +#include "public/BadaUtils.h" +#include "public/Guidance.h" #include "public/StatisticalPilotDelay.h" -#include "public/ThreeDOFDynamics.h" #include "public/TangentPlaneSequence.h" -#include -#include -#include -#include -#include "public/BadaUtils.h" -#include "imalgs/IMClearance.h" -#include "imalgs/FIMSpeedLimiter.h" +#include "public/ThreeDOFDynamics.h" namespace interval_management { namespace open_source { @@ -46,15 +51,15 @@ class IMAlgorithm { enum FlightStage { UNSET = -1, NONE = 0, ACHIEVE = 1, MAINTAIN = 2 }; struct OwnshipPredictionParameters { - Units::Angle maximum_allowable_bank_angle; - Units::Speed transition_ias; - double transition_mach; - Units::Length transition_altitude; - Units::Length expected_cruise_altitude; - aaesim::open_source::bada_utils::FlapSpeeds flap_speeds; - aaesim::open_source::bada_utils::FlightEnvelope flight_envelope; - aaesim::open_source::bada_utils::Mass mass_data; - aaesim::open_source::bada_utils::Aerodynamics aerodynamics; + Units::Angle maximum_allowable_bank_angle{}; + Units::Speed transition_ias{}; + double transition_mach{0}; + Units::Length transition_altitude{}; + Units::Length expected_cruise_altitude{}; + aaesim::open_source::bada_utils::FlapSpeeds flap_speeds{}; + aaesim::open_source::bada_utils::FlightEnvelope flight_envelope{}; + aaesim::open_source::bada_utils::Mass mass_data{}; + aaesim::open_source::bada_utils::Aerodynamics aerodynamics{}; }; IMAlgorithm(); @@ -273,7 +278,7 @@ class IMAlgorithm { Units::Frequency m_achieve_control_gain; Units::Frequency m_maintain_control_gain; Units::Time m_time_threshold; - bool m_threshold_flag; + bool m_threshold_flag{false}; private: void IterClearIMAlg(); diff --git a/include/imalgs/IMClearance.h b/include/imalgs/IMClearance.h index 921f336..9d40ec9 100644 --- a/include/imalgs/IMClearance.h +++ b/include/imalgs/IMClearance.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -27,8 +27,8 @@ #include #include "imalgs/IMUtils.h" +#include "loader/Logging.h" #include "public/AircraftIntent.h" -#include "public/Logging.h" namespace interval_management { namespace open_source { @@ -93,13 +93,13 @@ class IMClearance final { ClearanceType GetClearanceType() const { return m_builder_clearance_type; }; SpacingGoalType GetSpacingGoalType() const { return m_builder_assigned_spacing_goal_type; }; - AircraftIntent GetTargetAircraftIntent() const { return m_builder_target_aircraft_intent; }; - AircraftIntent GetOwnshipAircraftIntent() const { return m_builder_ownship_intent; }; + const AircraftIntent &GetTargetAircraftIntent() const { return m_builder_target_aircraft_intent; }; + const AircraftIntent &GetOwnshipAircraftIntent() const { return m_builder_ownship_intent; }; Units::RadiansAngle GetMergeAngleMean() const { return m_builder_final_approach_spacing_merge_angle_mean; }; Units::RadiansAngle GetMergeAngleStd() const { return m_builder_final_approach_spacing_merge_angle_std; }; - std::string GetAchieveByPoint() const { return m_builder_achieve_by_point; }; - std::string GetPlannedTerminationPoint() const { return m_builder_planned_termination_point; }; - std::string GetTrafficReferencePoint() const { return m_builder_traffic_reference_point; }; + const std::string &GetAchieveByPoint() const { return m_builder_achieve_by_point; }; + const std::string &GetPlannedTerminationPoint() const { return m_builder_planned_termination_point; }; + const std::string &GetTrafficReferencePoint() const { return m_builder_traffic_reference_point; }; double GetAssignedSpacingGoal() const { return m_builder_assigned_spacing_goal; }; int GetTargetId() const { return m_builder_target_id; }; bool IsVectorAircraft() const { return m_builder_is_vector_aircraft; }; diff --git a/include/imalgs/IMClearanceLoader.h b/include/imalgs/IMClearanceLoader.h index 7f7739c..7d62a5c 100644 --- a/include/imalgs/IMClearanceLoader.h +++ b/include/imalgs/IMClearanceLoader.h @@ -14,16 +14,17 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once #include +#include #include "imalgs/IMClearance.h" #include "loader/Loadable.h" -#include "public/Logging.h" +#include "loader/Logging.h" namespace interval_management { @@ -69,4 +70,4 @@ class IMClearanceLoader final : public Loadable { bool m_is_vector_aircraft; }; -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/IMDistBasedAchieve.h b/include/imalgs/IMDistBasedAchieve.h index 7ad566e..36b4200 100644 --- a/include/imalgs/IMDistBasedAchieve.h +++ b/include/imalgs/IMDistBasedAchieve.h @@ -14,11 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include +#include +#include + #include "imalgs/IMKinematicAchieve.h" #include "imalgs/IMKinematicDistBasedMaintain.h" #include "imalgs/TrueDistances.h" @@ -197,4 +201,4 @@ inline const interval_management::open_source::AircraftState IMDistBasedAchieve: return m_target_state_projected_on_ownships_path_at_adjusted_distance; } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/IMKinematicAchieve.h b/include/imalgs/IMKinematicAchieve.h index 516f59c..4975204 100644 --- a/include/imalgs/IMKinematicAchieve.h +++ b/include/imalgs/IMKinematicAchieve.h @@ -14,11 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include +#include +#include + #include "imalgs/AchievePointCalcs.h" #include "imalgs/IMAchieve.h" #include "imalgs/IMKinematicTimeBasedMaintain.h" @@ -246,4 +250,4 @@ inline void IMKinematicAchieve::SetTangentPlaneSequence(std::shared_ptr +#include + #include "imalgs/AchievePointCalcs.h" #include "imalgs/IMMaintain.h" #include "imalgs/TrueDistances.h" @@ -100,4 +103,4 @@ inline const void IMKinematicDistBasedMaintain::SetImSpeedCommandIas(Units::Spee m_im_speed_command_ias = im_speed; } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/IMKinematicTimeBasedMaintain.h b/include/imalgs/IMKinematicTimeBasedMaintain.h index c0b6948..eb70104 100644 --- a/include/imalgs/IMKinematicTimeBasedMaintain.h +++ b/include/imalgs/IMKinematicTimeBasedMaintain.h @@ -14,18 +14,20 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once -#include +#include +#include -#include "imalgs/IMMaintain.h" -#include "public/KinematicTrajectoryPredictor.h" -#include "imalgs/TrueDistances.h" #include "imalgs/AchievePointCalcs.h" #include "imalgs/AircraftState.h" +#include "imalgs/IMMaintain.h" +#include "imalgs/TrueDistances.h" +#include "nlohmann/json.hpp" +#include "public/KinematicTrajectoryPredictor.h" namespace interval_management { namespace open_source { diff --git a/include/imalgs/IMMaintain.h b/include/imalgs/IMMaintain.h index 6ed2487..330c5a7 100644 --- a/include/imalgs/IMMaintain.h +++ b/include/imalgs/IMMaintain.h @@ -14,16 +14,20 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once #include +#include +#include + #include "imalgs/IMAchieve.h" #include "imalgs/IMAlgorithm.h" #include "public/EuclideanTrajectoryPredictor.h" + namespace interval_management { namespace open_source { @@ -73,4 +77,4 @@ class IMMaintain : public IMAlgorithm { inline void IMMaintain::SetBlendWind(bool wind_blending_enabled) { /* required by the interface, but not used */ } } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/IMTimeBasedAchieve.h b/include/imalgs/IMTimeBasedAchieve.h index ecd9220..4c29437 100644 --- a/include/imalgs/IMTimeBasedAchieve.h +++ b/include/imalgs/IMTimeBasedAchieve.h @@ -14,13 +14,18 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include +#include +#include + #include "imalgs/IMKinematicAchieve.h" #include "loader/Loadable.h" + namespace interval_management { namespace open_source { class IMTimeBasedAchieve : public IMKinematicAchieve { diff --git a/include/imalgs/IMTimeBasedAchieveMutableASG.h b/include/imalgs/IMTimeBasedAchieveMutableASG.h index b051749..6259b48 100644 --- a/include/imalgs/IMTimeBasedAchieveMutableASG.h +++ b/include/imalgs/IMTimeBasedAchieveMutableASG.h @@ -14,11 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include +#include +#include + #include "IMTimeBasedAchieve.h" /** @@ -75,4 +79,4 @@ class IMTimeBasedAchieveMutableASG final : public IMTimeBasedAchieve { Units::SecondsTime m_asg_change_increment; }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/IMUtils.h b/include/imalgs/IMUtils.h index c4eb627..52b8fb6 100644 --- a/include/imalgs/IMUtils.h +++ b/include/imalgs/IMUtils.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -22,15 +22,17 @@ #include #include +#include #include +#include #include #include "imalgs/AircraftState.h" +#include "loader/Logging.h" #include "public/AircraftIntent.h" #include "public/AircraftState.h" #include "public/AlongPathDistanceCalculator.h" #include "public/HorizontalPath.h" -#include "public/Logging.h" #include "utility/BoundedValue.h" class IMUtils final { diff --git a/include/imalgs/InternalObserver.h b/include/imalgs/InternalObserver.h index a1b4d82..1a45998 100644 --- a/include/imalgs/InternalObserver.h +++ b/include/imalgs/InternalObserver.h @@ -14,23 +14,26 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once -#include -#include +#include +#include #include +#include +#include + +#include "imalgs/AchieveObserver.h" +#include "imalgs/ClosestPointMetric.h" +#include "imalgs/CrossTrackObserver.h" +#include "imalgs/MaintainMetric.h" +#include "imalgs/MergePointMetric.h" +#include "imalgs/NMObserver.h" #include "public/AircraftState.h" #include "public/Guidance.h" #include "public/WeatherPrediction.h" -#include "imalgs/NMObserver.h" -#include "imalgs/MergePointMetric.h" -#include "imalgs/CrossTrackObserver.h" -#include "imalgs/AchieveObserver.h" -#include "imalgs/MaintainMetric.h" -#include "imalgs/ClosestPointMetric.h" namespace interval_management { namespace open_source { @@ -54,8 +57,9 @@ class InternalObserver final { void outputClosestPointMetric(); void addPredictedWind(int id, const aaesim::open_source::WeatherPrediction &weatherPrediction); std::string predWindsHeading(int lastIx); - std::string predWindsData(int id, int row, std::string field, const aaesim::open_source::WindStack &mat); - std::string predTempData(int id, std::string field, const aaesim::open_source::WeatherPrediction &weatherPrediction); + std::string predWindsData(int id, int row, const std::string &field, const aaesim::open_source::WindStack &mat); + std::string predTempData(int id, const std::string &field, + const aaesim::open_source::WeatherPrediction &weatherPrediction); void addAchieveRcd(size_t aircraftId, double tm, double target_ttg_to_ach, double own_ttg_to_ach, double curr_distance, double reference_distance); NMObserver &GetNMObserver(int id); diff --git a/include/imalgs/InternalObserverScenarioWriter.h b/include/imalgs/InternalObserverScenarioWriter.h index 83ea4c2..722b243 100644 --- a/include/imalgs/InternalObserverScenarioWriter.h +++ b/include/imalgs/InternalObserverScenarioWriter.h @@ -14,11 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include + #include "public/ScenarioEventNotifier.h" namespace interval_management::open_source { diff --git a/include/imalgs/MOPSPredictedWindEvaluatorVersion1.h b/include/imalgs/MOPSPredictedWindEvaluatorVersion1.h index 850c3ef..76bbc17 100644 --- a/include/imalgs/MOPSPredictedWindEvaluatorVersion1.h +++ b/include/imalgs/MOPSPredictedWindEvaluatorVersion1.h @@ -14,11 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include + #include "public/PredictedWindEvaluator.h" namespace interval_management { diff --git a/include/imalgs/MOPSPredictedWindEvaluatorVersion2.h b/include/imalgs/MOPSPredictedWindEvaluatorVersion2.h index 73cdd1f..76faed7 100644 --- a/include/imalgs/MOPSPredictedWindEvaluatorVersion2.h +++ b/include/imalgs/MOPSPredictedWindEvaluatorVersion2.h @@ -14,11 +14,13 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once +#include + #include "public/PredictedWindEvaluator.h" namespace interval_management { diff --git a/include/imalgs/MaintainMetric.h b/include/imalgs/MaintainMetric.h index b64b4da..03336fa 100644 --- a/include/imalgs/MaintainMetric.h +++ b/include/imalgs/MaintainMetric.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -83,4 +83,4 @@ class MaintainMetric final { bool m_output_enabled{false}; }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/MergePointMetric.h b/include/imalgs/MergePointMetric.h index 364a73e..3daee54 100644 --- a/include/imalgs/MergePointMetric.h +++ b/include/imalgs/MergePointMetric.h @@ -14,13 +14,15 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once #include +#include + #include "public/AircraftIntent.h" namespace interval_management { @@ -39,7 +41,7 @@ class MergePointMetric final { void update(double imXNew, double imYNew, double targXNew, double targYNew); // Gets merge point (waypoint name). - std::string getMergePoint(); + const std::string &getMergePoint(); // Gets computed distance. Units::Length getDist(); @@ -78,4 +80,4 @@ class MergePointMetric final { }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/NMObserver.h b/include/imalgs/NMObserver.h index b3a6f08..36c55d4 100644 --- a/include/imalgs/NMObserver.h +++ b/include/imalgs/NMObserver.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -53,4 +53,4 @@ class NMObserver final { void initialize_stats(); }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/NMObserverEntry.h b/include/imalgs/NMObserverEntry.h index 413f69b..f39a31e 100644 --- a/include/imalgs/NMObserverEntry.h +++ b/include/imalgs/NMObserverEntry.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -41,4 +41,4 @@ class NMObserverEntry final { }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/PredictionFileKinematic.h b/include/imalgs/PredictionFileKinematic.h index 0a1f427..987583c 100644 --- a/include/imalgs/PredictionFileKinematic.h +++ b/include/imalgs/PredictionFileKinematic.h @@ -14,13 +14,18 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once -#include "public/PredictionFileBase.h" +#include +#include +#include +#include + #include "public/FlightDeckApplication.h" +#include "public/PredictionFileBase.h" namespace interval_management::open_source { class PredictionFileKinematic final : private PredictionFileBase, public OutputHandler { @@ -42,4 +47,4 @@ class PredictionFileKinematic final : private PredictionFileBase, public OutputH static log4cplus::Logger logger; }; -} // namespace interval_management::open_source \ No newline at end of file +} // namespace interval_management::open_source diff --git a/include/imalgs/Statistics.h b/include/imalgs/Statistics.h index 8e3b513..cc22543 100644 --- a/include/imalgs/Statistics.h +++ b/include/imalgs/Statistics.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -55,4 +55,4 @@ class Statistics final { double m_min{0}; }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/include/imalgs/TrueDistances.h b/include/imalgs/TrueDistances.h index ce1b370..df8626c 100644 --- a/include/imalgs/TrueDistances.h +++ b/include/imalgs/TrueDistances.h @@ -14,7 +14,7 @@ // For further information, please contact The MITRE Corporation, Contracts Management // Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000. // -// 2023 The MITRE Corporation. All Rights Reserved. +// (c) 2026 The MITRE Corporation. All Rights Reserved. // **************************************************************************** #pragma once @@ -49,4 +49,4 @@ class TrueDistances final { std::vector m_true_distances; }; } // namespace open_source -} // namespace interval_management \ No newline at end of file +} // namespace interval_management diff --git a/unittest/src/main.cpp b/unittest/src/main.cpp index 26b5213..54f51ca 100644 --- a/unittest/src/main.cpp +++ b/unittest/src/main.cpp @@ -18,7 +18,7 @@ // **************************************************************************** #include "gtest/gtest.h" -#include "public/Logging.h" +#include "loader/Logging.h" #include GTEST_API_ int main(int argc, char **argv) {