This project demonstrates a genetic algorithm that simulates car evolution based on saved networks.
- Save the Network: Save the neural network of the car currently in front.
- Delete Network: Remove the current network from localStorage.
By default, a functional network is saved to demonstrate the project's capabilities. To remove it, locate and comment out the following block in main.js:
else{
// comment or delete this else if you don't want a default brain
let isFirstCarChange = false;
for(let car of cars){
car.brain = JSON.parse(defaultBestCar);
if(isFirstCarChange){
NeuralNetwork.mutate(car.brain,0.1);
}
isFirstCarChange = true;
}
}
Yes, the global variable N in main.js determines the number of cars generated from the initial network.
- Thanks to Radu for all his teaching that make possible this project.