| Package | com.suckatmath.machinelearning.genetic.impl |
| Class | public class ArrayGenome |
| Inheritance | ArrayGenome Object |
| Implements | Genome |
| Property | Defined By | ||
|---|---|---|---|
| exampleGene : Gene
example Gene to use for new random Genes
| ArrayGenome | ||
| length : int
number of genes
| ArrayGenome | ||
| Method | Defined By | ||
|---|---|---|---|
create a new empty ArrayGenome
| ArrayGenome | ||
generate a copy of this Genome. | ArrayGenome | ||
construct a new genome from this and others. | ArrayGenome | ||
getGenes():Array
get actual genes
| ArrayGenome | ||
create a copy of this genome with some probability of mutation. | ArrayGenome | ||
generate a new random genome. | ArrayGenome | ||
setExampleGene(g:Gene):void
set example Gene to use for new random genes
| ArrayGenome | ||
setLength(l:int):void
set length
| ArrayGenome | ||
toString():String
Return a string representation of this Genome
| ArrayGenome | ||
| exampleGene | property |
public var exampleGene:Geneexample Gene to use for new random Genes
| length | property |
public var length:intnumber of genes
| ArrayGenome | () | Constructor |
public function ArrayGenome()create a new empty ArrayGenome
| clone | () | method |
| crossover | () | method |
public function crossover(others:Array, numpoints:int):Genomeconstruct a new genome from this and others.
Parameters
others:Array | |
numpoints:int |
Genome —
|
| getGenes | () | method |
public function getGenes():Arrayget actual genes
ReturnsArray — Array
|
| mutate | () | method |
public function mutate(probability:Number):Genomecreate a copy of this genome with some probability of mutation. Mutates at most 1 gene.
Parameters
probability:Number — Number between 0 and 1
|
Genome —
|
| newRandom | () | method |
public function newRandom():Genomegenerate a new random genome. Uses exampleGene to create random Genes
ReturnsGenome — Genome
|
| setExampleGene | () | method |
public function setExampleGene(g:Gene):voidset example Gene to use for new random genes
Parameters
g:Gene |
| setLength | () | method |
public function setLength(l:int):voidset length
Parameters
l:int |
| toString | () | method |
public function toString():StringReturn a string representation of this Genome
ReturnsString — String
|