-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use with FAI scoring rules #94
Comments
You need to edit |
I added the change to the scoring rules here: My problem is that it's not doing the optimal calculation. The best point would not be on the track, but between the "head" and the "tail" of the tracklog, as illustrated here. Do you think you can modify the app to make such calculations? Are FFVL and XContest calculating the closing differently? Also, what is the difference between code: |
An |
Sure, it's here: https://www.fai.org/sites/default/files/civl/documents/sporting_code_s7_d_-_records_and_badges_2022.pdf It's not an easy read, but I believe it's like on my drawing: |
Ok, so in fact all turnpoints and the start/finish points are 400m cylinders? |
In fact this rule can be interpreted as a 800m closing rule? It is a bijection:
|
I think a straight 800 meter line is not optimal. The optimal solution would be a "buffer" operation around both polylines and then finding the furthest point on this polygon. |
I think that it is. You think that a 800m rule will leave out points that will be included in the buffers? I don't see any case where this is possible? |
It's very close to optimal but not optimal. I don't know how much we want to optimise those few meters though. I made a Geogebra sketch. The left point is the 800 meter midpoint, the right point is the optimal one. A very simple algorithm I could imagine is:
|
|
It's true but FAI calculates by the triangle sides, which in our case is determined by the center of the circle. |
Do you mean the turnpoints or the closing? The placement of the closing center does not influence the score, only the part of the track that is included or not influences the score. But this is not true for the turnpoints, this was my first question? |
The FAI document is really quite low in details, but here is how I understand it:
|
All FAI rules use 400m cylinders. This means that if you are following a predefined task, you must cross into the 400m cylinder for the turnpoint to be considered attained. I wonder if there is some clever way to calculate the size of the biggest triangle that has vertices lying on equal circles around the given triangle - there probably is - as this will be much easier to implement. |
In the FAI rules, every time they calculate using the center of a cylinder (in declared records), you always have to subtract 2 * 400 meters for that cylinder. With straight or straight-with-3-points free distance records, you don't use cylinders, thus you don't need to subtract 2*400 meters for them. Now for this case, it's really not clear. I'd believe that we cannot cheat, thus if we don't subtract then we have to take the closest points of those circles. (This is the reason why I wrote that for the 2 mid-points it doesn't make any sense to add a circle and then select the original point in the next step). I'll ask them about clarification, it makes no sense to develop the wrong method :-) |
Do you have any examples of scored flights? |
Unfortunately here they don't provide any details: https://www.fai.org/records?f%5B0%5D=field_record_sport%3A2026&f%5B1%5D=field_record_category%3A125&f%5B2%5D=field_subclass%3A231&f%5B3%5D=field_type_of_record%3A330 I wrote them an email asking for clarifications. |
I got an answer from FAI:
So I believe we can put these circles wherever we want, the calculation is through the centers - 3 * 800 meters. |
The way I understand this is that the current scoring method is the right one - because it measures the triangle from the points on the flight track - which are 400m away from the turnpoint - however the placement of the turnpoints is not - because they must be further away. But I don't understand the significance of the 400m for the Start/Finish point since the placement of the Start/Finish point is not supposed to have any effect on the score - except for yes/no validity of the triangle. Can you find at least one example of a scored triangle flight? |
If this is indeed the case, I think this may be done without modifying the underlying search algorithm - once the inner triangle is found, the outer one can be directly computed. |
I think for the mid-points we can do that, yes. For the start/endpoint I have no other idea but to make a one-off gradient descent-like algorithm. FAI replied that they use SeeYou, which optimises the distances totally bad. So it's good to know that there is no software which can actually optimise for what FAI is writing in Section 7D. If we can modify igc-xc-score it'd be the first software to do this correctly. |
I don't think there is anything to do for the start finish point? It does not participate in the score at all - it is only about validity - yes/no. Those triangles can be calculated from their medians - the medians of the outer triangle are exactly the medians of the inner triangle + 400m. This means that:
for each median |
I think I just figured it out. Basically igc-xc-score is doing everything perfect as it is now, with The drawing in Section 7D about the triangle are wrong.
Basically the question is if the "Mercedes star" type FAI triangles are allowed or not. I really believe they are, and this simplifies our calculation a lot! Here is an example current world record which is a "Mercedes star" like: igc-xc-score calculates 269.12 km, the FAI record was 269.13 km. So we have 5 points to optimise: TP1, TP2, TP3, start (cp_in), end (cp_out), which is working perfectly in the current version. |
I just did run this IGC and my results are 269.12 when using Vincenty's method ( I think that it is up to the FAI to clarify this situation. Their official document states that distances are to be measured according the WGS84 ellipsoid. However (there is a very length explanation about this in the project's README), there is no analytical method for calculating this distance. There is the FTC approximation and there is the iterative Vincenty's method which can be repeated as many times as it is needed to obtain arbitrary precision - igc-xc-score stops at 60cm. Most practical applications use the FTC method which is much faster since normally a distance of 10m won't matter that much over 270km - but since this is a world record, there should probably be a very strict official method for measuring it. Also, when it comes to scoring the flight, there is one more point that I forgot about - the |
I think for the measurement it has to be Vincenty, that is the reference calculation for geographic distances. FAI currently uses SeeYou which from my experimenting produces the least precise calculation, GPSDump does a much more precise one for example. For |
Not strictly this ticket, but related: this flight gets calculated as 141 km in igc-xc-score (XContest profile) and 138 km in XContest. Do you know what could be the reason? Better optimisation or some rules are wrong? |
I am sorry for the late reply, but I was exceptionally busy. The two programs produce a nearly identical scoring: 220.88 for XContest and 221.15 for igc-xc-score. The 3km difference comes from the fact that igc-xc-score displays the total distance of the triangle and the penalty for the closing distance while XContest displays the total distance of the triangle minus the penalty. The 200m difference comes from the higher resolution used by igc-xc-score - the XContest scoring has simplified the line, eliminating some points. igc-xc-score considers every point coming from the GPS. |
@hyperknot After going once again very carefully through the FAI sporting code, section 5.2.5: I concluded that when closing an out-and-return distance to one turnpoint, the actual point used must lie on the middle of the 800m closing line - not on the best end. Can you confirm this? Only the FAI OaR is concerned by this rule - this is the only type of flight where the exact position of the closing line matters. |
@hyperknot I implemented the cylinders, but alas, I don't have any ideal solution for Free distance around 3 TPs - I will continue trying, but I am afraid that the current approach cannot be applied to those flights when they are scored using cylinders... |
@hyperknot I have implemented what I think is the perfect scoring according to all FAI rules in the sporting code, section 7D. |
@mmomtchev this sounds great, thanks a lot for the huge effort! I'll need time to properly test these things, I'll try to look at them in detail over the weekend. |
@mmomtchev I'm looking at it now, trying to score this flight as FAI out-and-return. What is the difference between OAR1 and 2 (and boundOutAndReturn, scoreOutAndReturn)? |
I get
for oar2. |
Can you post the config file you used? OAR2 is the XCLeague definition of an out-and-return distance flight - which is equivalent to the 2 turnpoints FAI flight. |
You can simply remove |
I used igc-xc-score/scoring-rules.config.js Line 196 in d3ff50c
|
Thanks, that's it. I think with that it's perfect! |
Actually there is a possible bug:
|
Sorry, my bad, if you are removing |
Clear. I think we can settle on FAI-OAR like this:
One question: what does the (400m) in the bracket mean? I guess it's the non-subtracted closing distance, but it's a bit confusing in those lines: TP1 : TP2 : 103.73km (0.400km) |
@hyperknot, what about the cylinders for the triangles? |
I believe this should be it:
I compared it with Brigitte's record in this post and this is what gives consistent answers to the official score: |
So I currently believe that neither for Triangle nor for OAR the cylinders should be used. Their current "reference" software is SeeYou, which doesn't do anything with cylinder. For OAR the closing point at the midpoint is I believe the optimal point. For Triangle what is your opinion? It would be optimal at midpoint but too expensive to calculate or implement? |
For triangles, the closing does not require optimization - it is a deterministic problem that can be solved by a direct approach - a classical nearest-neighbor problem - which is a very well studied problem in computational geometry. Currently, for all flights except OAR1, once the turn points have been selected, the shortest closing is found. |
OAR1 has only 1 turnpoint and a closing which also serves as the second turnpoint - placed on the middle of the closing line. OAR2 is a classical circuit flight - it has two turnpoints - and a triangle-style closing which is the other line. |
OAR1: Best solution is optimal Out-and-Return Distance 207.5 points, 207.5km, multiplier is 1 [ closing distance is 0.8km ] OAR2: Best solution is optimal Out-and-Return Flight around 2 TPs 207 points, 207.8km, multiplier is 1 [ closing distance is 0.8km ] [ penalty is 0.8km ] So OAR2's point precisely is 207.8 - 0.8 and OAR1's point is 207.5 without any penalty right? So OAR1 is a tiny bit better always right? |
OAR2 should always have a higher score. In this particular example the OAR2 flight has the closing distance as a penalty - because these are the British XCLeague rules, while the OAR1 flight has no penalty, because these are the FAI rules. |
The reason why the cylinders were so computationally expensive is that I didn't rewrite the bounding function - which was a huge task. With a good bounding function, the cylinders should not be more expensive than the rest. |
But what is OAR2 closing doing exactly? Finding the best point on the second half of the track which is <=800 meter from the first half? |
Sorry for the late reply, OAR2 is distance around two turn points. XCLeague has it - as the only out-and-return type and FAI has it - as one of its out-and-return types. FAI calls it Distance around two turn points. The optimization selects two turn points so as to maximize the distance between them, and a separate closing, the shortest possible one. The closing is not part of the scoring unless there is a penalty. |
I'd like to use this with FAI scoring rules, to evaluate record flights. With FAI rules triangle closing needs to be within 400 meter radius fixed. How can I modify it?
So far I find no solution other than copying cli.js and hard coding a different value in my version of cli.js
The text was updated successfully, but these errors were encountered: