Kenneth Stanley's NEAT code reorganized (tidier?)
C++ Objective-C C
Switch branches/tags
Nothing to show
Clone or download
Latest commit abab42c Sep 9, 2013

Neuro Evolution of Augmenting Topologies

A slightly tidier version of Kenneth Stanley's NEAT original source code.

Copyright 2010 The University of Texas at Austin

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License in this site.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

NEAT source code distribution version 1.2, 7/23/10

The NEAT software is based on the real-time NeuroEvolution of Augmenting Topologies method of evolving artificial neural networks, by Stanley and Miikkulainen (2002).

Source code included in this release is originally written by Kenneth Stanley ( This is the official distribution site.

The core NEAT code is updated significantly from earlier releases. Traits can now be made functional, and adaptive networks can be evolved (though the default is non-adaptive).

Included Files

This is a list of files included in the distribution, and also ones that are created when it is run or made using the Makefile.

Makefile        : Makes neat on linux
CMakeLists.txt  : cmake file for cross-platform make (use       : This file
LICENSE         : The Apache License Version 2.0 which describes the terms for the release of this package

experiments.cpp : Sample experiments code
gen_*           : A printout of a generation- produced by generational NEAT
gene.cpp        : Gene class definitions
genome.cpp      : Genome class definitions
innovation.cpp  : Innovation class definitions
link.cpp        : Link class definitions
neat.cpp        : Main NEAT class
neatmain.cpp    : Location of main, entry to the executable
network.cpp     : Network class defintions
nnode.cpp       : NNode class definitions
organism.cpp    : Organism class definitions
organism.h  : Sample parameter file         : Parameter file for non-markov double pole balancing       : Sample parameter file    : Sample parameter file that was used in some major experiments with pop size 256
pole1startgenes : Starter genes for signle pole balancing : Parameter file for markovian double pole balancing
pole2startgenes : Start genes for double pole balancing
pole2startgenes1 : Start genes for markovian double pole balancing
pole2startgenes2 : Start genes for non-markovian double pole balancing
population.cpp  : Population class definitions
neat            : Main executable (must execute "make" to produce this file)
species.cpp     : Species class definitions
statout         : Stat file output after some experiments         : Sample parameter file
trait.cpp       : Trait class definitions
xorstartgenes   : Start genes for XOR experiment


To compile the NEAT code just run $ make, and this wil create the ./build folder containing all the compiling objects and the neat executable.

There are also two other commands:

  • $ make clean: which deletes the "./build" folder
  • $ make purge: which deletes both the "./build" folder and the "neat" executable

Included Experiments

After running "make" to create the "neat" executable, NEAT can be run from the command line as follows:

$ ./neat

"" must be included so that NEAT knows what evolution parameters you want to use. You can use one of the supplied parameter files (they all end in the .ne extension), or create your own.

The parameter file was designed for markovian pole balancing of any type (single pole, double pole, real-time).

The parameter file was designed for double pole balancing without veolicity information. However, also works with this experiment, and with XOR.

When you run NEAT from the command line, you are given the option of 5 experiments:

Please choose an experiment:

    • 1-pole balancing
    • 2-pole balancing, velocity info provided
    • 2-pole balancing, no velocity info provided (non-markov)
    • XOR Number:

At the "Number:" prompt, you can enter your choice. The correct starter genome will be loaded in automatically and evolution will commence. Most experiments output generational population files ("gen_#") at regular intervals based on the "print_every" parameter in the supplied .ne file. For example, if print_every is 5, then gen_5, gen_10, gen_15, etc., will be written to the directory containing NEAT.


We hope that this software will be a useful starting point for your own explorations in NEAT. The software is provided as is, however, we will do our best to maintain it and accommodate suggestions. If you want to be notified of future releases of the software or have questions, comments, bug reports or suggestions, send email to