'A genetic algorithm is a stochastic search method  based on natural selection.
Each generation, the fittest candidates are selected and recombined into a new generation.
With each new generation the system converges towards an optimal fitness.'

def __init__(self, candidates=[], **kwargs):

    self.population = candidates
    self.generation = 0
    for f in ('fitness', 'combine', 'mutate'):
        if (f in kwargs):
            setattr(self, f, types.MethodType(kwargs[f], self))
