smile.gap
Interface Chromosome
-
- All Superinterfaces:
- java.lang.Comparable<Chromosome>
- All Known Subinterfaces:
- LamarckianChromosome
- All Known Implementing Classes:
- BitString
public interface Chromosome extends java.lang.Comparable<Chromosome>
Artificial chromosomes in genetic algorithm/programming encoding candidate solutions to an optimization problem. Note that chromosomes have to implement Comparable interface to support comparison of their fitness.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Chromosome[]crossover(Chromosome another)Returns a pair of offsprings by crossovering this one with another one according to the crossover rate, which determines how often will be crossover performed.doublefitness()Returns the fitness of chromosome.voidmutate()For genetic algorithms, this method mutates the chromosome randomly.ChromosomenewInstance()Returns a new random instance.
-
-
-
Method Detail
-
fitness
double fitness()
Returns the fitness of chromosome.
-
newInstance
Chromosome newInstance()
Returns a new random instance.
-
crossover
Chromosome[] crossover(Chromosome another)
Returns a pair of offsprings by crossovering this one with another one according to the crossover rate, which determines how often will be crossover performed. If there is no crossover, offspring is exact copy of parents. Various crossover strategies can be employed.
-
mutate
void mutate()
For genetic algorithms, this method mutates the chromosome randomly. The offspring may have no changes since the mutation rate is usually very low. For Lamarckian algorithms, this method actually does the local search such as such as hill-climbing.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG