Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- population.sort(key = lambda x : -h(x))
- take = population[:len(population) * 0.1]
- new_population = krizenje(take)
- new_population = mutate(new_population)
- population = izumitrije(population)
- def sandpile(N):
- result = []
- matrika = [N][N]
- def izumrtije(epoch, population):
- PK = sandpile(N)
- PK = normilize(PK, 0.3)
- num_dead = PK[epoch%N]
- for i in range(num_dead):
- u = randint(0, len(population) - 1)
- population.pop(u)
- for i in range(num_dead):
- population.append(generator_random_person())
- return population
- for epoch in range(max_epochs):
- population = izumrtije(epoch, population)
- selection = select(population)
- new_population = krizenje(selection)
- new_popualtion = mutations(new_population)
- for (...) if (goa...
- population = new_population
Advertisement
Add Comment
Please, Sign In to add comment