|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectart.ga.Events
This class deal with all the operations performed by the GA, defined evolutionary operations (like selection for reproduction, selection for die, crossover and mutation).
| Constructor Summary | |
Events(GaConfiguration configuration,
Population pop)
Constructor of the class. |
|
| Method Summary | |
void |
crossover(Population pop)
Execute the crossover on the chromosomes selected for reproduction of a given population. |
void |
evaluateFitness(Population pop,
Fitness fitnessUserClass)
Evaluate the fitness of all chromosome in a given population; it has to be used in case of a static problem with a fitness function described in a user class. |
void |
evolve(Population pop)
Execute all the evolutionary operations to move to the next generation. |
void |
loadPopulation(java.io.File filename)
Not implemented. |
void |
mutate(Population pop)
Apply random mutations to the give population at the mutation rate written in the configuration file. |
void |
nextGeneration(Population pop)
Technical operation required to move from the current generation to the next one. |
void |
savePopulation(Population pop)
Not implemented. |
void |
selectChromosomeForDie(Population pop)
Select the chromosomes that are going to die using the roulette wheel technique. |
void |
selectChromosomeForReproduction(Population pop)
Select the chromosomes used as parents in crossover operation using the roulette wheel technique. |
void |
setFitnessEvaluated(boolean b)
Define if the fitness has been evaluated for all the chromosomes of the population in the current generation. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Events(GaConfiguration configuration,
Population pop)
configuration - Configuration used for the events.pop - Events are performed on this population.| Method Detail |
public void crossover(Population pop)
pop - The population on which execute crossoverevolve(Population)
public void evaluateFitness(Population pop,
Fitness fitnessUserClass)
pop - Population on which compute the fitnessfitnessUserClass - User defined class describing the fitness function. This class must implement the Fitness interfaceFitness,
GaManager.computeBestSolution(Fitness)public void evolve(Population pop)
pop - Population to evolveFitnesspublic void loadPopulation(java.io.File filename)
filename - File from which load population.public void mutate(Population pop)
When an extended alphabet is used (domain > 2 in configuration file) attention is paid to avoid the mutation from a value to the same value.
pop - Population to mutatepublic void nextGeneration(Population pop)
pop - evolve(Population)public void savePopulation(Population pop)
pop - Population to savepublic void selectChromosomeForDie(Population pop)
pop - Apply selection to this Populationcrossover(Population),
evolve(Population),
Population.getTotalFitness(),
Population.getTotalFitness(),
selectChromosomeForDie(Population)public void selectChromosomeForReproduction(Population pop)
pop - Apply selection to this Populationcrossover(Population),
Population.getTotalFitness(),
Population.getTotalFitness()public void setFitnessEvaluated(boolean b)
b - Boolean defining if fitness is evaluated
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||