fitnesses

This commit is contained in:
2025-11-06 22:50:10 +03:00
parent e6765c9254
commit cc180dc700
12 changed files with 959 additions and 65 deletions

View File

@@ -17,6 +17,9 @@ def crossover_subtree(
child2 = parent2.copy()
# Выбираем случайные узлы, не включая корень
if child1.root.get_depth() <= 1 or child2.root.get_depth() <= 1:
return child1, child2
cut1 = random.choice(child1.root.list_nodes()[1:])
cut2 = random.choice(child2.root.list_nodes()[1:])