net.openai.ai.ga.cell
Interface Cell

All Known Implementing Classes:
AbstractCell

public interface Cell

The Cell interface is an encapsulation of data that will be used to try to solve a problem (Environment). It is provided as an Interface to allow for maximum flexibility in the implementation of the solution. The Cells must know how to interact with the Environment, as none of that is provided here. A Cell must know how to perform the following functions:

Since:
JDK1.3
Version:
%I%, %G%
Author:
Jared Grubb

Method Summary
 Population combine(Population parents)
          Tells the cell to create new offspring, which will be placed in the population.
 void condemn()
          Tells the cell that it has been condemned to die.
 double evaluateFitness(Environment env)
          Return the fitness of the Cell.
 double getFitness()
          Return the fitness of the Cell.
 int getMaturity()
          Returns the maturity of the Cell.
 void mature()
          Tells the cell to mature.
 void mutate()
          Tells the cell that it has been chosen to mutate.
 

Method Detail

getFitness

public double getFitness()
Return the fitness of the Cell. This call does not neccessarily require that a new evaluation is performed, only that the last fitness generated is desired. This is the preferred method for any function curious about the cell's fitness as it should not require any complex calculations. The fitness must be quantifiable as an integer.

Returns:
a double representing the fitness of this Cell

evaluateFitness

public double evaluateFitness(Environment env)
Return the fitness of the Cell. This call asks that a new evaluation is performed. This method is called during every iteration of a Population. The implementation must determine whether a new evaluation is required or whether the last returned value will suffice. The fitness must be quantifiable as an integer. This function should only be called if there is reason to ask for a new value, but should be generally avoided since it may require extra overhead.

Parameters:
env - the Environment to evaluate against
Returns:
a double representing the fitness of this Cell

getMaturity

public int getMaturity()
Returns the maturity of the Cell.

Returns:
the maturity of this Cell

condemn

public void condemn()
Tells the cell that it has been condemned to die. This allows for any extra clean-up necessary or for record-keeping of cells that are removed from a population. It is not required that the Cell destroy itself or any objects, but is provided as notification that the Cell will be removed from the population.


mutate

public void mutate()
Tells the cell that it has been chosen to mutate.


mature

public void mature()
Tells the cell to mature. This function is called before evaluation on the cells. Outside calling of this function should be avoided as it may cause over-maturation of a cell. This function may also be as simple as incrementing the age of the cell.


combine

public Population combine(Population parents)
Tells the cell to create new offspring, which will be placed in the population. The offspring should be new CellCell called is the first Cell in the Population.

Parameters:
parents - the chosen Population of parents for the new cell
Returns:
a new Population to be added into the population


Copyright - 2001 OpenAI Labs. All Rights Reserved.