GODPAPER | All Packages | All Classes | Index | Frames No Frames |
Evolvable

Package | com.suckatmath.machinelearning.genetic.core
Interface | public 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

| Method | Defined By
--- | --- | ---
|  | getFitness():Number The scale of this number is arbitrary. | Evolvable
|  | getGenome():Genome 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` —

Thu Jan 16 2014, 01:11 PM +08:00