Packagecom.suckatmath.machinelearning.genetic.core
Interfacepublic interface Evolvable
Implementors DefaultEvolvable, EvolvableString

Defines methods used by the GeneticEngine to perform the genetic algorithm. Implement this in your classes which you'd like to optimize.



Public Methods
 MethodDefined By
  
getFitness():Number
The scale of this number is arbitrary.
Evolvable
  
gets the genome used to generate this evolvable, and mutate/combine to create a new genome for next generation
Evolvable
Method Detail
getFitness()method
public function getFitness():Number

The scale of this number is arbitrary. 0-1 will work just as well as -100000 - 100000 or other range Used directly in Roulette selection with proportional selection, but only in ranking for default Tournament selection. You can define a different EvolvableComparator for Tournament which does not use this at all.

Returns
Number — Number
getGenome()method 
public function getGenome():Genome

gets the genome used to generate this evolvable, and mutate/combine to create a new genome for next generation

Returns
Genome