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()
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()
def apply(self, population): self._uniform_variate = UniformVariate(self._minval, self._maxval) for individual in population.getIndividuals(): self._manipulateGenome(individual.getGenome())
def apply(self, population): self._uniform_variate = UniformVariate(self._minval,self._maxval) for individual in population.getIndividuals(): self._manipulateGenome(individual.getGenome())