= Scoring Formulas = == GAP2007 == id="GAP2007" GAP 2007 is GAP with options to produce GAP version 2000 or 2002 (with or without leading points) or OzGAP version 2005 as implemented in RACE. === How to achive various versions of GAP formulas === Download and use the Excel Workbook "scoring_formulas.xls" to compare FS scoring with scoring the way it is done with the GAP versions in RACE. === [wiki:RACE] v 7.1.0.18 with [wiki:OzGap2005 OzGap2005] v 4.0.0.118 === [[Image(OzGap2005_in_FS.png)]] === RACE v 7.1.0.18 with [wiki:"GAP version 2000 and 2002"] v 4.0.0.118 === Use either 2000 version of GAP with or without CompeGPS, or 2002 version not with CompeGPS. [[Image(Gap2000_2002_no_lc_in_FS.png)]] === RACE v 7.1.0.18 with GAP2002 (v 4.0.0.118) and [wiki:CompeGps CompeGPS] === Using 2002 version of GAP in RACE together with CompeGPS one get a leading coefficient value for each pilot from CompeGPS. [[Image(Gap2002_lc_in_FS.png)]] == Test scoring formula == (v 1.2) id="Test scoring formula" Just a test of scoring formula. Not to be used in competitions! Linar distance points min 500, sqrt time points. == Creating scoring formulas == (v 1.2) (for developers, requires programming knowledge) FS defines an interface that can be implemented to create new scoring formulas. Create a dll (in .NET) implementing the interface IFsSf in !FsSf.dll. The name of the dll must start with "!FsSf_" (makes it easier for FS to find what dlls that have scoring formula). Set the following Assembly Manifest Attributes as follows:[[BR]] * AssemblyTitleAttribute:[[BR]] Here goes the id of the scoring formula.[[BR]] This is used for the id attribute in the !FsScoreFormula element in the fsdb file.[[BR]] NOTE: It is important to not change this id for a given dll (filename) once it is published. If one make significant changes, make a dll with a new name and give it a new id. This way the user have the choice ... * AssemblyDescriptionAttribute:[[BR]] A short description of the formula. Detailed description should be put on this page (or on a new page with link from here). Example:[[BR]] {{{ [assembly: AssemblyTitle("GAP2007")] [assembly: AssemblyDescription("GAP 2007 is GAP with options to produce GAP version 2000 or 2002 (with or without leading points) or OzGAP version 2005 as implemented in RACE.")] }}} === IFsSf interface === Implement the following methods: * bool !ScoreTask(!XmlElement xe_task_clone, out string msg);[[BR]] 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. * 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. * msg: any messages regarding scoring * return: true if task was scored (meaning fsdb needs to be updated with xe_task_clone), false if not. * bool !EditScoreFormula(XmlElement xe_sf_clone);[[BR]] 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. * 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. * return: Return true if any changes to xe_sf_clone where done (meaning fsdb needs to be updated with xe_task_clone), false if not.