ContestResult OLCSISAT::CalculateResult(const ContestTraceVector &solution) const { // build convex hull from solution SearchPointVector spv; for (unsigned i = 0; i < num_stages; ++i) spv.push_back(SearchPoint(solution[i].location)); spv.PruneInterior(); // now add leg distances making up the convex hull fixed G = fixed_zero; if (spv.size() > 1) { for (unsigned i = 0; i + 1 < spv.size(); ++i) G += spv[i].DistanceTo(spv[i + 1].GetLocation()); // closing leg (end to start) G += spv[spv.size() - 1].DistanceTo(spv[0].GetLocation()); } // R distance (start to end) const fixed R = solution[0].DistanceTo(solution[num_stages - 1].GetLocation()); // V zigzag-free distance const fixed V = G - R; // S = total distance ContestResult result = ContestDijkstra::CalculateResult(solution); result.score = ApplyHandicap((V + 3 * result.distance) / 4000); return result; }
ContestResult XContestTriangle::CalculateResult(const ContestTraceVector &solution) const { ContestResult result = OLCTriangle::CalculateResult(solution); if (positive(result.distance)) { // approximation for now: gap is distance from start to finish const fixed d_gap = GetPoint(0).GetLocation() .Distance(GetPoint(n_points - 1).GetLocation()); // award no points if gap is >20% of triangle if (d_gap > fixed(0.2) * result.distance) result.distance = fixed(0); else result.distance -= d_gap; } else result.distance = fixed(0); // DHV-XC: 2.0 or 1.75 points per km for FAI vs non-FAI triangle // XContest: 1.4 or 1.2 points per km for FAI vs non-FAI triangle const fixed score_factor = is_dhv? (is_fai? fixed(0.002): fixed(0.00175)) :(is_fai? fixed(0.0014): fixed(0.0012)); result.score = ApplyHandicap(result.distance * score_factor); return result; }
ContestResult ContestDijkstra::CalculateResult() const { assert(num_stages <= MAX_STAGES); assert(solution_valid); ContestResult result; result.time = fixed(GetPoint(solution[num_stages - 1]) .DeltaTime(GetPoint(solution[0]))); result.distance = result.score = fixed_zero; GeoPoint previous = GetPoint(solution[0]).GetLocation(); for (unsigned i = 1; i < num_stages; ++i) { const GeoPoint ¤t = GetPoint(solution[i]).GetLocation(); result.distance += current.Distance(previous); result.score += GetStageWeight(i - 1) * current.Distance(previous); previous = current; } #define fixed_fifth fixed(0.0002) result.score *= fixed_fifth; result.score = ApplyHandicap(result.score); return result; }
ContestResult OLCFAI::CalculateResult() const { ContestResult result = OLCTriangle::CalculateResult(); // 0.3 points per km result.score = ApplyHandicap(result.distance * 0.0003); return result; }
ContestResult OLCFAI::CalculateResult(const ContestTraceVector &solution) const { ContestResult result = OLCTriangle::CalculateResult(solution); // 0.3 points per km result.score = ApplyHandicap(result.distance * fixed(0.0003)); return result; }
ContestResult NetCoupe::CalculateResult() const { ContestResult result = ContestDijkstra::CalculateResult(); // 0.8 factor for free distance and 1/1000 m -> km result.score = ApplyHandicap(result.distance * fixed(0.0008)); return result; }
ContestResult OLCPlus::CalculateResult() const { ContestResult result = result_classic; result.score = ApplyHandicap((result_classic.distance + fixed(0.3) * result_fai.distance) * fixed(0.001)); return result; }
ContestResult XContestFree::CalculateResult() const { ContestResult result = ContestDijkstra::CalculateResult(); // DHV-XC: 1.5 points per km // XContest: 1.0 points per km const fixed score_factor = is_dhv ? fixed(0.0015) : fixed(0.0010); result.score = ApplyHandicap(result.distance * score_factor); return result; }
fixed XContestTriangle::CalcScore() const { // DHV-XC: 2.0 or 1.75 points per km for FAI vs non-FAI triangle // XContest: 1.4 or 1.2 points per km for FAI vs non-FAI triangle const fixed score_factor = is_dhv? (is_fai? fixed(0.002): fixed(0.00175)) :(is_fai? fixed(0.0014): fixed(0.0012)); return ApplyHandicap(CalcDistance()*score_factor); }
ContestResult OLCTriangle::CalculateResult() const { ContestResult result; result.time = (is_complete && is_closed) ? solution[4].DeltaTime(solution[0]) : 0.; result.distance = (is_complete && is_closed) ? CalcLegDistance(solution, 0) + CalcLegDistance(solution, 1) + CalcLegDistance(solution, 2) : 0.; result.score = ApplyHandicap(result.distance * 0.001); return result; }
ContestResult OLCTriangle::CalculateResult(const ContestTraceVector &solution) const { ContestResult result; result.time = n_points > 0 ? fixed(GetPoint(n_points - 1).DeltaTime(GetPoint(0))) : fixed(0); result.distance = is_complete ? CalcLegDistance(solution, 0) + CalcLegDistance(solution, 1) + CalcLegDistance(solution, 2) : fixed(0); result.score = ApplyHandicap(result.distance * fixed(0.001)); return result; }
ContestResult OLCTriangle::CalculateResult() const { ContestResult result; result.time = n_points > 0 ? fixed(GetPoint(n_points - 1).DeltaTime(GetPoint(0))) : fixed_zero; result.distance = is_complete ? CalcLegDistance(0) + CalcLegDistance(1) + CalcLegDistance(2) : fixed_zero; result.score = ApplyHandicap(result.distance * fixed(0.001)); return result; }
fixed ContestDijkstra::CalcScore() const { assert(num_stages <= MAX_STAGES); fixed score = fixed_zero; for (unsigned i = 0; i + 1 < num_stages; ++i) score += get_weighting(i) * solution[i].distance(solution[i + 1].get_location()); #define fixed_fifth fixed(0.0002) score *= fixed_fifth; return ApplyHandicap(score); }
fixed OLCPlus::CalcScore() const { return ApplyHandicap((result_classic.distance + fixed(0.3) * result_fai.distance) * fixed(0.001)); }
fixed OLCTriangle::CalcScore() const { // one point per km return ApplyHandicap(CalcDistance()*fixed(0.001)); }