summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2014-11-07 11:31:49 +0100
committeremkael <emkael@tlen.pl>2014-11-07 11:31:49 +0100
commitf7fe50b9ee635359169598800b887c0cb3228578 (patch)
treeb01c4257b72886cd90829032d021ff79bb173df2
parent3cacae103cc71e7f34932be286e305e5078aa00b (diff)
* documentation
-rw-r--r--doc/ideas.txt2
-rw-r--r--doc/results.txt10
-rw-r--r--doc/sql.txt16
3 files changed, 11 insertions, 17 deletions
diff --git a/doc/ideas.txt b/doc/ideas.txt
index a110c72..ec8f999 100644
--- a/doc/ideas.txt
+++ b/doc/ideas.txt
@@ -14,6 +14,4 @@ WISHLIST:
- modifying disparity by time of year (or by ranking deviation from last 3-4 months)
TODO:
- - detect grid penalties (ergast.races.grid != eragst.qualifying.position) -> ergast-qualifying.csv
- - non-ergast.qualifying.position != ergast.races.grid (chicane-results.csv -> temp db -> chicane-results.csv)
- detect multi-heat (NC) races on chicanef1
diff --git a/doc/results.txt b/doc/results.txt
index 61ded84..c353368 100644
--- a/doc/results.txt
+++ b/doc/results.txt
@@ -1,14 +1,14 @@
== Scoring rules ==
Every race or ranked qualifying session results for each entry are handed ordinal numbers as "groups" in which the entry was classified.
-For qualifying, a group is simply the qualifying position (not applying any grid drop penalties, but applying disqualification/exclusion).
+For qualifying, a group is simply the qualifying position (not applying any carryover/technical grid drop penalties, but applying disqualification/exclusion/grid penalties for offences during the ranked session).
For races the following rules apply:
* race winning entry forms group "1"
* among the drivers classified on the lead lap, other groups are as follows: 2-3 places are group "2", 4-5 places are group "3", 6-10 places are group "4", 11-15 places are group "5", etc.
* for drivers classified outside the lead lap, the groups are formed by the drivers classified with the same numbers of completed laps (each distinct lap number as a separate group)
* non-classified drivers (because of completing not enough laps, but not retiring) form a single separate group, below all the classified drivers
- * drivers retiring due to driver accidents form a single separate group, below other drivers
+ * drivers retiring due to driver-induced accidents form a single separate group, below other drivers
* drivers disqualified from the race form a single separate group, below other drivers
* drivers retiring due to mechanical issues form a special "0" group together with drivers which did not start the race
@@ -26,4 +26,10 @@ Other than that, standard Elo rating conventions apply:
* drivers start with identical initial rating
* duels between high-ranked drivers change their rankings by fewer points than duels between low-ranked drivers
+Specific parameters which are configurable:
+ * initial driver ranking
+ * disparity factor (ranking difference which drops the possibility of lower-ranked driver's win by the factor of 10)
+ * duel importance (base, i.e. for drivers ranked below importance thresholds) for all race types
+ * importance thresholds (for 50% of base importance and 75% of base importance)
+
All calculation is rounded to 2 decimal places.
diff --git a/doc/sql.txt b/doc/sql.txt
index 4d54f70..a21b607 100644
--- a/doc/sql.txt
+++ b/doc/sql.txt
@@ -1,6 +1,6 @@
Useful queries:
- - selects top rating progression
+ - overall top rating progression
CREATE OR REPLACE VIEW max_date_rankings AS
SELECT MAX(ranking) max_ranking,
@@ -19,13 +19,6 @@ WHERE max_ranking > (
WHERE mr.max_rank_date < max_date_rankings.max_rank_date
);
-SELECT * FROM rankings
-JOIN drivers ON rankings._driver = drivers.id
-WHERE ranking >= (
- SELECT MAX(r.ranking) FROM rankings r
- WHERE r.rank_date <= rankings.rank_date
-) ORDER BY rank_date ASC;
-
- overall top peak ratings
SELECT drivers.driver,
@@ -37,6 +30,7 @@ INNER JOIN (
GROUP BY _driver
) r ON r.ranking=rankings.ranking AND r._driver=rankings._driver
JOIN drivers ON rankings._driver = drivers.id
+GROUP BY rankings._driver
ORDER BY rankings.ranking DESC;
- highest exit ratings
@@ -49,7 +43,7 @@ INNER JOIN (
SELECT MAX(rank_date) rank_date, _driver FROM rankings GROUP BY _driver
) r ON r.rank_date=rankings.rank_date AND r._driver=rankings._driver
JOIN drivers ON rankings._driver = drivers.id
-WHERE rankings.rank_date < CONCAT(YEAR(CURDATE()),'-01-01')
+WHERE rankings.rank_date < CURDATE() - INTERVAL 1 YEAR
ORDER BY rankings.ranking DESC;
- year-by-year rating inflation
@@ -63,7 +57,3 @@ SELECT YEAR(rank_date),
FROM rankings
GROUP BY YEAR(rank_date)
ORDER BY YEAR(rank_date) ASC;
-
- - qualifying/grid sanity check
-
-SELECT drivers.number, drivers.forename, drivers.surname, races.year, races.name, qualifying.number, qualifying.position, qualifying.q1, qualifying.q2, qualifying.q3, results.grid, results.number FROM qualifying INNER JOIN results ON (qualifying.driverID = results.driverId) AND (qualifying.raceId = results.raceId) JOIN drivers ON drivers.driverId = results.driverId JOIN races ON results.raceId = races.raceId WHERE qualifying.position <> results.grid ORDER BY races.date ASC