Skip to content

Using Genetic Algorithm to evolve a Neural Network Vehicle to drift around in an enclosed circuit.

Notifications You must be signed in to change notification settings

Vieper1/GeneticVehicleDrift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeneticVehicleDrift

Self-Driving Vehicle Setup
Using Genetic Algorithm to evolve a Neural Network Vehicle to drift around in an enclosed circuit.


The image below is a link to the following youtube video: https://www.youtube.com/watch?v=Yx6JVTKVl0M Watch the video


How does it work?

  1. The God.c script decides the population size and mutation probabilities
  2. When the sim starts, N individuals are spawned with a randomly initialized Neural Network (NN)
  3. For every Update() cycle, the individual calculates Steering & Throttle inputs from the NN
  4. If the individual crashes into the wall, it stops and waits for all other individuals to crash
  5. Once all the individuals crash, random pairs are picked from the population, with the one gone farthest, having the highest probability
  6. Then iterate through each NN Weight and if a random float is greater than pCrossing, exchange the Weights
  7. Do this till the population of the new individuals is again N
  8. Run the next generation

Files of interest

  • GeneticVehicleDrift/Source/Genetic_DriftCar/God.cpp
  • GeneticVehicleDrift/Source/Genetic_DriftCar/GeneticAlgorithm/DriftPawn_1HL.cpp

Features & Config

  • AdvVehicle from UE4 starter content tuned for high-slide-angle drifts
  • Custom Neural Network
  • Genetic Algorithm Simulation's configuration modifiable (in God.cpp):
    1. Initial Population
    2. Number of distance-sensor-units (Input Layer)
    3. Crossing Probability
    4. Mutation Probability
    5. Number of nodes in Hidden Layer
    6. Drift score multiplier (to +/- the importance of drifting in the simulation)

How to run the project

  1. Have UE4 (4.21) installed
  2. Clone/Download the repository
  3. Go to directory
  4. Open GeneticVehicleDrift.uproject

About

Using Genetic Algorithm to evolve a Neural Network Vehicle to drift around in an enclosed circuit.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published