-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapx-bonus-distance-use.tex
327 lines (299 loc) · 9.29 KB
/
apx-bonus-distance-use.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
% !TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode
\documentclass[gap.tex]{subfiles}
\begin{document}
\label{sec:bonus-distance-use}
\begin{quote}
For all distance point calculations, including the difficulty calculations
in hang-gliding (see ~\ref{sec:difficulty-calculation}), these new stopped
distance values are being used to determine the pilots’ best distance
values. Time and leading point calculations remain the same: they are not
affected by the altitude bonus or stopped distance values.
\end{quote}
This appendix, expands on this brief but broad statement (see
~\ref{sec:distance-stopped-tasks}) showing how and when bonus distance or real
distance is used in calculating validities and weights and when allocating
points in FS.
Launch validity doesn't depend on distance. Distance validity and stop validity
depend on real distance but time validity depends on bonus
distance\footnote{Time validity and stop validity depend on distance only if no
pilot makes it to the end of the speed section.\label{fn:repeat}}. Task validity depends
transitively on bonus distance through time validity.
Arrival weight, departure weight and distance weight do not depend on distance.
Time weight and leading weight depend on bonus distance.
Departure point allocation doesn't depend on a pilot's distance. Distance point
allocation depends a pilot's bonus distance but arrival, time and leading point
allocation depend on a pilot's real distance.
As available points depend on task validity and this depends on bonus
distance\footref{fn:repeat}, all point allocations depend on bonus
distance indirectly.
\begin{table}[!ht]
\begin{tabularx}{\textwidth}{|l|X|c|c|}
\hline
\textbf{Aspect of Scoring}
& \textbf{Part of Aspect}
& \textbf{Real}
& \textbf{Bonus}
\\
\hline
\multirow{5}{*}{Validity}
& Launch
&
&
\\
\cline{2-4}
& Distance
& $\checkmark$
&
\\
\cline{2-4}
& Time
&
& $\checkmark$
\\
\cline{2-4}
& Stop
& $\checkmark$
&
\\
\cline{2-4}
& Task (Day Quality)
&
& $\checkmark$
\\
\hline
\multirow{5}{*}{Weight}
& Arrival
&
&
\\
\cline{2-4}
& Departure
&
&
\\
\cline{2-4}
& Distance
&
&
\\
\cline{2-4}
& Time
&
& $\checkmark$
\\
\cline{2-4}
& Leading
&
& $\checkmark$
\\
\hline
\multirow{5}{*}{Allocation}
& Arrival
& $\checkmark$
&
\\
\cline{2-4}
& Departure
&
&
\\
\cline{2-4}
& Distance
&
& $\checkmark$
\\
\cline{2-4}
& Time
& $\checkmark$
&
\\
\cline{2-4}
& Leading
& $\checkmark$
&
\\
\hline
\end{tabularx}
\caption{Use of bonus distance and real distance in scoring.}
\label{tab:gap-defaults}
\end{table}
\begin{lstlisting}[style=base, caption={Launch validity doesn't depend on distance inputs.}]
double launch_validity =
CalcLaunchValidity
( sp.No_of_pilots_flying
, sp.No_of_pilots_present
, sfg
);
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Distance validity depends on \textcolor{blue}{real} distance inputs.}]
double <@distance_validity<@ =
CalcDistanceValidity
( sp.<@Sum_real_dist_over_min<@
, sp.No_of_pilots_flying
, (double)sfg.Nom_goal
, sfg.Nom_dist
, sfg.Min_dist
, sp.<@Best_real_dist<@
);
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Time validity depends on \textcolor{red}{bonus} distance input.}]
double @>time_validity@> =
CalcTimeValidity
( time_validity_time
, (double)sfg.Nom_time
, sp.@>Best_dist@>
, sfg.Nom_dist
);
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Stop validity depends on \textcolor{blue}{real} distance inputs.}]
sp.<@Sum_flown_distances<@ += p.<@_real_distance<@;
<@distances<@[distance_counter++] = p.<@_real_distance<@;
double <@avg_distance<@ = sp.<@Sum_flown_distances<@ / sp.No_of_pilots_flying;
double <@sumOfDerivation<@ = 0;
for (int i = 0; i < distances.Length; i++)
{
<@sumOfDerivation<@ += <@distances<@[i] * <@distances<@[i];
}
double <@sumOfDerivationAverage<@ = <@sumOfDerivation<@ / sp.No_of_pilots_flying;
double <@stdev_distance<@ = Math.Sqrt(<@sumOfDerivationAverage<@ - (<@avg_distance<@ * <@avg_distance<@));
double <@stop_validity<@ =
CalcStopValidity
( sfg
, sp.Last_start_time
, task_state.TaskStopTime
, sp.<@Best_real_dist<@
, sp.Launch_to_ess_distance
, <@avg_distance<@
, <@stdev_distance<@
, sp.No_of_pilots_landed_before_stop
, sp.No_of_pilots_flying
, sp.No_of_pilots_reaching_ES
, task_state.IsStopped
);
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Task validity depends on \textcolor{red}{bonus} distance (and \textcolor{blue}{real} distance).}]
double @>day_quality@> =
CalcDayQuality
( @>time_validity@>
, launch_validity
, <@distance_validity<@
, <@stop_validity<@
);
\end{lstlisting}
\pagebreak
\begin{lstlisting}[style=base, caption={Arrival weight and departure weight don't depend on distance inputs.}]
double dummy_arr_weight = 0;
if (sfg.Use_arrival_time_points && !sfg.Use_leading_points)
dummy_arr_weight = (1.0 - sp.Distance_weight) / 4.0;
else
dummy_arr_weight = (1.0 - sp.Distance_weight) / 8.0;
if (sp.No_of_pilots_reaching_ES > 0)
{
if (sfg.Use_arrival_points)
sp.Arrival_weight = dummy_arr_weight;
if (sfg.Use_departure_points)
sp.Departure_weight = dummy_arr_weight * 1.4;
}
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Distance weight doesn't depend on distance inputs.}]
sp.GoalRatio = 0;
if (sp.Best_time > 0 && sfg.Use_time_points)
{
sp.GoalRatio = sp.No_of_pilots_reaching_goal * 1.0 / sp.No_of_pilots_flying;
}
sp.Distance_weight =
0.9
- 1.665 * sp.GoalRatio
+ 1.713 * Math.Pow(sp.GoalRatio, 2)
- 0.587 * Math.Pow(sp.GoalRatio, 3);
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Time weight depends on \textcolor{red}{bonus} distance through leading weight.}]
sp.@>Time_weight@> =
(1 - sp.Distance_weight)
- sp.Arrival_weight
- sp.Departure_weight
- sp.@>Leading_weight@>;
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Leading weight depends on \textcolor{red}{bonus} distance.}]
if (sp.No_of_pilots_reaching_goal == 0
&& sfg.Use_proportional_leading_weight_if_nobody_in_goal)
{
sp.Leading_weight = Math.Min(sp.@>Best_dist@> / sp.Task_distance * 0.1d, 0.1d);
}
else
{
sp.Leading_weight = dummy_arr_weight * 1.4;
if (sfg.Double_leading_weight)
sp.Leading_weight *= 2;
}
\end{lstlisting}
\pagebreak
\begin{lstlisting}[style=base, caption={Arrival point allocation depends on \textcolor{blue}{real} distance.}]
double arrival_points = 0;
double time = p.Result.Ss_Time_Dec_Hours;
if (time > 0) // reached ES
{
double x = 0;
if (sfg.Use_arrival_position_points)
{
x = 1 - (p.Result.Finished_ss_rank - 1.0) / sp.No_of_pilots_reaching_ES;
x = 0.2 + 0.037 * x + 0.13 * Math.Pow(x, 2) + 0.633 * Math.Pow(x, 3);
}
else if (sfg.Use_arrival_time_points)
{
x = Math.Round(
Math.Pow(
1 + (2.0 / 3.0) * (sp.First_finish_time.Utc_time - p.Result.Finished_ss.Utc_time).TotalHours
, 3)
, 4, MidpointRounding.AwayFromZero);
if (x < 0) x = 0;
}
arrival_points = x * sp.Available_points_arrival;
if (p.<@_real_distance<@ < t.DistanceExact)
{
arrival_points *= (double)sfg.Time_points_if_not_in_goal;
}
}
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Distance point allocation depends on \textcolor{red}{bonus} distance.}]
if (use_difficulty)
{
double linear_fraction = dist / 2.0 / @>best_dist@>;
int kmx10 = (int)(dist * 10);
double difficulty_fraction = dsd100ms[kmx10]._score_percent;
if (dsd100ms.Length > kmx10 + 1
&& dsd100ms[kmx10 + 1]._score_percent > difficulty_fraction)
difficulty_fraction += (dsd100ms[kmx10 + 1]._score_percent - difficulty_fraction) * (dist * 10.0 - kmx10);
return (difficulty_fraction + linear_fraction) * available_points_distance;
}
else
{
double linear_fraction = dist / @>best_dist@>;
return linear_fraction * available_points_distance;
}
\end{lstlisting}
\begin{lstlisting}[style=base, caption={Time point allocation depends on \textcolor{blue}{real} distance.}]
double time_points = 0;
double time = p.Result.Ss_Time_Dec_Hours;
if (time > 0)
{
time_points
= 1 - Math.Pow
(
(
(time - sp.Best_time)
/ Math.Sqrt(sp.Best_time)
), 2.0 / 3
);
if (time_points < 0) time_points = 0;
time_points -= time_points_stop_correction;
time_points *= sp.Available_points_time;
if (p.<@RealDistance<@ < t.DistanceExact)
{
time_points *= (double)sfg.Time_points_if_not_in_goal;
p.Result.Got_time_but_not_goal_penalty = true;
}
}
\end{lstlisting}
\end{document}