Zing Forum

Reading

NeuroEvoSim: An Embodied Neuroevolution Simulation Experiment Implemented in Pure Python

An embodied neuroevolution experiment built using only Python standard libraries, where agents perceive food, manage energy, and move in a shared environment via evolved neural networks, employing DNS selection and MAP-Elites archiving strategies.

神经进化进化算法强化学习质量多样性Python模拟具身智能DNS算法MAP-Elites机器学习教育工具
Published 2026-06-07 04:45Recent activity 2026-06-07 04:50Estimated read 6 min
NeuroEvoSim: An Embodied Neuroevolution Simulation Experiment Implemented in Pure Python
1

Section 01

Introduction / Main Floor: NeuroEvoSim: An Embodied Neuroevolution Simulation Experiment Implemented in Pure Python

An embodied neuroevolution experiment built using only Python standard libraries, where agents perceive food, manage energy, and move in a shared environment via evolved neural networks, employing DNS selection and MAP-Elites archiving strategies.

3

Section 03

Project Overview

NeuroEvoSim is an educational embodied neuroevolution simulation project implemented entirely using Python standard libraries. It demonstrates how virtual agents can perceive food, manage energy, and move autonomously in a simulated environment via evolved neural networks. The project not only implements classic evolutionary algorithms but also integrates the latest research findings in the field of Quality-Diversity.


4

Section 04

Embodied Agent Architecture

Each agent is equipped with a feedforward neural network as its "brain", which outputs continuous control signals:

  • Steering Control: Determines the agent's rotation direction and angle
  • Propulsion Control: Determines the agent's movement speed

Agents perceive the environment through sensors, including food positions, distance to boundaries, etc. These inputs are processed by the neural network to generate action decisions.

5

Section 05

Energy and Survival Mechanism

The simulation introduces survival pressure related to resource management:

  • Agents need to find and consume food to maintain energy
  • Agents die when their energy is exhausted
  • Colliding with walls consumes additional energy
  • Movement itself also slowly consumes energy

This design creates natural selection pressure: agents that can forage efficiently are more likely to survive and reproduce offspring.


6

Section 06

Dominated Novelty Search (DNS)

The project uses the DNS algorithm proposed in 2025 to replace the traditional weighted fitness/novelty objective function. The core ideas of DNS are:

  • Agents are evaluated based on their distance to the nearest more adaptive behaviors
  • Creates local competition instead of relying on fixed behavior description boundaries
  • Preserves both high-fitness individuals and behaviorally unique individuals

This strategy avoids the difficulty of weight tuning in traditional multi-objective optimization, allowing fitness and novelty to emerge naturally.

7

Section 07

MAP-Elites Style Archiving

The project implements a MAP-Elites style archiving system:

  • Indexed by two dimensions: roaming range and movement behavior
  • Preserves the optimal strategy in each behavioral niche
  • Makes diverse strategies visible and reusable

Behavior descriptors are intentionally designed to be interpretable: how many arena areas the agent has visited, and its movement amount.


8

Section 08

Multi-level Mutation Strategy

  • Elitism: Preserve the best individuals of each generation to directly enter the next generation
  • Crossover: Combine neural network weights from parent individuals
  • Mutation: Add random perturbations to weights
  • Random Immigration: Introduce completely new random individuals to prevent premature convergence
  • Archived Parent Sampling: Sample parents from archived elites to reuse successful schemes
  • Stagnation Detection and Adaptive Mutation: Automatically expand mutation rate when evolution stagnates