Version 42 (modified by 12 years ago) (diff) | ,
---|
Scoring Formulas
Create a scoring formula (!! 20090517: NOTE: explanation is under work, by no means complete (or even correct) !!)
Does only apply to FS versions >= 1.2.13 (the prinsiple is the same for earlier versions but some details differ).
- Create a DLL (Class Library) named "!FsSf_<formula id>.dll".
- Set a reference to FsSf.dll.
- Set AssemblyTitle to <formula id>.
- Set AssemblyDescription to the description that should show when one select scoring formula in FS.
- Create a class named "Sf" implementing the interface FsSf.Isf
(public class Sf : !FsSf.ISf ...
) - Compile and put the DLL in the folder where FsComp.exe is and it should show up on the list for selecting a scoring formula.
The "EditScoreFormula" method is called from FsComp when one select and edits a scoring formula.
The "ScoreTask" method is called when the menuitem Tasks > Score Task is used, or when any report is created (Reports > ...) and the task needs to be scored because there has been changes.
(any time one changes anything about one or more pilot's flightdata in a task, all FsResult? elements for that task will be removed).
From FsSf.dll:
/* XML elements that have usefull information about the task and flightdata: FsScoreFormula (attributes are set by the EditScoreFormula method) FsTaskScoreParams (attributes are calculated before the ScoreTask method is called) FsParticipants/FsParticipant/FsFlightData FsParticipants/FsParticipant/FsResult Example of FsTaskScoreParams: ss_distance="37.706" task_distance="39.901" no_of_pilots_present="46" no_of_pilots_flying="45" no_of_pilots_lo="6" no_of_pilots_reaching_nom_dist="45" no_of_pilots_reaching_es="39" no_of_pilots_reaching_goal="39" sum_flown_distance="1659.459" best_dist="39.902" best_time="0.896388888888889" worst_time="2.06222222222222" no_of_pilots_in_competition="63" */ namespace ... { public interface ISf { /// <summary> /// Should only change the FsParticipants/FsParticipant/FsResult under the xe_task_clone element. /// Remove any existing FsResult elements and add a new one for each pilot in task that has a FsFlightData element. /// FsParticipants/FsParticipant elements with no FsFlightData element is ABS and should not be counted in scoring. /// Empty FsFlightData element means DNF. DNF pilot may affect scoring. /// Best not to change anything else or FS might be confused. /// </summary> /// <param name="xe_task_clone">A clone of FsTask element. Should not have any parent. /// To access the rest of the fsdb xml document use OwnerDocument property of the param.</param> /// <param name="msg">any messages regarding scoring</param> /// <returns>true if task was scored, false if not.</returns> bool ScoreTask(XmlElement xe_task_clone, out string msg); /// <summary> /// Should provide a UI for setting scoring formula params. /// Should only change the xe_sf_clone element. /// Best not to change anything else or FS might be confused. /// </summary> /// <param name="xe_sf_clone">A clone of a FsScoreFormula element. Should not have any parent. /// To access the rest of the fsdb xml document use OwnerDocument property of the param.</param> /// <returns>Return true if any changes to xe_sf_clone where done, false if not.</returns> bool EditScoreFormula(XmlElement xe_sf_clone); } }
Attachments (9)
- Gap2000_2002_no_lc_in_FS.png (2.0 KB) - added by 13 years ago.
- Gap2002_lc_in_FS.png (2.0 KB) - added by 13 years ago.
-
OzGap2005_in_FS.png (2.0 KB) - added by 13 years ago.
How to set FS GAP scoring formula to get !OzGap2005
-
scoring_formulas.xls (24.5 KB) - added by 13 years ago.
Excel Workbook with GAP2000/2002 and !OzGap2005 formulas simulated
-
GAP02_en.pdf (187.4 KB) - added by 11 years ago.
GAP explained (from 2002, some details are no longer correct but the general idéa is)
-
thegapguide.pdf (11.9 KB) - added by 11 years ago.
Another GAP guide, by Nigel Leigh
-
GapGuide-2011-v1.pdf (740.2 KB) - added by 10 years ago.
GAP versions and options explained
-
modGAP.bas (31.6 KB) - added by 10 years ago.
VB code from the last implementation of GAP in RACE
-
GAP2008_some_distance_score_code.txt (12.2 KB) - added by 10 years ago.
Some code related to distance score in GAP2008
Download all attachments as: .zip