|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 Cell
s 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:
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 |
public double getFitness()
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.
double
representing the fitness of this
Cell
public double evaluateFitness(Environment env)
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.
env
- the Environment
to evaluate against
double
representing the fitness of this
Cell
public int getMaturity()
Cell
.
Cell
public void condemn()
public void mutate()
public void mature()
public Population combine(Population parents)
CellCell
called is the first Cell in the
Population
.
parents
- the chosen Population
of parents for
the new cell
Population
to be added into the population
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |