Genetic Algorithm for Robby Robot based on Complexity a Guided Tour by Melanie Mitchell

Overview

Robby Robot Genetic Algorithm

A Genetic Algorithm based Robby the Robot in Chapter 9 of Melanie Mitchell's book Complexity: A Guided Tour

Description

Robby lives in 10 x 10 game board. Where he has been tasked to clean. A game board consists of 50 randomly spaced cans that need to be cleaned by Robby. At first Robby is not very good at his job< Robby's brain intially starts as a list of 243 randomly generated genes, but over time Robby will< evolve a brain capable of cleaning his world.

Robby cannot see very well and can only see the square above, below, right, left and current postion, as well as if those squares are empty, have a can, or are a wall. Robby Starts at posistion (0,0). Each cleaning session robby can take 200 actions, move up, down, left, right, stay put, pick up, and move a random direction. If Robby runs into a wall he loses 5 points, if Robby picks up a can he gains 10 points, and if he attempts to pick up a can he loses 1 point.

Robby's genome conists of every possible situation he can see, 243 unique combinations, while not all situation are possible like Robby's current position being a wall Evolving Robby's genome takes place over 1000 generations, where each generation has 200 robots. The robots run 100 cleaning sessions where their total fitness is calculated. The better the robots fitness the higher chance it will have to breed.

After 1000 generations Robby has come up with a pretty viable strategy averaging 450 points in 100 cleaning sessions:

Evolved Robby gif

You can see that the fitness of Robby quickly goes to about 400 where it starts to slow down dramatically and only makes smaller improvments until generation 1000

Evolved Robby gif

Getting Started

pip install -r requirements.txt

run game.py to run a simulation.

watch.py will watch a specfic genome, copy and past your genome as a string into genome. Press space to start animation once it loads.

Authors

Matthew Logan

Owner
Matthew
Matthew
Search algorithm implementations meant for teaching

Search-py A collection of search algorithms for teaching and experimenting. Non-adversarial Search There’s a heavy separation of concerns which leads

Dietrich Daroch 5 Mar 07, 2022
Using A * search algorithm and GBFS search algorithm to solve the Romanian problem

Romanian-problem-using-Astar-and-GBFS Using A * search algorithm and GBFS search algorithm to solve the Romanian problem Romanian problem: The agent i

Mahdi Hassanzadeh 6 Nov 22, 2022
Genius Square puzzle solver in Python

Genius Square puzzle solver in Python

James 3 Dec 15, 2022
Code for generating alloy / disordered structures through the special quasirandom structure (SQS) algorithm

Code for generating alloy / disordered structures through the special quasirandom structure (SQS) algorithm

Bruno Focassio 1 Nov 10, 2021
🌟 Python algorithm team note for programming competition or coding test

🌟 Python algorithm team note for programming competition or coding test

Seung Hoon Lee 3 Feb 25, 2022
Sign data using symmetric-key algorithm encryption.

Sign data using symmetric-key algorithm encryption. Validate signed data and identify possible validation errors. Uses sha-(1, 224, 256, 385 and 512)/hmac for signature encryption. Custom hash algori

Artur Barseghyan 39 Jun 10, 2022
Zipline, a Pythonic Algorithmic Trading Library

Zipline, a Pythonic Algorithmic Trading Library

Stefan Jansen 463 Jan 08, 2023
8 Puzzle with A* , Greedy & BFS Search in Python

8_Puzzle 8 Puzzle with A* , Greedy & BFS Search in Python Python Install Python from here. Pip Install pip from here. How to run? πŸš€ Install 8_Puzzle

I3L4CK H4CK3l2 1 Jan 30, 2022
A fast python implementation of the SimHash algorithm.

This Python package provides hashing algorithms for computing cohort ids of users based on their browsing history. As such, it may be used to compute cohort ids of users following Google's Federated

Hybrid Theory 19 Dec 15, 2022
sudoku solver using CSP forward-tracking algorithms.

Sudoku sudoku solver using CSP forward-tracking algorithms. Description Sudoku is a logic-based game that consists of 9 3x3 grids that create one larg

Cindy 0 Dec 27, 2021
This is a Python implementation of the HMRF algorithm on networks with categorial variables.

Salad Salad is an Open Source Python library to segment tissues into different biologically relevant regions based on Hidden Markov Random Fields. The

1 Nov 16, 2021
Implementation of Apriori algorithms via Python

Installing run bellow command for installing all packages pip install -r requirements.txt Data Put csv data under this directory "infrastructure/data

Mahdi Rezaei 0 Jul 25, 2022
This repository is not maintained

This repository is no longer maintained, but is being kept around for educational purposes. If you want a more complete algorithms repo check out: htt

Nic Young 2.8k Dec 30, 2022
Algorithmic virtual trading using the neostox platform

Documentation Neostox doesnt have an API Support, so this is a little selenium code to automate strategies How to use Clone this repository and then m

Abhishek Mittal 3 Jul 20, 2022
A collection of Python Scripts made for fun, while exploring Python 🐍

JFF-Python-Scripts A collection of Python Scripts made for fun, while exploring Python 🐍 Inspiration πŸ’‘ Many of the programs in this repository are i

Pushkar Patel 16 Oct 07, 2022
Python implementation of Aho-Corasick algorithm for string searching

Python implementation of Aho-Corasick algorithm for string searching

Daniel O'Sullivan 1 Dec 31, 2021
Repository for data structure and algorithms in Python for coding interviews

Python Data Structures and Algorithms This repository contains questions requiring implementation of data structures and algorithms concepts. It is us

Prabhu Pant 1.9k Jan 01, 2023
Infomap is a network clustering algorithm based on the Map equation.

Infomap Infomap is a network clustering algorithm based on the Map equation. For detailed documentation, see mapequation.org/infomap. For a list of re

347 Dec 23, 2022
Algorithmic Trading with Python

Source code for Algorithmic Trading with Python (2020) by Chris Conlan

Chris Conlan 1.3k Jan 03, 2023
Implementation of core NuPIC algorithms in C++

NuPIC Core This repository contains the C++ source code for the Numenta Platform for Intelligent Computing (NuPIC)

Numenta 270 Nov 19, 2022