Coder Social home page Coder Social logo

ifs55 / dino-genetic-algorithm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matheusrdsantos/dino-genetic-algorithm

0.0 0.0 0.0 291 KB

This python project is a demonstration of what a genetic algorithm technique can achieve when applied in a game. The current game is the famous dinosaur game launched by google chrome.

Home Page: https://www.youtube.com/watch?v=IrQLUSExeWQ&t=24s

Python 100.00%

dino-genetic-algorithm's Introduction

Dino-genetic-algorithm

This python project is a demonstration of what a genetic algorithm technique can achieve when applied in a game. The current game is the famous dinosaur game launched by google chrome.

python modules

  • keyboard
  • Tkinter
  • numpy
  • pillow

Project scopes

In this project, there are three scopes: 'train', 'game' and 'simulation'. Each one has a different purpose to see the project running.

train

You can run training mode through the following code:

python3 main.py train

The training mode uses a pre-trained set of dinos. After executing the above command the training will continue using the best dino of the last training.

You can choose the number of dinos per generation as the 3th parameter. The default value is 10.

python3 main.py train 10

simulation

You can run the simulation mode through the following code:

python3 main.py simulation

The simulation mode is better when you want to see the dinos learning through each generation. This mode doesn't use any previous result as a start point. So each stating dino has a random behavior that changes as new generations are generated.

You can choose the number of dinos per generation as the 3th parameter. The default value is 10.

python3 main.py simulation 10

game

You can run game mode through the following code:

sudo python3 main.py game

In this mode, you can compete against the best dino you have trained. The dino with the highest score wins. When running game mode you should give root permissions because the algorithm needs access to your keyboard events.

dino-genetic-algorithm's People

Contributors

matheusrdsantos avatar ifs55 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.