npm.io
0.1.8 • Published 10 years ago

genev

Licence
MIT
Version
0.1.8
Deps
0
Vulns
0
Weekly
0

npm version

Genev.js

Genetic Evolution Algorithm framework

##What is Genev? Genev is a framework that lets you easily use the genetic algorithm search heuristic to find solutions to optimization or search problems.

Todo:

  • Add method chaining
  • Add tests
  • Add Travis
  • npm-ify

##In a nutshell

// Create a chromosome
var chromosome = {
  gene1: null,
  gene2: null 
};

// Create a fitness function
var ff = function (genes) {
  var gene, score = 0;
  for (gene in genes) { score += gene; } // score will be a sum of the genes
  return score;
}

// Use Genev
var genev = GF(chromosome); // set it up with our chromosmoe
genev.initPopulation(); // initialize it
genev.evolve(ff); // let it rip!

Keywords