🚗 INGI Dakar 2K21 - Be the first one on the finish line ! 🚗

Overview

🚗 INGI Dakar 2K21 - Be the first one on the finish line ! 🚗

This year's first semester Club Info challenge will put you at the head of a car racing team. You will participate to the world's most famous racing contest, the INGI Dakar. Your goal is to build the best car, and to beat your opponents by reaching the furthest distance from the starting line.

Challenge statement

Each group will be put in charge of a car racing team. Ultimately, your goal is to reach the furthest distance from the starting line, with any of your cars. For this, you will have 6 generations of 20 cars. Each generation will be produced based on the previous one. Your job is thus to implement the algorithm that takes the previous generation of cars in argument, and that produces the next generation. Such an algorithm is called a genetic algorithm, for which a theoretical background is given hereafter.

Genetic algorithms

Genetic algorithms (GA) are inspired by the process of natural selection. They are used to resolve complex problems. They use operators such as mutation, crossover and selection. GA process is split into generations. Each generation is composed of a finite number of individuals which are built from the best individuals of the last generation and one or several operators. The first generation is generally randomly created.

Genetic algorithms are used for a large variety of problems from antenna shape optimization to minimize the weight of structures embarked in mars rovers.

A genetic algorithm is based on three operators:

  • Mutation, a mutation is a random modification of a parameter for an individual in the generation,
  • Crossover, a crossover is the creation of an individual based on parameters values from several members of the last generation,
  • Selection, in a genetic algorithm, we select the best individuals of a generation to construct the next generation.

Alternative text describing the image

The Mutation operator is used to ensure that the selection is not trapped in a local optima and can not reach the global optima for each parameters.

Some useful links:

Program specifications

The program for the INGI Dakar 2K21 is composed of 7 Python modules:

  • Car.py: Defines the class Car that represents a car of the game. A Car is composed of two Wheels and a Chassis, where the Wheels are located on two of the four Chassis vertices.
  • Chassis.py: Defines the class Chassis that represents a car chassis. A Chassis is represented by four vertices connected with each other in a quadrilateral shape.
  • CustomFormatter.py: Used for logging purposes.
  • Game.py: Defines the class Game that represents a game of INGI Dakar 2K21, i.e. the simulation of the 6 generations of 20 cars.
  • main.py: Entry point of INGI Dakar 2K21, which launches the simulations and computes the score.
  • Terrain.py: Defines the class Terrain that represents the terrain on which the cars are driving.
  • Wheel.py: Defines the class Wheel that represents a car's wheel. A Wheel is defined by its radius and the fact that it is a motor wheel or not.

To participate to the challenge, you only have to modify the function next_generation in the module main.py, that takes a representation of the game world (a b2World object) and the previous generation of cars (a list of Car objects) as arguments, and that returns the next generation of cars (also a list of Car objects). The car features that you can update for the next generation are given below.

Car features

A car is composed of the following (the numbers in bold cannot be changed):

  • TWO wheels, one of which is a motor wheel
  • A chassis, composed by FOUR vertices, linked together to form a polygon shape.

The car features that you can modify to reach the maximum distance are the following:

  • Radius of the two wheels, separately.
  • Which wheel is the motor wheel.
  • Position of the four vertices of the chassis.
  • To which of the chassis' vertices the two wheels are attached.

Please consult the corresponding classes to understand how those features are expressed and used in the program.

Score computation

To start the simulation of the challenge, just run the python3 main.py Python module. You must also activate the python virtual environment with source penv/bin/activate.

The execution of the challenge, and computation of your final score, is as follows:

  • Each generation contains 20 cars. The maximum distance reached by any of the cars is recorded as the score of this generation.
  • A game is composed of 6 generations. The score of a game is the maximum score among all the generations.
  • To smoothen the results, 5 games are launched after each other. Your final score is the average of the different score you obtained during the games.

At the end of the 5 games, a plot will be shown, with your results for the 5 games.

Installation and execution

Installation

To install the project, first clone the repository with the following command:

git clone https://github.com/ClubINFO-INGI-UCLouvain/INGI-Dakar-2K21-Challenge.git

Then, install the needed libraries by running the install.sh script, inside the project directory:

python3 -m venv penv;
source  penv/bin/activate;
chmod +x install.sh;
./install.sh;

Execution

To run the challenge simulation, you can simply run the main.py Python module in the src directory, with the following command:

cd src/
python3 main.py [--seed_terrain SEED] [--seed_car SEED] [--no_UI] [--no_plot]

The command line arguments, all optional, are the following:

  • --seed_terrain SEED (with SEED an integer): sets the seed for the random generation of the game terrain to SEED, for reproducibility of the simulations
  • --seed_car SEED (with SEED an integer): sets the seed for the random generation of the first generation of cars to SEED, for reproducibility of the simulations
  • --no_UI: does not show the graphical interface of the game, which drastically speeds up the simulations
  • --no_plot: does not show the plot of the games' result at the end of all the games

Note that, for the contest, the seeds will be fixed for equity among the groups.

There is also a hidden argument, maybe you can try to find it 😉

You might also like...
CryptoFrog - My First Strategy for freqtrade

cryptofrog-strategies CryptoFrog - My First Strategy for freqtrade NB: (2021-04-20) You'll need the latest freqtrade develop branch otherwise you migh

The first dataset on shadow generation for the foreground object in real-world scenes.
The first dataset on shadow generation for the foreground object in real-world scenes.

Object-Shadow-Generation-Dataset-DESOBA Object Shadow Generation is to deal with the shadow inconsistency between the foreground object and the backgr

The first dataset of composite images with rationality score indicating whether the object placement in a composite image is reasonable.
The first dataset of composite images with rationality score indicating whether the object placement in a composite image is reasonable.

Object-Placement-Assessment-Dataset-OPA Object-Placement-Assessment (OPA) is to verify whether a composite image is plausible in terms of the object p

Optimizing DR with hard negatives and achieving SOTA first-stage retrieval performance on TREC DL Track (SIGIR 2021 Full Paper).
Optimizing DR with hard negatives and achieving SOTA first-stage retrieval performance on TREC DL Track (SIGIR 2021 Full Paper).

Optimizing Dense Retrieval Model Training with Hard Negatives Jingtao Zhan, Jiaxin Mao, Yiqun Liu, Jiafeng Guo, Min Zhang, Shaoping Ma This repo provi

[EMNLP 2021] MuVER: Improving First-Stage Entity Retrieval with Multi-View Entity Representations

MuVER This repo contains the code and pre-trained model for our EMNLP 2021 paper: MuVER: Improving First-Stage Entity Retrieval with Multi-View Entity

Top #1 Submission code for the first https://alphamev.ai MEV competition with best AUC (0.9893) and MSE (0.0982).

alphamev-winning-submission Top #1 Submission code for the first alphamev MEV competition with best AUC (0.9893) and MSE (0.0982). The code won't run

 Meli Data Challenge 2021 - First Place Solution
Meli Data Challenge 2021 - First Place Solution

My solution for the Meli Data Challenge 2021

Benchmark for Answering Existential First Order Queries with Single Free Variable
Benchmark for Answering Existential First Order Queries with Single Free Variable

EFO-1-QA Benchmark for First Order Query Estimation on Knowledge Graphs This repository contains an entire pipeline for the EFO-1-QA benchmark. EFO-1

Owner
ClubINFO INGI (UCLouvain)
ClubINFO INGI (UCLouvain)
This Jupyter notebook shows one way to implement a simple first-order low-pass filter on sampled data in discrete time.

How to Implement a First-Order Low-Pass Filter in Discrete Time We often teach or learn about filters in continuous time, but then need to implement t

Joshua Marshall 4 Aug 24, 2022
Code for the paper One Thing One Click: A Self-Training Approach for Weakly Supervised 3D Semantic Segmentation, CVPR 2021.

One Thing One Click One Thing One Click: A Self-Training Approach for Weakly Supervised 3D Semantic Segmentation (CVPR2021) Code for the paper One Thi

null 44 Dec 12, 2022
People log into different sites every day to get information and browse through these sites one by one

HyperLink People log into different sites every day to get information and browse through these sites one by one. And they are exposed to advertisemen

null 0 Feb 17, 2022
An expansion for RDKit to read all types of files in one line

RDMolReader An expansion for RDKit to read all types of files in one line How to use? Add this single .py file to your project and import MolFromFile(

Ali Khodabandehlou 1 Dec 18, 2021
One-line your code easily but still with the fun of doing so!

One-liner-iser One-line your code easily but still with the fun of doing so! Have YOU ever wanted to write one-line Python code, but don't have the sa

null 5 May 4, 2022
One line to host them all. Bootstrap your image search case in minutes.

One line to host them all. Bootstrap your image search case in minutes. Survey NOW gives the world access to customized neural image search in just on

Jina AI 403 Dec 30, 2022
Find-Lane-Line - Use openCV library and Python to detect the road-lane-line

Find-Lane-Line This project is to use openCV library and Python to detect the road-lane-line. Data Pipeline Step one : Color Selection Step two : Cann

Kenny Cheng 3 Aug 17, 2022
aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)

Bayesian Methods for Hackers Using Python and PyMC The Bayesian method is the natural approach to inference, yet it is hidden from readers behind chap

Cameron Davidson-Pilon 25.1k Jan 2, 2023
The first machine learning framework that encourages learning ML concepts instead of memorizing class functions.

SeaLion is designed to teach today's aspiring ml-engineers the popular machine learning concepts of today in a way that gives both intuition and ways of application. We do this through concise algorithms that do the job in the least jargon possible and examples to guide you through every step of the way.

Anish 324 Dec 27, 2022
Ultra-Data-Efficient GAN Training: Drawing A Lottery Ticket First, Then Training It Toughly

Ultra-Data-Efficient GAN Training: Drawing A Lottery Ticket First, Then Training It Toughly Code for this paper Ultra-Data-Efficient GAN Tra

VITA 77 Oct 5, 2022