Coder Social home page Coder Social logo

robby-genetic-algorithm's Introduction

How to run

  1. Install requirements.
pip install requirements.txt
  1. Run the program.
python main.py

Project Outline

A genetic algorithm to create an optimal "Robby": a self-directed robot tasked to pick up cans littered around a 10x10 board.

Board

  • A 10x10 matrix where each cell has a 50% of having a can.

DNA

  • A sequence of 243 integers, each between 0-6.
  • Dictates Robbie's behavior in any possible scenario.
  • Can be created with random integers, or from a combination of 2 other DNAs with a small chance of mutation.

Robby

  • A "robot" initially positioned at [0,0] of the board.
  • Can determine the status of his surroundings.
  • Has a DNA, that dictates behavior in any the possible scenarios.
  • Has a lifespan of X turns, at the end of which a fitness score is calculated. +10 points for each can Robby successfully picks up. -5 if he crashes into a wall. -1 point if Robby tries to pick up a can when there isn't one.
  • Can be born out of 2 other Robbies, with a new DNA that is a mix of the parents' DNAs, with a small chance of mutation.

Evolution

  1. Start with P individuals (Robbies) that have random DNA. [Repeat the ff for G generations.]
  2. Calculate the fitness for each individual in the current generation.
  3. Apply evolution.
  • Choose 2 Robbies as parents probabilistically based on fitness.
  • "Mate" the 2 Robbies to create 2 children to add to a new population.
  1. Once the new population is of size P, return to step 2.

To Do

  • Concurrency
  • Save the DNA of the fittest indvidual.
  • Visualization showing a board and a Robby. Accepts input DNA object to determine the Robby's behavior.

robby-genetic-algorithm's People

Contributors

ray-dino avatar

Stargazers

 avatar Breyner Ocampo Cárdenas   avatar Merab Tato Kutalia avatar George Mamaladze avatar

Watchers

James Cloos avatar  avatar

Forkers

zhihuanli

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.