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

Package | com.suckatmath.machinelearning.genetic.impl
Class | public class FixedLengthStringGene
Inheritance | FixedLengthStringGene Object
Implements | Gene

Gene consisting of a fixed length String

Public Properties

| Property | Defined By
--- | --- | ---
|  | alphabet : String String to use as a alphabet of valid chars | FixedLengthStringGene
|  | content : String contains actual gene info | FixedLengthStringGene
|  | length : int how many chars in the string | FixedLengthStringGene

Public Methods

| Method | Defined By
--- | --- | ---
|  | FixedLengthStringGene(l:int, a:String) create a new FixedLengthStringGene | FixedLengthStringGene
|  | mutate():Gene implementation of Gene.mutate. | FixedLengthStringGene
|  | newRandom():Gene build a new random FixedLengthStringGene | FixedLengthStringGene
|  | toString():String return a String representation. | FixedLengthStringGene

Property Detail

alphabet | property

`public var alphabet:String`

String to use as a alphabet of valid chars

content | property |

`public var content:String`

contains actual gene info

length | property |

`public var length:int`

how many chars in the string

Constructor Detail

FixedLengthStringGene | () | Constructor

`public function FixedLengthStringGene(l:int, a:String)`

create a new FixedLengthStringGene

Parameters

| `l:int` — int length of Gene
| `a:String` — String alphabet

Method Detail

mutate | () | method

`public function mutate():Gene`

implementation of Gene.mutate. Creates a new FixedLengthStringGene slightly different from this one

Returns

| `Gene` — FixedLengthStringGene

newRandom | () | method |

`public function newRandom():Gene`

build a new random FixedLengthStringGene

Returns

| `Gene` — FixedLengthStringGene as Gene

toString | () | method |

`public function toString():String`

return a String representation.

Returns

| `String` —

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