MCPcopy
hub / github.com/ssusnic/Machine-Learning-Flappy-Bird / GeneticAlgorithm

Function GeneticAlgorithm

source/genetic.js:5–14  ·  view source on GitHub ↗
(max_units, top_units)

Source from the content-addressed store, hash-verified

3/***********************************************************************************/
4
5var GeneticAlgorithm = function(max_units, top_units){
6 this.max_units = max_units; // max number of units in population
7 this.top_units = top_units; // number of top units (winners) used for evolving population
8
9 if (this.max_units < this.top_units) this.top_units = this.max_units;
10
11 this.Population = []; // array of all units in current population
12
13 this.SCALE_FACTOR = 200; // the factor used to scale normalized input values
14}
15
16GeneticAlgorithm.prototype = {
17 // resets genetic algorithm parameters

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected