예제 #1
0
fixed
OrderedTask::CalcMinTarget(const AircraftState &aircraft,
                           const GlidePolar &glide_polar,
                           const fixed t_target)
{
  if (stats.distance_max > stats.distance_min) {
    // only perform scan if modification is possible
    const fixed t_rem = max(fixed_zero, t_target - stats.total.time_elapsed);

    TaskMinTarget bmt(task_points, active_task_point, aircraft,
                      task_behaviour.glide, glide_polar,
                      t_rem, taskpoint_start);
    fixed p = bmt.search(fixed_zero);
    return p;
  }

  return fixed_zero;
}
예제 #2
0
inline double
OrderedTask::CalcMinTarget(const AircraftState &aircraft,
                           const GlidePolar &glide_polar,
                           const double t_target)
{
  if (stats.has_targets) {
    // only perform scan if modification is possible
    const auto t_rem = fdim(t_target, stats.total.time_elapsed);

    TaskMinTarget bmt(task_points, active_task_point, aircraft,
                      task_behaviour.glide, glide_polar,
                      t_rem, taskpoint_start);
    auto p = bmt.search(0);
    return p;
  }

  return 0;
}