Packagecom.suckatmath.machinelearning.genetic.impl
Classpublic class BinaryTreeGenome
InheritanceBinaryTreeGenome Inheritance Object
Implements Genome

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



Public Properties
 PropertyDefined 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
 MethodDefined By
  
constructs a new empty BinaryTreeGenome
BinaryTreeGenome
  
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
  
generate a new random BinaryTreeGenome
BinaryTreeGenome
  
sets left child genome
BinaryTreeGenome
  
set back reference to parent genome
BinaryTreeGenome
  
setRandomNodeLimit(i:int):void
set maximum number of nodes to generate in newRandom
BinaryTreeGenome
  
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
geneproperty
public var gene:Gene

content Gene for this node

leftproperty 
public var left:BinaryTreeGenome

BinaryTreeGenome left child of this Genome

parentproperty 
public var parent:BinaryTreeGenome

reference to parent BinaryTreeGenome

randomNodeLimitproperty 
public var randomNodeLimit:int

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

rightproperty 
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