本文整理汇总了C++中GlidePolar::GetInvMC方法的典型用法代码示例。如果您正苦于以下问题:C++ GlidePolar::GetInvMC方法的具体用法?C++ GlidePolar::GetInvMC怎么用?C++ GlidePolar::GetInvMC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlidePolar
的用法示例。
在下文中一共展示了GlidePolar::GetInvMC方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSafetyHeight
void
RoutePolars::Initialise(const GlideSettings &settings, const GlidePolar &polar,
const SpeedVector &wind,
const int _height_min_working)
{
polar_glide.Initialise(settings, polar, wind, true);
polar_cruise.Initialise(settings, polar, wind, false);
inv_mc = MC_CEILING_PENALTY_FACTOR * polar.GetInvMC();
height_min_working = std::max(0, _height_min_working - GetSafetyHeight());
}
示例2: fixed
void
RoutePolars::Initialise(const GlideSettings &settings, const GlidePolar &polar,
const SpeedVector &wind)
{
polar_glide.Initialise(settings, polar, wind, true);
polar_cruise.Initialise(settings, polar, wind, false);
const fixed imc = polar.GetInvMC();
if (positive(imc))
inv_mc = fixed(MC_CEILING_PENALTY_FACTOR) * imc;
else
inv_mc = fixed(0);
}
示例3: p_start
bool
AbortTask::FillReachable(const AircraftState &state,
AlternateVector &approx_waypoints,
const GlidePolar &polar, bool only_airfield,
bool final_glide, bool safety)
{
if (IsTaskFull() || approx_waypoints.empty())
return false;
const AGeoPoint p_start(state.location, state.altitude);
bool found_final_glide = false;
reservable_priority_queue<Alternate, AlternateVector, AbortRank> q;
q.reserve(32);
for (auto v = approx_waypoints.begin(); v != approx_waypoints.end();) {
if (only_airfield && !v->waypoint.IsAirport()) {
++v;
continue;
}
UnorderedTaskPoint t(v->waypoint, task_behaviour);
GlideResult result =
TaskSolution::GlideSolutionRemaining(t, state, polar);
/* calculate time_virtual, which is needed by AbortRank */
result.CalcVInvSpeed(polar.GetInvMC());
if (IsReachable(result, final_glide)) {
bool intersects = false;
const bool is_reachable_final = IsReachable(result, true);
if (intersection_test && final_glide && is_reachable_final)
intersects = intersection_test->Intersects(
AGeoPoint(v->waypoint.location, result.min_height));
if (!intersects) {
q.push(Alternate(v->waypoint, result));
// remove it since it's already in the list now
approx_waypoints.erase(v);
if (is_reachable_final)
found_final_glide = true;
continue; // skip incrementing v since we just erased it
}
}
++v;
}
while (!q.empty() && !IsTaskFull()) {
const Alternate top = q.top();
task_points.push_back(AlternateTaskPoint(top.waypoint, task_behaviour,
top.solution));
const int i = task_points.size() - 1;
if (task_points[i].GetWaypoint().id == active_waypoint)
active_task_point = i;
q.pop();
}
return found_final_glide;
}