All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class evolution.pack.PackableGeneImpl

java.lang.Object
   |
   +----evolution.pack.PackableGeneImpl

public class PackableGeneImpl
extends Object
implements PackableGene
Full implementation of PackableGene based on a Code.


Variable Index

 o data
My genetic data

Constructor Index

 o PackableGeneImpl(Code)
Construct from Code
 o PackableGeneImpl(int, RandomGenerator)
Construct new random gene.

Method Index

 o mutate(float, RandomGenerator)
Mutate myself with a given probability.
 o toCode()
Convert to Code.

Variables

 o data
 protected Code data
My genetic data

Constructors

 o PackableGeneImpl
 public PackableGeneImpl(int size,
                         RandomGenerator rg) throws NoRandomGeneratorException
Construct new random gene.

Throws: NoRandomGeneratorException
if the RandomGenerator is nil
 o PackableGeneImpl
 public PackableGeneImpl(Code b) throws NilException
Construct from Code

Throws: NilException
if the argument is nil

Methods

 o mutate
 public Gene mutate(float prob,
                    RandomGenerator rg) throws NoRandomGeneratorException
Mutate myself with a given probability. In this implementation, a mutation of the gene is defined as the flip of exactly one of its bits.

Parameters:
prob - the mutation probability
rg - the RandomGenerator to use
Returns:
myself
Throws: NoRandomGeneratorException
if rg = nil
 o toCode
 public Code toCode()
Convert to Code.


All Packages  Class Hierarchy  This Package  Previous  Next  Index