com.softtechdesign.ga
Class Chromosome

java.lang.Object
  |
  +--com.softtechdesign.ga.Chromosome
Direct Known Subclasses:
ChromChars, ChromFloat, ChromStrings

public abstract class Chromosome
extends java.lang.Object

Chromosome is the abstract base class for all chromosomes. It defines each chromosome's genes, fitness, fitness rank, and provides simple methods for copying and returning chromosome values as strings. ChromChars, ChromStrings, and ChromFloat both extend Chromosome and model individual candidate solutions. You will probably never need to subclass these classes.

Author:
Jeff Smith jeff@SoftTechDesign.com

Field Summary
protected  double fitness
          absolute (not relative) fitness value
protected  int fitnessRank
          0 = worst fit, PopDim = best fit
 
Constructor Summary
Chromosome()
           
 
Method Summary
(package private) abstract  void copyChromGenes(Chromosome chromosome)
          Copy the genes from the given chromosome over this chromosome's genes
(package private) abstract  java.lang.String getGenesAsStr()
          Get the genes as a string
(package private) abstract  int getNumGenesInCommon(Chromosome chromosome)
          Get the number of genes in common between this chromosome and the given chromosome
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

fitness

protected double fitness
absolute (not relative) fitness value

fitnessRank

protected int fitnessRank
0 = worst fit, PopDim = best fit
Constructor Detail

Chromosome

public Chromosome()
Method Detail

getGenesAsStr

abstract java.lang.String getGenesAsStr()
Get the genes as a string

copyChromGenes

abstract void copyChromGenes(Chromosome chromosome)
Copy the genes from the given chromosome over this chromosome's genes

getNumGenesInCommon

abstract int getNumGenesInCommon(Chromosome chromosome)
Get the number of genes in common between this chromosome and the given chromosome