Ejemplo n.º 1
0
bool 
AATPoint::close_to_target(const AIRCRAFT_STATE& state, const fixed threshold) const
{
  if (!valid())
    return false;

  return (double_leg_distance(m_target_location)-double_leg_distance(state.Location)
          <= threshold);
}
Ejemplo n.º 2
0
bool
AATPoint::check_target_inside(const AIRCRAFT_STATE& state) 
{
  // target must be moved if d(p_last,t)+d(t,p_next) 
  //    < d(p_last,state)+d(state,p_next)

  if (close_to_target(state)) {
    if (positive(double_leg_distance(state.Location)
                 -double_leg_distance(get_location_max()))) {
      // no improvement available
      return false;
    } else {
      m_target_location = state.Location;
      return true;
    }
  } else {
    return false;
  }
}