gpalta.core
Class Individual

java.lang.Object
  extended by gpalta.core.Individual
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
MultiTreeIndividual, Tree

public abstract class Individual
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Individuals are the objects that form the population and are modified throughout the evolution. The most common kind of Individual is a Tree, and this is what most applications should use. This class can be extended to create other types of evolutionary objects

See Also:
Serialized Form

Field Summary
 boolean fitCalculated
           
 double hits
           
 
Constructor Summary
Individual()
           
 
Method Summary
abstract  Individual deepClone()
          Get a new, totally independent copy of this individual.
abstract  Output eval(ProblemData problemData)
           
abstract  void evalVect(Output out, TempVectorFactory tempVectorFactory, ProblemData problemData)
           
abstract  int getSize()
          Get the size of this Individual, hopefully without recalculating it (ie. in the case of a Tree, without descending every node).
 boolean isOnPop()
          Ask whether this Individual is already part of the population
 double readFitness()
          Read this individual's fitness, without recalculating it
 void setFitness(double fit)
          Store the fitness, so it doesn't need to be recalculated
 void setOnPop(boolean flag)
          Record that this Individual was selected and is part of the population
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fitCalculated

public boolean fitCalculated

hits

public double hits
Constructor Detail

Individual

public Individual()
Method Detail

getSize

public abstract int getSize()
Get the size of this Individual, hopefully without recalculating it (ie. in the case of a Tree, without descending every node). In most cases, this will mean the number of nodes present in the Individual


deepClone

public abstract Individual deepClone()
Get a new, totally independent copy of this individual. Subclasses must implement this method properly, in order to insure that two instances are not modified unintentionally


readFitness

public double readFitness()
Read this individual's fitness, without recalculating it


setFitness

public void setFitness(double fit)
Store the fitness, so it doesn't need to be recalculated

Parameters:
fit - The fitness value

setOnPop

public void setOnPop(boolean flag)
Record that this Individual was selected and is part of the population


isOnPop

public boolean isOnPop()
Ask whether this Individual is already part of the population


eval

public abstract Output eval(ProblemData problemData)

evalVect

public abstract void evalVect(Output out,
                              TempVectorFactory tempVectorFactory,
                              ProblemData problemData)