You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Burak.
Many thnx for your implementation✌🏼
With my friend Cagla Yaman, we implement an alternative two-point crossover function using your code environment.
I hope this will be helpful for other people👍🏼
Best.
def crossover(parents):
parent1 = parents[0]
parent2 = parents[1]
length_of_parent = len(parent1)
first_point = int(length_of_parent / 2 - length_of_parent / 4)
second_point = int(length_of_parent - first_point)
intersect = parent1[first_point:second_point]
child = []
index = 0
for pos2 in range(len(parent2)):
if first_point <= index < second_point:
child.extend(intersect)
index = second_point
if parent2[pos2] not in intersect:
child.append(parent2[pos2])
index += 1
return child
The text was updated successfully, but these errors were encountered:
Hi Burak.
Many thnx for your implementation✌🏼
With my friend Cagla Yaman, we implement an alternative two-point crossover function using your code environment.
I hope this will be helpful for other people👍🏼
Best.
The text was updated successfully, but these errors were encountered: