Code Monkey home page Code Monkey logo

pathplanning-withgeneticai's Introduction

PathPlanning-withGeneticAI

After watching a Youtube video (link below) on Genetic AI algorithms, I thought about creating my own program that could simulate a genetic AI in a random environment. This way, you could see just how the AI can learn the path (provided one exists) from the start point to the end point.

This simulation is a useful demonstration for genetic AI's applications in autonomous vehicles or robotics. If you have enough computing power, you could use this to create a coordinate trajectory for your vehicle to navigate around an obstacle.

System Requirements

You will need Python to run this program. I tested it with Python 2.7.15+ 64 bit. You will also need a few Python modules. You can install these by typing

pip install -r requirements.txt

in your cloned directory of this repository.

Example:

Clone or download the code and navigate to its directory in a terminal. Run the program by typing the following in a terminal:

python src/runSimulation.py

A window will appear with a random collection of obstacles and start and end points on either side of the screen. "Samples" from the population will begin to travel in random directions based on their randomized genetics that are hard-coded into them at the start of the simulation. Alt text

Some samples may make it closer to the end point than others, which will give them a higher fitness score, which is a reproductive advantage when the next generation is produced. The samples with the highest fitness scores are more likely to be naturally selected as parents. Their children samples will be cloned with the same genetics as their parents, but with random mutations which allow them to potentially outperform their parents and reach the end point. Alt text

If all goes well, the samples will not only find the end point, but optimize the path. After many many generations, the resulting path should resemble the shortest path between the start and end point without hitting any obstacles. Alt text

Resources:

https://www.youtube.com/watch?v=BOZfhUcNiqk
https://github.com/Code-Bullet/Smart-Dots-Genetic-Algorithm-Tutorial

pathplanning-withgeneticai's People

Contributors

estods3 avatar

Stargazers

 avatar  avatar

Watchers

 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.