GithubHelp home page GithubHelp logo

maximeleclerc / evolutionary-f1-race-strategy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bonom/evolutionary-f1-race-strategy

0.0 0.0 0.0 360.34 MB

Evolutionary F1 Race Strategy [GECCO 2023] - Genetic Algorithms applied to F1 race strategy using the F1 2021 game data and real data from Pirelli F1.

License: GNU General Public License v3.0

Python 1.33% HTML 98.67%

evolutionary-f1-race-strategy's Introduction


Evolutionary F1 Race Strategy [GECCO 2023]

Official implementation of GECCO 2023 paper "Evolutionary F1 Race Strategy", it has been presented at the 8th Workshop on Industrial Applications of Metaheuristic (IAM 2023).


๐Ÿ“„ Paper


Introduction

Formula 1 is a highly competitive and ever-evolving sport, with teams constantly searching for ways to gain an edge over the competition. In order to meet this challenge, we propose a custom Genetic Algorithm that can simulate a race strategy given data from free practices and compute an optimal strategy for a specific circuit. The algorithm takes into account a variety of factors that can affect race performance, including weather conditions as well as tire choice, pit-stops, fuel weight, and tire wear. By simulating and computing multiple race strategies, the algorithm provides valuable insights and can help make informed strategic decisions, in order to optimize the performance on the track. The algorithm has been evaluated on both a video-game simulation and with real data on tire consumption provided by the tire manufacturer Pirelli. With the help of the race strategy engineers from Pirelli, we have been able to prove the real applicability of the proposed algorithm.


Requirements

Needed packages to run the project:

  • Python 3.11
  • numpy
  • pandas
  • plotly
  • tqdm

To create the environment use conda (better):

conda create -n <environment_name> python=3.11 pandas numpy tqdm plotly

or pip:

python -m venv <environment_name> 
pip install -U pandas numpy tqdm plotly

Or you can use the requirements file (inside the environment):

pip install -r requirements.txt

There should not be any problems with the packages versions, in case you have some troubles please use the requirements.txt file for the versions we used.


Usage

The script can be used with several flags in different ways, it starts with the default one:

python main.py

Then flags are:

  • --d: is a modality for retrieving more runs of the simulation
python main.py --d
  • --c <circuit>: better if specified, otherwise the script will run the script for all the circuits available. The circuits available are the folders names in the Data folder
python main.py --c Monza
  • --pop <int>: is the population size of the genetic algorithm
python main.py --pop 100
  • --mut <float>: is the mutation rate of the genetic algorithm
python main.py --mut 0.1
  • --cross <float>: is the crossover rate of the genetic algorithm
python main.py --cross 0.1
  • --i <int>: is the number of iterations of the genetic algorithm
python main.py --i 100
  • --w <weather file>: is the weather file to use in the simulation, if not specified the script will ask for the weather file to use. Notice that only the weather txts in every circuit data folder are considered
python main.py --w Sunny.txt

It is possible to use more than one flag, for example:

python main.py --c Monza --pop 100 --mut 0.1 --cross 0.1 --i 100 --w Sunny.txt --d

Citing our work

Please cite the following paper if you use our code:

@inproceedings{10.1145/3583133.3596349,
author = {Bonomi, Andrea and Turri, Evelyn and Iacca, Giovanni},
title = {Evolutionary F1 Race Strategy},
year = {2023},
isbn = {9798400701207},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3583133.3596349},
doi = {10.1145/3583133.3596349},
abstract = {Formula 1 is a highly competitive and ever-evolving sport, with teams constantly searching for ways to gain an edge over the competition. In order to meet this challenge, we propose a custom Genetic Algorithm that can simulate a race strategy given data from free practices and compute an optimal strategy for a specific circuit. The algorithm takes into account a variety of factors that can affect race performance, including weather conditions as well as tire choice, pit-stops, fuel weight, and tire wear. By simulating and computing multiple race strategies, the algorithm provides valuable insights and can help make informed strategic decisions, in order to optimize the performance on the track. The algorithm has been evaluated on both a video-game simulation and with real data on tire consumption provided by the tire manufacturer Pirelli. With the help of the race strategy engineers from Pirelli, we have been able to prove the real applicability of the proposed algorithm.},
booktitle = {Proceedings of the Companion Conference on Genetic and Evolutionary Computation},
pages = {1925โ€“1932},
numpages = {8},
keywords = {race strategy, evolutionary computation, formula 1},
location = {Lisbon, Portugal},
series = {GECCO '23 Companion}
}

Acknowledgements

We would like to thank Simone Berra and Fernando Osuna from Pirelli for providing us the real data and giving us feedback on the numerical results.

evolutionary-f1-race-strategy's People

Contributors

bonom avatar evelynturri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.