Installation

NEAT-JavaScript can be used in both Node.js and browser environments. Follow the instructions below to install and set up the library for your project.

Installation with npm

npm install neat-javascript

Available Imports

Here are the main components you can import from the library:

const { Config, ActivationFunction, Gaussian, LeakyReLU, NEATSigmoid, ReLU, SELU, Sigmoid, Tanh, ConnectionGene, ConnectionGeneData, NodeGeneData, GeneticEncoding, BiasNode, HiddenNode, InputNode, NodeGene, NodeType, OutputNode, Genome, Population, Species, FitnessFunction, XOR, InnovationData, InnovationType, InnovationTracker, ConfigTracker, GenomeTracker, NodeTracker, PopulationTracker, StaticManager, WeightInitialization, RandomWeightInitialization, GenomeBuilder } = require('neat-javascript');

Installation for Browsers

Add the NEAT-JavaScript library to your HTML file:

<!-- Use from CDN (recommended) --> <script src="https://cdn.jsdelivr.net/npm/neat-javascript/dist/neat.min.js"></script> <!-- Or download and include locally --> <script src="path/to/neat.min.js"></script>

Important Note

In browser environments, all components are available under the NEATJavaScript namespace by default. You can make all components available globally by adding:

// Make all NEAT-JavaScript components available in the global namespace Object.assign(window, NEATJavaScript);

This allows you to use all components without the NEATJavaScript. prefix.

How the Library is Exported

The library is bundled with webpack using UMD format with the global name NEATJavaScript. When you include the script in your HTML, all the library's components are automatically available under this namespace.

Available Components

Here are the main components available in the browser:

// These can be accessed with the NEATJavaScript prefix // Or directly if you've used Object.assign(window, NEATJavaScript); Config, ActivationFunction, Gaussian, LeakyReLU, NEATSigmoid, ReLU, SELU, Sigmoid, Tanh, ConnectionGene, ConnectionGeneData, NodeGeneData, GeneticEncoding, BiasNode, HiddenNode, InputNode, NodeGene, NodeType, OutputNode, Genome, Population, Species, FitnessFunction, XOR, InnovationData, InnovationType, InnovationTracker, ConfigTracker, GenomeTracker, NodeTracker, PopulationTracker, StaticManager, WeightInitialization, RandomWeightInitialization, GenomeBuilder

Next Steps

After installing and configuring the library, check out the following resources to learn more: