This project titled “Sway” approaches the idea of neuroevolution by using the NEAT algorithm to point towards an optimal solution for the given task. The environment is set up as a virtual simulation in an accelerated time frame and NEAT is performed over generations until a solution is achieved. The task involves determining various dynamic values which help propagate the motion of entities in the virtual simulation towards a favourable direction leading to an optimum.
Dark purple coloured square represents the human playing, while the other light purple coloured squares represent different AI agent's playing. The task is to hit the red colored square box.
- Clone the project on your local machine in your prefered directory by typing the following command in git bash/ Powershell/ CMD (or download the file yourself)
git clone https://github.com/suprasauce/Sway.git
- Install python for windows if you don't have it (preferably python 3.8+). Activate a virtual environment in Powershell/ CMD by either installing virtualenv and following its instructions to make a virtual environment, or by using the venv package which comes with python by default
python -m venv env
This will make a folder named env. Then type
(Powershell)
path_where_env_is_stored\env\Scripts\Activate.ps1
(CMD)
path_where_env_is_stored\env\Scripts\activate
- Go to the project directory
To install all the dependencies, run
pip install -r requirements.txt
- Run the game.py file by typing the following command in CMD/ Powershell (make sure virtual env is activated) in the directory where you cloned the folder
python game.py