org.jgap.impl
Class FittestPopulationMerger

java.lang.Object
  extended byorg.jgap.impl.FittestPopulationMerger
All Implemented Interfaces:
IPopulationMerger

public class FittestPopulationMerger
extends java.lang.Object
implements IPopulationMerger

A implementation of the IPopulationMerger interface that merges two populations as specified based on the fitness function, that is, the n fittest chromosomes are returned in the new population, where n is supplied by parameter.

Since:
2.0
Author:
Henrique Goulart

Constructor Summary
FittestPopulationMerger()
           
 
Method Summary
 Population mergePopulations(Population a_population1, Population a_population2, int a_new_population_size)
          Merges two Population's into one that has the given size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FittestPopulationMerger

public FittestPopulationMerger()
Method Detail

mergePopulations

public Population mergePopulations(Population a_population1,
                                   Population a_population2,
                                   int a_new_population_size)
Description copied from interface: IPopulationMerger
Merges two Population's into one that has the given size.

Specified by:
mergePopulations in interface IPopulationMerger
Parameters:
a_population1 - Population first Population
a_population2 - Population second Population
a_new_population_size - int size of merged Population
Returns:
Population the resulting Population