This project is a self-driving car simulation implemented in JavaScript without relying on external libraries. It serves as a comprehensive demonstration of programming fundamentals, artificial intelligence concepts, and problem-solving skills.
In this project, we aim to create a self-driving car simulation from scratch, covering various components such as driving mechanics, environment definition, sensor simulation, collision detection, and neural network-based car control. The goal is to provide a hands-on learning experience in building complex systems and implementing artificial intelligence techniques.
- Custom Implementation: No external libraries are used, demonstrating proficiency in JavaScript and core programming concepts.
- Driving Mechanics: Implementing the fundamental mechanics of car movement and control.
- Environment Definition: Defining the environment in which the car operates, including roads, obstacles, and other elements.
- Sensor Simulation: Simulating sensors for the car to perceive its surroundings.
- Collision Detection: Implementing algorithms to detect collisions between the car and other objects.
- Neural Network Control: Using neural networks to enable the car to control itself based on sensor inputs.
- Visualization: Visualizing the neural network's functionality to aid understanding.
To run the simulation locally, follow these steps:
- Clone this repository to your local machine.
- Open the project directory in your code editor.
- Open the
index.html
file in a web browser to view the simulation. - Use save button:
🏆📥
, to manually save thebest-car-brain
inlocalStorage
, Use delete button:🔪🪦
, if you want to clear it fromlocalStorage
. - Saving a
best-car-brain
and reloading the page will restart the simulation using this car-brain as a parent. - This process subsequently trains the model to become self sufficient in driving between the traffic.
- After the model is successfully trained, you will find a variable
N
inmain.js
change it's value to =1; and reload to see the trained model.