Ejemplo n.º 1
0
const GeoPoint&
AATPoint::get_location_remaining() const
{
  if (getActiveState() == BEFORE_ACTIVE) {
    if (has_sampled()) {
      return get_location_max();
    } else {
      return get_location_min();
    }
  } else {
    return m_target_location;
  }
}
Ejemplo n.º 2
0
bool
AATPoint::set_range(const fixed p, const bool force_if_current)
{
  if (m_target_locked) {
    return false;
  }

  switch (getActiveState()) {
  case CURRENT_ACTIVE:
    if (!has_entered() || force_if_current) {
      m_target_location = get_location_min().interpolate(get_location_max(),p);
      return true;
    }
    return false;
  case AFTER_ACTIVE:
    if (getActiveState() == AFTER_ACTIVE) {
      m_target_location = get_location_min().interpolate(get_location_max(),p);
      return true;
    }
  default:
    return false;
  }
  return false;
}
Ejemplo n.º 3
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;
  }
}
Ejemplo n.º 4
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)) {
    const fixed d_to_max = state.Location.distance(get_location_max());
    if (d_to_max <= fixed_zero) {
      // no improvement available
      return false;
    } else {
      m_target_location = state.Location;
      return true;
    }
  } else {
    return false;
  }
}