Using Haskell to find the best team for the MCN Fantasy League. I wanted to play with Haskell and though this might be a good idea for a little project.
- 2 Riders from each class (MotoGP, WSB, BSB)
- Total Team cost £10 million
- Each class has a different number of races per round
- You are only able to switch up to three riders during a transfer window
I have removed any Riders who have not scored any points to reduce the list of all Teams from 64,935,000 to 7,220,988. This list is then filtered based on the total cost of the Team being below £10 million, resulting in 6,379,135 possible Teams.
The potential points are calculated based on the Riders average points per race throughout the previous round, multiplied by the number of races in the current round.
These potential points are then summed up for the Team with the top ten predicted teams listed below.
The top 10 Teams for Game Round 5 are
- V Rossi, J Lorenzo, M Baiocco, R Ramos, S Byrne, J Brookes - Predicted Points: 334
- V Rossi, J Lorenzo, L Mercado, R Ramos, S Byrne, J Brookes - Predicted Points: 334
- V Rossi, J Lorenzo, N Terol, L Mercado, S Byrne, J Brookes - Predicted Points: 332
- V Rossi, J Lorenzo, A Badovini, R Ramos, S Byrne, J Brookes - Predicted Points: 332
- V Rossi, J Lorenzo, N Canepa, L Mercado, S Byrne, J Brookes - Predicted Points: 330
- V Rossi, J Lorenzo, N Terol, R Ramos, S Byrne, J Brookes - Predicted Points: 328
- J Lorenzo, A Iannone, J Torres, L Mercado, S Byrne, J Brookes - Predicted Points: 328
- V Rossi, J Lorenzo, N Canepa, R Ramos, S Byrne, J Brookes - Predicted Points: 326
- V Rossi, A Iannone, J Torres, L Mercado, S Byrne, J Brookes - Predicted Points: 325
- V Rossi, J Lorenzo, N Terol, N Canepa, S Byrne, J Brookes - Predicted Points: 324
The top 10 teams for Game Round 5 (based on my current team) are
- V Rossi, J Lorenzo, L Mercado, R Ramos, S Byrne, J Brookes - Predicted Points: 334
- V Rossi, J Lorenzo, N Terol, L Mercado, S Byrne, J Brookes - Predicted Points: 332
- V Rossi, J Lorenzo, N Canepa, L Mercado, S Byrne, J Brookes - Predicted Points: 330
- J Lorenzo, A Iannone, J Torres, L Mercado, S Byrne, J Brookes - Predicted Points: 328
- V Rossi, A Iannone, J Torres, L Mercado, S Byrne, J Brookes - Predicted Points: 325
- J Lorenzo, A Iannone, J Torres, R Ramos, S Byrne, J Brookes - Predicted Points: 324
- J Lorenzo, A Iannone, J Torres, N Terol, S Byrne, J Brookes - Predicted Points: 322
- V Rossi, A Iannone, J Torres, R Ramos, S Byrne, J Brookes - Predicted Points: 321
- J Lorenzo, A Iannone, M Baiocco, L Mercado, S Byrne, J Brookes - Predicted Points: 320
- J Lorenzo, A Iannone, J Torres, N Canepa, S Byrne, J Brookes - Predicted Points: 320
Interactive:
$ ghci
GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help
Prelude> :l main
[1 of 5] Compiling MyTeam ( MyTeam.hs, interpreted )
[2 of 5] Compiling BSB ( BSB.hs, interpreted )
[3 of 5] Compiling WSB ( WSB.hs, interpreted )
[4 of 5] Compiling MotoGP ( MotoGP.hs, interpreted )
[5 of 5] Compiling Main ( main.hs, interpreted )
Ok, modules loaded: Main, MotoGP, WSB, BSB, MyTeam.
*Main> main
Compiling:
$ ghc main.hs
$ ./main