| Package | com.suckatmath.machinelearning.genetic.impl |
| Class | public class FixedLengthStringGenome |
| Inheritance | FixedLengthStringGenome Object |
| Implements | Genome |
| Property | Defined By | ||
|---|---|---|---|
| alphabet : String
alphabet of valid letters
| FixedLengthStringGenome | ||
| content : String
backing string
| FixedLengthStringGenome | ||
| length : int
length of backing string
| FixedLengthStringGenome | ||
| Method | Defined By | ||
|---|---|---|---|
FixedLengthStringGenome(l:int = 0, ab:String = abcdefghijklmnopqrstuvwxyz, c:String = null)
create a new FixedLengthStringGenome
| FixedLengthStringGenome | ||
return a copy of this Genome
| FixedLengthStringGenome | ||
"sexual" reproduction. | FixedLengthStringGenome | ||
return a new FixedLengthStringGenome copy, possibly mutated
| FixedLengthStringGenome | ||
return a new FixedLengthStringGenome filled with random letters from alphabet
| FixedLengthStringGenome | ||
toString():String
returns String representation
| FixedLengthStringGenome | ||
| alphabet | property |
public var alphabet:Stringalphabet of valid letters
| content | property |
public var content:Stringbacking string
| length | property |
public var length:intlength of backing string
| FixedLengthStringGenome | () | Constructor |
public function FixedLengthStringGenome(l:int = 0, ab:String = abcdefghijklmnopqrstuvwxyz, c:String = null)create a new FixedLengthStringGenome
Parametersl:int (default = 0) — int length
| |
ab:String (default = abcdefghijklmnopqrstuvwxyz) — String alphabet
| |
c:String (default = null) — String content - if null, will be random
|
| clone | () | method |
| crossover | () | method |
public function crossover(others:Array, np:int):Genome"sexual" reproduction. Combines this Genome with others by splicing together parts at crossover points
Parameters
others:Array — Array of FixedLengthStringGenome parents
| |
np:int — int number of crossover points
|
Genome — FixedLengthStringGenome as Genome
|
| mutate | () | method |
public function mutate(probability:Number):Genomereturn a new FixedLengthStringGenome copy, possibly mutated
Parameters
probability:Number — Number
|
Genome — FixedLengthStringGenome as Genome
|
| newRandom | () | method |
public function newRandom():Genomereturn a new FixedLengthStringGenome filled with random letters from alphabet
ReturnsGenome —
|
| toString | () | method |
public function toString():Stringreturns String representation
ReturnsString —
|