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

Package | com.suckatmath.machinelearning.genetic.impl
Class | public class BinaryTreeGenome
Inheritance | BinaryTreeGenome Object
Implements | Genome

Binary tree backed Genome. This uses non-isomorphic trees, and may grow arbitrarily.

Public Properties

| Property | Defined By
--- | --- | ---
|  | gene : Gene content Gene for this node | BinaryTreeGenome
|  | left : BinaryTreeGenome BinaryTreeGenome left child of this Genome | BinaryTreeGenome
|  | parent : BinaryTreeGenome reference to parent BinaryTreeGenome | BinaryTreeGenome
|  | randomNodeLimit : int maximum number of random nodes to generate in newRandom - defaults to 1 | BinaryTreeGenome
|  | right : BinaryTreeGenome BinaryTreeGenome right child of this Genome | BinaryTreeGenome

Public Methods

| Method | Defined By
--- | --- | ---
|  | BinaryTreeGenome() constructs a new empty BinaryTreeGenome | BinaryTreeGenome
|  | clone():Genome return a copy of this BinaryTreeGenome | BinaryTreeGenome
|  | crossover(others:Array, numpoints:int):Genome generate a new genome through "sexual" reproduction combining subtrees of a collection of BinaryTreeGenomes | BinaryTreeGenome
|  | mutate(probability:Number):Genome create a copy of this Genome with some probability of mutation in a single Gene | BinaryTreeGenome
|  | newRandom():Genome generate a new random BinaryTreeGenome | BinaryTreeGenome
|  | setLeft(b:BinaryTreeGenome):void sets left child genome | BinaryTreeGenome
|  | setParent(b:BinaryTreeGenome):void set back reference to parent genome | BinaryTreeGenome
|  | setRandomNodeLimit(i:int):void set maximum number of nodes to generate in newRandom | BinaryTreeGenome
|  | setRight(b:BinaryTreeGenome):void sets right child genome | BinaryTreeGenome
|  | toString():String return a String representation of this BinaryTreeGenome reports in indented multi-line depth first order, where left is before right | BinaryTreeGenome

Property Detail

gene | property

`public var gene:Gene`

content Gene for this node

left | property |

`public var left:BinaryTreeGenome`

BinaryTreeGenome left child of this Genome

parent | property |

`public var parent:BinaryTreeGenome`

reference to parent BinaryTreeGenome

randomNodeLimit | property |

`public var randomNodeLimit:int`

maximum number of random nodes to generate in newRandom - defaults to 1

right | property |

`public var right:BinaryTreeGenome`

BinaryTreeGenome right child of this Genome

Constructor Detail

BinaryTreeGenome | () | Constructor

`public function BinaryTreeGenome()`

constructs a new empty BinaryTreeGenome

Method Detail

clone | () | method

`public function clone():Genome`

return a copy of this BinaryTreeGenome

Returns

| `Genome` — BinaryTreeGenome as Genome

crossover | () | method |

`public function crossover(others:Array, numpoints:int):Genome`

generate a new genome through "sexual" reproduction combining subtrees of a collection of BinaryTreeGenomes

Parameters

| `others:Array` — Array of BinaryTreeGenome
| `numpoints:int` — int number of splice points for subtree replacement

Returns

| `Genome` — BinaryTreeGenome as Genome

mutate | () | method |

`public function mutate(probability:Number):Genome`

create a copy of this Genome with some probability of mutation in a single Gene

Parameters

| `probability:Number`

Returns

| `Genome` — Genome

newRandom | () | method |

`public function newRandom():Genome`

generate a new random BinaryTreeGenome

Returns

| `Genome` — BinaryTreeGenome as Genome

setLeft | () | method |

`public function setLeft(b:BinaryTreeGenome):void`

sets left child genome

Parameters

| `b:BinaryTreeGenome` — BinaryTreeGenome

setParent | () | method |

`public function setParent(b:BinaryTreeGenome):void`

set back reference to parent genome

Parameters

| `b:BinaryTreeGenome` — BinaryTreeGenome

setRandomNodeLimit | () | method |

`public function setRandomNodeLimit(i:int):void`

set maximum number of nodes to generate in newRandom

Parameters

| `i:int` — int

setRight | () | method |

`public function setRight(b:BinaryTreeGenome):void`

sets right child genome

Parameters

| `b:BinaryTreeGenome` — BinaryTreeGenome

toString | () | method |

`public function toString():String`

return a String representation of this BinaryTreeGenome reports in indented multi-line depth first order, where left is before right

Returns

| `String` — String

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