예제 #1
0
파일: IBEA.py 프로젝트: maciewar/evogil
 def _mutation(self):
     self.mating_individuals = [
         self.Individual(
             mutate(x, self.dims, self.mutation_rate, self.mutation_eta))
         for x in self.mating_individuals
     ]
     for ind in self.mating_individuals:
         ind.known_objectives = False
예제 #2
0
    def generate(self, pop):
        selected_parents = [x.value for x in random.sample(pop, 2)]
        child = crossover(selected_parents[0], selected_parents[1], self.dims,
                          self.crossover_rate, self.crossover_eta)

        return Individual(
            self.trim_function(
                mutate(child, self.dims, self.mutation_rate,
                       self.mutation_eta)))
예제 #3
0
파일: SMSEMOA.py 프로젝트: kgadek/evogil
    def generate(self, pop):
        selected_parents = [x.value for x in random.sample(pop, 2)]
        child = crossover(selected_parents[0],
                          selected_parents[1],
                          self.dims,
                          self.crossover_rate,
                          self.crossover_eta)

        return Individual(self.trim_function(mutate(child,
                                                    self.dims,
                                                    self.mutation_rate,
                                                    self.mutation_eta)))
예제 #4
0
파일: SPEA2.py 프로젝트: maciewar/evogil
    def population_generator(self):
        cost = 0

        while True:
            cost = self.calculate_fitnesses(self.__population, self.__archive)
            self.__archive = self.environmental_selection(
                self.__population, self.__archive)

            self.population = [
                self.trim_function(
                    mutate(
                        crossover(self.select(self.__archive),
                                  self.select(self.__archive), self.dims,
                                  self.crossover_rate, self.crossover_eta),
                        self.dims, self.mutation_rate, self.mutation_eta))
                for _ in self.__population
            ]

            yield SPEA2ImgaProxy(self, self.__archive, self.__population, cost)
예제 #5
0
파일: SPEA2.py 프로젝트: dimdimadi/evogil
    def step(self):
        self.cost += self.calculate_fitnesses(self.individuals, self.archive)
        self.archive = self.environmental_selection(self.individuals,
                                                    self.archive)

        self.population = [
            self.trim_function(
                mutate(
                    crossover(
                        self.select(self.archive),
                        self.select(self.archive),
                        self.dims,
                        self.crossover_rate,
                        self.crossover_eta,
                    ),
                    self.dims,
                    self.mutation_rate,
                    self.mutation_eta,
                )) for _ in self.individuals
        ]
예제 #6
0
def population_from_delegate(delegate, size, dims, rate, eta):
    population = [[x for x in delegate]]
    for _ in range(size - 1):
        population.append(drivertools.mutate(delegate, dims, rate, eta))
    return population
예제 #7
0
파일: IBEA.py 프로젝트: kgadek/evogil
 def _mutation(self):
     self.mating_individuals = [
         self.Individual(mutate(x, self.dims, self.mutation_rate, self.mutation_eta)) for x in
         self.mating_individuals]
     for ind in self.mating_individuals:
         ind.known_objectives = False
예제 #8
0
파일: NSGAII.py 프로젝트: dimdimadi/evogil
 def _mutation(self):
     self.mating_individuals = [
         Individual(
             mutate(x, self.dims, self.mutation_rate, self.mutation_eta))
         for x in self.mating_individuals
     ]
예제 #9
0
파일: NSGAII.py 프로젝트: kgadek/evogil
 def _mutation(self):
     self.mating_individuals = [
         self.Individual(mutate(x, self.dims, self.mutation_rate, self.mutation_eta)) for x in
         self.mating_individuals]
예제 #10
0
 def mutate(self, xs):
     return mutate(xs, self.dims, self.mutation_probability, self.mutation_variance)
예제 #11
0
def population_from_delegate_mutate(delegate, size, dims, rate, eta):
    population = [[x for x in delegate]]
    for _ in range(size - 1):
        population.append(drivertools.mutate(delegate, dims, rate, eta))
    return population