This is code to implement bots that predict Formula One results. The rules come from the prediction game at http://www.f1wolf.com/ . Currently there are three things implemented:
- A scraper which extracts race results from 2005-2011 from Wikipedia to an H2 embedded database
- A framework to write predictors
- A random predictor and my predictor
Uses commons.pdp7 from https://github.com/alexpdp7/commons.pdp7
Checkout URL: firstname.lastname@example.org:alexpdp7/commons.pdp7.git
You can find it in net.pdp7.f1.prediction.scraper.WikipediaScraper . It uses HTMLUnit and it’s fairly simple; fortunately results formatting in Wikipedia are fairly stable. It writes to a database with this schema .
There are some tests in the test folder which you can use to store scraping results in an H2 file.
It’s located in net.pdp7.f1.prediction.predictors
- Predictor , which contains the main predictor interface and
Entrantnested classes (an
Entrantis a driver/team pairing). A
Predictionbased on a
Listof @Entrant@s, and which race it is (season, round, circuit).
- PredictionScorer, which evaluates a
Predictionaccording to the contest rules
- PredictorPastEvaluator which runs a Predictor against all scraped results and evaluates it
Take a look at the tests for ways to work with your own @Predictor@s.