From 0de8367bd02dd60dfe88ce20b354756293a9819e Mon Sep 17 00:00:00 2001 From: aprowe Date: Tue, 3 Mar 2015 21:46:54 -0800 Subject: [PATCH] Updated Readme --- README.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ae934dd..2903485 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ evoJS is a genetic algorithm 'calculator', making it easy to incoporate evolutio Wrapped in the library are simple ANN (Artificial Neural Network) and CPPN (Compositional Pattern Producing Network) classes that work easily with the genetic algorithm. +Installation +------------- +evoJS is compatible with both require.js and node. + Usage --------- @@ -33,6 +37,9 @@ Getting started is easy: Gradually, the gene pool will evolve to maxmize the score. The magic happens in `pool.next` and `pool.report`. `pool.next()` will retrieve the next set of genes, and when the pool is empty, it will breed all of the specimens you have reported back to the pool via `pool.report`. + +###### Triggers +---------- We can monitor for when a generation is computed with the 'breed' trigger. ```javascript @@ -41,13 +48,13 @@ We can monitor for when a generation is computed with the 'breed' trigger. }); ``` -For easy creation of objects using the genes, we can use the 'spawn' trigger. This lets you define a function -to shortcut the creation of your genetic object. +###### Spawn Objects +For easy creation of objects using the genes, we can use the 'spawn' trigger. This lets you define a function to shortcut the creation of your genetic object. ```javascript pool.on('spawn', function(genes){ var net = evo.network('cppn', genes); - return net + return net; }); ``` @@ -55,7 +62,7 @@ The return value of this function will be returned when `pool.spawn` is called. Now, we can do this: ```javascript - var net = pool.spawn() + var net = pool.spawn(); // Evaluate the network var output = net.calc([0,1,2]); @@ -64,10 +71,9 @@ Now, we can do this: net.score = output[0] - output[1]; // pool reference is now stored in net. - net.report() + net.report(); ``` More to Come ---------- -evoJS is a baby. -It will remain simple and general, but more usage and example are to be posted. +evoJS is a just baby!