Esempio n. 1
0
class Randomization(SimpleGenomeManipulation):
    """ Randomizes the genome of all individuals of a population
        Uses UniformVariate to do so.
    """
    def __init__(self, minval=0., maxval=1.):
        SimpleGenomeManipulation.__init__(self)
        self._minval = minval
        self._maxval = maxval

    def apply(self, population):
        self._uniform_variate = UniformVariate(self._minval, self._maxval)
        for individual in population.getIndividuals():
            self._manipulateGenome(individual.getGenome())

    def _manipulateValue(self, value):
        """ See SimpleGenomeManipulation._manipulateValue() for more information """
        return self._uniform_variate.getSample()
Esempio n. 2
0
class Randomization(SimpleGenomeManipulation):
    """ Randomizes the genome of all individuals of a population
        Uses UniformVariate to do so.
    """
    def __init__(self, minval=0., maxval=1.):
        SimpleGenomeManipulation.__init__(self)
        self._minval = minval
        self._maxval = maxval

    def apply(self, population):
        self._uniform_variate = UniformVariate(self._minval,self._maxval)
        for individual in population.getIndividuals():
            self._manipulateGenome(individual.getGenome())

    def _manipulateValue(self, value):
        """ See SimpleGenomeManipulation._manipulateValue() for more information """
        return self._uniform_variate.getSample()
Esempio n. 3
0
 def apply(self, population):
     self._uniform_variate = UniformVariate(self._minval, self._maxval)
     for individual in population.getIndividuals():
         self._manipulateGenome(individual.getGenome())
Esempio n. 4
0
 def apply(self, population):
     self._uniform_variate = UniformVariate(self._minval,self._maxval)
     for individual in population.getIndividuals():
         self._manipulateGenome(individual.getGenome())