An experiment in artificial life, artificial neural nets, artificial sentience, simulated evolution, simulated consciousness, and genetic programming

Overview

bots

An experiment in artificial life, artificial neural nets, artificial sentience, simulated evolution, simulated consciousness, and genetic programming

Bot Arena

Watch videos:

Requirements

A Linux or Unix-equivalent command line shell (/bin/sh), the Windows command prompt (cmd.exe), or the MacOS Terminal.

  • If you are on MacOS, you can access the terminal by pressing 'Option+Command+Space' and entering 'Terminal'
  • If you are on Windows you can open the command prompt by pressing: 'Windows Button+R', and entering 'cmd.exe'
  • If you are on Linux, you can usually open a terminal by pressing: 'Ctrl+Alt+T'

You must have the Java Development Kit installed in order to compile and run the software.

Download Instructions

Downloading with git

If you have git installed, then from the terminal run the following command:

git clone "https://github.com/jasonkresch/bots.git"

If you download with git, you can skip to the compilation instructions below.

Downloading without git

If you do not have git or do not know what it is, you can download the project's zip file by running the following command from your terminal if you are using Linux or MacOS:

wget "https://github.com/jasonkresch/bots/archive/refs/heads/main.zip"

If you are on Windows or if the 'wget' command fails, you can download the project ZIP file by clicking here. If you download this file directly, you must extract it and then use the 'cd' command to change the directory to the location of the extracted files.

If you downloaded with 'wget'. then extract the ZIP file contents using the following command:

unzip main.zip

After extracting, it a folder 'bots-main' is created. Note that this folder name is different from the folder created using git to download the project. For consistency with the rest of the instructions below, rename this folder to 'bots' by entering the following command into the terminal:

On Linux or MacOS:

mv "bots-main" "bots"

On Windows:

rename "bots-main" "bots"

Compilation Instructions

After downloading the project, run the following commands from your command line if you are not on Windows:

cd "bots/artificial-life/"
./build.sh

If you are on Windows, then run the following commands:

cd "bots\artificial-life"
build.bat

Note that the java compiler (javac) is required to build the software. If you do not have it, download and install the appopriate Java Development Kit (JDK) for your system. See: https://openjdk.java.net/install/ for more information should you get 'javac: command not found' or any similar error message after attempting to execute the build command.

Running Instructions

To start the program run the following command from the 'bots/artificial-life/ directory:

./run.sh

or if you are on Windows:

run.bat

This will bring up the main control window user interface. This interface will allow you to set various parameters of the artificial life simulation.

Once you have chosen the parameters and are ready to begin, click 'Start Training'. This will begin the process of evolving ever more capable bots. After training has started, you may, at any time click the 'Show Bot Arena' button to keep an eye on how the bots are performing in the latest generation.

When the "Enable Autosave" option is checked, the progress will be saved to "autosave.bot" in the "saves" directory every 10 generations. To continue where you left off, click the "Load State" button. To prevent your settings from being overwritten by an autosave, click the "Save State" button to save the progress to a location and file name of your choice.

Bot Configuration

Not that once the training is started, Generation Size and Bot Brain Size can no longer be adjusted. Please choose these carefully before starting a new evolution experiment! See the section below for more information about the meaning of each of these settings.

Simulation Parameters

The following is a detailed description of the meaning of each of each of the configurable parameters of the simulation.

Evolution Parameters

  • Generation Size - The number of bots that compete against each other in each iteration of evolution. The top performing bots from this generation are selected to pass their genes (and brains) on to the next generation of bots.
  • Fraction that Survive - The percentage of bots that survive to the next generation. The worst performing bots that do not survive are removed and replaced with bots created from reproduction and mutation of the best performing bots.
  • Generation Time - The number of time steps which compose each generation. The longer this goes the more likly the best performing bots will rise to the top.
  • Mutation Rate - Controls the fraction of genes that are randomly mutated (replaced with random values) or tweaked (adjusted up or down slightly) for bots that are created through mutation.

Bot Parameters

  • Bot Brain Size - The number of neurons in the hidden layer of the Bot's neural network brain, which sit between the bot's 22 input neurons, and 4 output motor neurons which control the bots turning, movement, antenna angle, and antenna length.
  • Max Bot Turn Rate - The maximum number of degrees per time step at which a bot can turn either right or left.
  • Max Bot Speed - The maximum percentage of the arena the bot can traverse per time step.
  • Bot Field of View - The number of degrees across which the bot can adjust the position of its antenna.
  • Bot Antenna Length - The fraction of the course across which the Bot can extend its antenna.

Environment Parameters

  • Green Balls - The number of green (good) balls in the environment for the bots to "feed" on and increase their fitness (chance of passing their genes on. The least fit of each generation are replaced.
  • Red Balls - The number of red (bad) balls in the environment which harm the bots when their antenna touch them. The more a bot touches a red ball, the more the bot's fitness will decrease, and therefore makes it less likely to survive or reproduce.
  • Ball Resets Per Generation - The number of times during each generation the position and velocity of all balls in the environment will randomly change. This is meant to prevent lucky or unintelligent bots from being rewarded by fortunate placement near a green ball.
  • Green Benefit - The amount of relative benefit given to each bot for contacting a green ball with its antenna. Note that when this is the same value as the red detriment there is no difference in outcome for the bots. Only relative differences between the green benefit and red detriment should have an impact on evolved behaviors.
  • Red Detriment - The amount of relative detriment each bot is punished for contact with a red ball.
  • Ball Size - The size of each ball, representing the ball diammeter as a percentage of the total arena size.
  • Solid Walls - When checked, balls bounce, and bots get stuck. When unchecked, balls and bots will 'reflect' to the opposite side of the arena.

Display Parameters

  • Bots to Show - The number of bots to show on screen to monitor the progress of the latest generation of bots.
  • Frames Per Second - How fast to update the animation of the bots on screen, in terms of number of time steps per second. Note that changing this has no impact on the speed of training.
  • Time to Refresh - Number of seconds to display bots before updating state from the latest generation of training.

Evolving Bots

Once running, you can alter parameters of the bots or environment live, and see how they adapt to the changes. For example, changing the bot's speed or turn rate, changing whether or not the walls are solid, changing the number and ratio of red to green balls, or the size of the balls can lead to drastically different optimum behaviors for the bots. If the bots appear to be stuck in one strategy for a long period of time, try to shake things up by altering the environment. Despite thier relatively tiny brains, it is is common to witness novel and unexpected behaviors exhibited by these bots.

Depending on environment parameters, bots may change strategies from running in circles, spinning, darting in straight lines with tilted antennae, to hiding in corners or sitting still if the environment is particularly hostile. Bots can often find relatively good strategies within a few minutes, though longer runs, of several hours to overnight can yield highly optimized forms. Decreasing the fraction that survive each generation, or increasing the mutation rate can help to find new and more novel strategies more quickly, especially after a drastic change is made to the environment.

You might also like...

Stream Processing and Complex Event Processing Engine

Stream Processing and Complex Event Processing Engine

Siddhi Core Libraries Siddhi is a cloud native Streaming and Complex Event Processing engine that understands Streaming SQL queries in order to captur

Jan 6, 2023

Model import deployment framework for retraining models (pytorch, tensorflow,keras) deploying in JVM Micro service environments, mobile devices, iot, and Apache Spark

Model import deployment framework for retraining models (pytorch, tensorflow,keras) deploying in JVM Micro service environments, mobile devices, iot, and Apache Spark

The Eclipse Deeplearning4J (DL4J) ecosystem is a set of projects intended to support all the needs of a JVM based deep learning application. This mean

Dec 30, 2022

Datumbox is an open-source Machine Learning framework written in Java which allows the rapid development of Machine Learning and Statistical applications.

Datumbox is an open-source Machine Learning framework written in Java which allows the rapid development of Machine Learning and Statistical applications.

Datumbox Machine Learning Framework The Datumbox Machine Learning Framework is an open-source framework written in Java which allows the rapid develop

Dec 9, 2022

statistics, data mining and machine learning toolbox

statistics, data mining and machine learning toolbox

Disambiguation (Italian dictionary) Field of turnips. It is also a place where there is confusion, where tricks and sims are plotted. (Computer scienc

Jun 11, 2022

SparkFE is the LLVM-based and high-performance Spark native execution engine which is designed for feature engineering.

SparkFE is the LLVM-based and high-performance Spark native execution engine which is designed for feature engineering.

Spark has rapidly emerged as the de facto standard for big data processing. However, it is not designed for machine learning which has more and more limitation in AI scenarios. SparkFE rewrite the execution engine in C++ and achieve more than 6x performance improvement for feature extraction. It guarantees the online-offline consistency which makes AI landing much easier. For further details, please refer to SparkFE Documentation.

Jun 10, 2021

A Common Criteria (CC) and FIDO certified FIDO U2F javacard applet.

A Common Criteria (CC) and FIDO certified FIDO U2F javacard applet.

de.fac2 - FIDO U2F Authenticator Applet v1.34 de.fac2 is a Javacard applet which implements a Fido U2F token. It was designed and implemented based on

Nov 20, 2022

CompreFace is a free and open-source face recognition system from Exadel

 CompreFace is a free and open-source face recognition system from Exadel

CompreFace can be easily integrated into any system without prior machine learning skills. CompreFace provides REST API for face recognition, face verification, face detection, landmark detection, age, and gender recognition and is easily deployed with docker

Dec 31, 2022
Owner
Jason Resch
Jason Resch
java deep learning algorithms and deep neural networks with gpu acceleration

Deep Neural Networks with GPU support Update This is a newer version of the framework, that I developed while working at ExB Research. Currently, you

Ivan Vasilev 1.2k Jan 6, 2023
A group of neural-network libraries for functional and mainstream languages

Synapses A group of neural-network libraries for functional and mainstream languages! Choose a programming language: Clojure C# Elixir F# Gleam Java J

Dimos Michailidis 65 Nov 9, 2022
πŸ‘¨β€πŸ«ITMO University first 4 labs. They are about object oriented programming and Java language

Java-Programming-1st-semester 1st lab - math operations, formatted output. 2nd lab - object oriented programming. 3rd lab - SOLID and STUPID principle

Andrey Vasiliev 4 Dec 1, 2022
Teaching materials for Algorithm Bootcamp: Object-Oriented Programming.

Object Oriented Programming Materials Materials Topics Code Introduction to Java Variables and Data Types Operators I/O Selection and Repetition 00_in

Elvan Selvano 17 Nov 8, 2022
Chih-Jen Lin 4.3k Jan 2, 2023
Bazel training materials and codelabs focused on beginner, advanced and contributor learning paths

Bazel-learning-paths This repo has materials for learning Bazel: codelabs, presentations, examples. We are open sourcing the content for training engi

null 18 Nov 14, 2022
πŸ‘„ The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike

Quick Info this library tries to solve language detection of very short words and phrases, even shorter than tweets makes use of both statistical and

Peter M. Stahl 532 Dec 28, 2022
Detection, Classification, and Localisation of marine mammal and other bioacoustic signals

This is the main code repository for the PAMGuard software. This repository was created on 7 January 2022 from sourceforge SVN repository at https://s

PAMGuard 8 Nov 4, 2022
This repository holds the famous Data Structures (mostly abstract ones) and Algorithms for sorting, traversing, and modifying them.

Data-Structures-and-Algorithms About Repo The repo contains the algorithms for manipulating the abstract data structures like Linked List, Stacks, Que

Zaid Ahmed 14 Dec 26, 2021