edu.ksu.cis.kdd.ga
Class Subpopulation

java.lang.Object
  extended byedu.ksu.cis.kdd.ga.Subpopulation

public class Subpopulation
extends java.lang.Object

Author:
Roby Joehanes

Field Summary
protected  Chromosome[] chromosomes
           
protected  java.lang.Class[] constParam
           
protected  Constraint constraint
           
protected  double elitePercentage
           
protected  int eliteSize
           
protected  Fitness fitness
           
protected  java.util.LinkedList op
           
protected  GAOp[] opCache
           
protected  java.util.LinkedList opProb
           
protected  double[] opProbCache
           
protected  int opSize
           
protected  double opTotalProb
           
static MersenneTwisterFast random
           
protected  int size
           
 
Constructor Summary
Subpopulation(int size, Chromosome chrom, Fitness f)
           
 
Method Summary
 void addOperator(GAOp op, double p)
           
protected  Chromosome chooseChromosome()
           
protected  GAOp chooseOperator()
           
 Chromosome getBestChromosome()
           
 Constraint getConstraint()
           
 double getElitePercentage()
           
 Fitness getFitness()
           
 void newGeneration()
           
protected  void precacheOp()
           
 void removeOp(GAOp op)
           
 void setConstraint(Constraint constraint)
          Sets the constraint.
 void setElitePercentage(double elitePercentage)
          Sets the elitePercentage.
 void setFitness(Fitness fitness)
          Sets the fitness.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chromosomes

protected Chromosome[] chromosomes

size

protected int size

op

protected java.util.LinkedList op

opProb

protected java.util.LinkedList opProb

opTotalProb

protected double opTotalProb

opSize

protected int opSize

opCache

protected GAOp[] opCache

opProbCache

protected double[] opProbCache

elitePercentage

protected double elitePercentage

eliteSize

protected int eliteSize

fitness

protected Fitness fitness

constraint

protected Constraint constraint

random

public static final MersenneTwisterFast random

constParam

protected java.lang.Class[] constParam
Constructor Detail

Subpopulation

public Subpopulation(int size,
                     Chromosome chrom,
                     Fitness f)
Method Detail

newGeneration

public void newGeneration()

chooseChromosome

protected Chromosome chooseChromosome()

chooseOperator

protected GAOp chooseOperator()

getBestChromosome

public Chromosome getBestChromosome()

precacheOp

protected void precacheOp()

addOperator

public void addOperator(GAOp op,
                        double p)

removeOp

public void removeOp(GAOp op)

getElitePercentage

public double getElitePercentage()
Returns:
double

setElitePercentage

public void setElitePercentage(double elitePercentage)
Sets the elitePercentage.

Parameters:
elitePercentage - The elitePercentage to set

getFitness

public Fitness getFitness()
Returns:
Fitness

setFitness

public void setFitness(Fitness fitness)
Sets the fitness.

Parameters:
fitness - The fitness to set

getConstraint

public Constraint getConstraint()
Returns:
Constraint

setConstraint

public void setConstraint(Constraint constraint)
Sets the constraint.

Parameters:
constraint - The constraint to set