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

Package | com.suckatmath.machinelearning.genetic.impl
Class | public class EvolvableString
Inheritance | EvolvableString Object
Implements | Evolvable

Stupid little example evolvable. Fitness is how "close" the string is to the goal string Useful only for demonstrating genetic algorithms, since gaol is already known

Public Properties

| Property | Defined By
--- | --- | ---
|  | genome : FixedLengthStringGenome genome used to build this EvolvableString | EvolvableString
|  | goal : String = I will here give a brief sketch of the progress of opinion on the Origin of Species [static] goal string. | EvolvableString

Public Methods

| Method | Defined By
--- | --- | ---
|  | EvolvableString() create a new EvolvableString | EvolvableString
|  | getFitness():Number calculates fitness, or returns saved fitness value uses markov chain, letter distributions, and absolute letter placement | EvolvableString
|  | getGenome():Genome get the FixedLengthStringGenome backing | EvolvableString
|  | setGenome(g:Genome):void set the genome of this EvolvableString | EvolvableString
|  | toString():String return a String representation | EvolvableString

Property Detail

genome | property

`public var genome:FixedLengthStringGenome`

genome used to build this EvolvableString

goal | property |

`public static var goal:String = I will here give a brief sketch of the progress of opinion on the Origin of Species`

goal string. By default: "I will here give a brief sketch of the progress of opinion on the Origin of Species"

Constructor Detail

EvolvableString | () | Constructor

`public function EvolvableString()`

create a new EvolvableString

Method Detail

getFitness | () | method

`public function getFitness():Number`

calculates fitness, or returns saved fitness value uses markov chain, letter distributions, and absolute letter placement

Returns

| `Number` — Number

getGenome | () | method |

`public function getGenome():Genome`

get the FixedLengthStringGenome backing

Returns

| `Genome` — FixedLengthStringGenome as Genome

setGenome | () | method |

`public function setGenome(g:Genome):void`

set the genome of this EvolvableString

Parameters

| `g:Genome` — FixedLengthStringGenome

toString | () | method |

`public function toString():String`

return a String representation

Returns

| `String` —

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