Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Sep 8, 2020
Embed
What would you like to do?
def newGeneration(generation, size):
top4 = generation[:4, 0]
newGen = generation[:2,0]
for i in range(0, 4):
for j in range(0, 4):
if(i != j):
c1, c2 = crossover(top4[i], top4[j], size)
newGen = np.append(newGen, c1)
newGen = np.append(newGen, c2)
#print(newGen)
return newGen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment