binary-breeder
v0.1.4
Published
Breeds the specified number of offspring from two parent strings of binary digits with the possibility of random mutation.
Downloads
54
Maintainers
Readme
binary-breeder
Breeds the specified number of offspring from two parent strings of binary digits with the possibility of random mutation.
Installation
npm install binary-breeder
Dev Setup
npm install -g mocha
npm install -g istanbul
Unit Tests
npm test
Coverage
npm run cover
Usage
var reproduce = require('binary-breeder');
var numOffspring = 5;
var mutationChance = 0.002;
var parentChromosomes = [
'000011001101100101',
'110010100110110100'
];
var offspring = reproduce(parentChromosomes, numOffspring, mutationChance);
/*
sample output
[ '000010100110110100',
'110011001101100101',
'110010100111100101',
'000011001101110100',
'110011001101100101' ]
*/