Skip to content

Shashank-k15/Evolution-Sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Evolution-Sim

Ui Watch this for a better understanding https://youtu.be/-wZjmAEtzoE

To see the intelligent behavior watch this https://youtu.be/ayHRo4aFl-s?si=By1Y1bnC9Y91cTI

Simulation

Screenshot 2025-01-25 at 10.59.18 AM copy.png

Table of Contents

Section Link
Project Description Project Description
Project Log file Log file
- Natural Selection Simulator Natural Selection Simulator
- Key Features Key Features
Installation Installation
Running Run
- Linux/macOS Installation Linux/macOS Installation
- Windows Installation Windows Installation
Project Structure Project Structure

Project Description

Natural Selection Simulator

The Natural Selection Simulator is a Python-based simulation that models the process of natural selection in a virtual environment. The simulation includes entities such as prey and predators, each with their own behaviors and characteristics. The goal is to observe how these entities interact with each other and their environment over time, leading to the evolution of traits that enhance their survival and reproduction.

Key Features

  • Entity Behavior: Prey and Predators have distinct behaviors driven by neural networks which are optimized by the neat-algorithm to maximize there fitness, allowing them to make decisions based on their surroundings and internal states.
  • Random Environment Generation: The world map is populated with different elements like water, forest and land, which are randomly generated to create a dynamic environment.
  • Fitness Calculation: The fitness of each entity is calculated based on their actions and energy levels, influencing their chances of survival and reproduction.
You can find the details of the implementation, along with the issues I encountered and the solutions I came up with, in the PROJECT_LOG file.

Installation

Linux MacOS Installation

Just Run this command on

curl -sSL https://github.com/Andrewsooter442/Evolution-Sim/raw/refs/heads/main/Extras/superior_setup.sh| bash

Manual method

Using python virtual environment (Can be buggy and not work)

  1. Create a virtual environment:

    python3 -m venv sim
    cd sim
    . bin/activate
  2. Clone the repository:

    git clone https://github.com/Andrewsooter442/Evolution-Sim.git
    cd Natural-Selection-Simulator
  3. Install the required dependencies:

    pip install -r requirement.txt
    cd Scripts
  4. Run the main script:

    python3 main.py

Using Conda (Recommended for better dependency management)

  1. Create a Conda environment:

    conda create -n Evolution-Sim python=3.13
  2. Activate the Conda environment:

    conda activate Evolution-Sim
  3. Clone the repository:

    git clone https://github.com/Andrewsooter442/Evolution-Sim.git
    cd Evolution-Sim
  4. Install the required dependencies: If the repository includes an environment.yml file:

    conda env update -f environment.yml

    Alternatively, if the environment.yml file is not available, you can install dependencies using pip:

    pip install -r requirements.txt
  5. Navigate to the Scripts directory:

    cd Scripts
  6. Run the main script:

    python main.py

Windows installation

curl -O https://github.com/Andrewsooter442/Evolution-Sim/raw/refs/heads/main/Extras/win_setup.bat && setup.bat

Running after installation

For Linux and Macos

For Windows

Note: the main.py file should be run only from the Scripts directory as it uses relative path for other files.

Project Structure

  • Scripts: Contains the main simulation script and other utility scripts.
  • Neat: Contains the config file for the entities and stores checkpoints.
  • Extras: Additional files and documentation related to the project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •