FAI-CIVL / FAI-Airscore

AirScore - online paragliding / hanggliding GAP-based scoring software.
https://airscore.cc/
GNU General Public License v3.0
13 stars 17 forks source link

scoring stopped task hangs #162

Closed kuaka closed 3 years ago

kuaka commented 3 years ago

worker_1 | File "/app/airscore/core/task.py", line 636, in create_results worker_1 | lib.calculate_results(self) worker_1 | File "/app/airscore/core/formulas/gap2016.py", line 155, in calculate_results worker_1 | points_weight(task) worker_1 | File "/app/airscore/core/formulas/libs/gap.py", line 272, in points_weight worker_1 | task.time_points_reduction = 0 if not task.stopped_time else calculate_time_points_reduction(task) worker_1 | File "/app/airscore/core/formulas/libs/gap.py", line 445, in calculate_time_points_reduction worker_1 | return pilot_speed(t, p) worker_1 | File "/app/airscore/core/formulas/libs/gap.py", line 361, in pilot_speed worker_1 | if SF > 0: worker_1 | TypeError: '>' not supported between instances of 'complex' and 'int'

this task (111 airscore_fai) was able to be scored in devlopment branch prior to merge with "dev_candidate" it now fails

biuti commented 3 years ago

Fixed with https://github.com/FAI-CIVL/FAI-Airscore/commit/6bcad15fd36aada901338daabedbf147a6de943a.

On a side note, original version was consistent with rules:

typeOfTask = RaceToGoal ∧ numberOfStartGates =1: timePointsReduction = timePoints(taskStopTime − startTime) TypeOfTask ≠ RaceToGoal ∨ numberOfStartGates > 1: timePointsReduction = timePoints(taskStopTime − max(∀p :p ∈ StartedPilots :startTime p )) ∀p : p ∈ PilotsInGoal : finalTimePoints p = timePoints p − timePointsReduction

But this speed section time can easily be better than first in goal, causing Speed Factor formula to return complex numbers. So I suspect Rules should be:

TypeOfTask ≠ RaceToGoal ∨ numberOfStartGates > 1: timePointsReduction = timePoints(taskStopTime − max(∀p :p ∈ PilotsAtESS :startTime p ))

I'll ask Joerg.

biuti commented 3 years ago

This is Joerg answer:

About your problem: You are correct, we should only look at start times of pilots who actually get time points. So I’d use max(∀p :p ∈ PilotsInGoal :startTime p )

So I'll do the same.

biuti commented 3 years ago

https://github.com/FAI-CIVL/FAI-Airscore/commit/1b90a9127bf4ead7d168b760b203c523d9a6c545