CMPE 491/492 Senior Design Project

MoonAI

Predator–Prey Neuroevolution Simulation Platform

A modular research platform for studying evolutionary algorithms and neural network evolution through synthetic predator-prey dynamics using the NEAT algorithm.

Team & Supervisor

Team Members

  • Caner Aras
  • Emir Irkılata
  • Oğuzhan Özkaya

Supervisor

  • Ayşenur Birtürk

Motivation

Modern artificial intelligence training often requires vast amounts of real-world data and manually designed scenarios, which do not scale efficiently. MoonAI addresses this limitation by providing autonomous, self-generating training environments for studying evolutionary computation without external data dependencies.

Objective

Develop a robust simulation environment to research and optimize evolutionary algorithms. By decoupling training from real-world data dependencies, we investigate how genetic representations influence learning efficiency and adaptability in dynamic, complex environments.

Approach

The system employs a high-fidelity predator-prey simulation to generate evolutionary and genetic data. This synthetic ecosystem serves as a dynamic benchmark for evaluating evolutionary computation techniques in adaptive behavior modeling.

Technologies Used

Core Languages

  • C++17
  • Python 3.10+

Simulation & Graphics

  • SFML 3.x

AI & Compute

  • NVIDIA CUDA 11.0+
  • NEAT Algorithm

Data Analysis

  • Pandas
  • Matplotlib
  • NetworkX

Configuration & Tools

  • JSON
  • CMake 3.21+
  • Git
  • just

Quick Start

# Clone the repository
git clone https://github.com/moon-aii/moonai.git
cd moonai

# Build and run
just configure
just build
just run

Prerequisites: C++17 compiler, CMake 3.21+, vcpkg, CUDA Toolkit (optional)

Project Details

Evolutionary Core

MoonAI implements the NeuroEvolution of Augmenting Topologies (NEAT) algorithm to optimize agent behaviors. By evolving both neural network weights and topological structures, the system enables emergence of complex behavioral strategies through mutation, crossover, and speciation across successive generations.

Simulation Environment

The simulation operates within a deterministic, time-stepped 2D world. This virtual ecosystem imposes selective pressures on agents—predators and prey—with configurable attributes including speed, vision, stamina, and reproduction rates, facilitating systematic algorithmic evaluation.

Heterogeneous Architecture

To achieve high-performance execution, MoonAI employs a hybrid compute model. The CPU manages high-level control logic and physics updates, while massive parallelization via NVIDIA CUDA accelerates neural network inference and fitness evaluations for large agent populations.

Real-Time Analytics

Researchers observe emergent behaviors through an SFML-based real-time visualization layer. The system concurrently logs extensive telemetry, including population metrics and genome histories, exporting structured data for rigorous offline analysis using Python-based tools.

Frequently Asked Questions

What is NEAT and why was it chosen?

NEAT (NeuroEvolution of Augmenting Topologies) is a genetic algorithm for evolving artificial neural networks. It was chosen because it simultaneously evolves both the topology and weights of networks, allowing complex structures to emerge from simple beginnings without requiring manual architecture design.

Is CUDA required to run the simulation?

No, CUDA is optional. The simulation includes a CPU fallback path that activates automatically when CUDA is unavailable. While GPU acceleration significantly improves performance for large populations, the simulation runs correctly on CPU-only systems.

What output data does the simulation generate?

The simulation exports comprehensive metrics including per-generation statistics (population counts, fitness scores, species diversity), genome structures, and optional per-tick agent trajectories. All data is saved in CSV and JSON formats for analysis with the provided Python scripts.

How can I configure experiment parameters?

All parameters are defined in JSON configuration files. The default configuration includes 40+ adjustable fields covering population sizes, mutation rates, NEAT parameters, and visualization settings. Custom configs can be specified at runtime without recompilation.