viz
This commit is contained in:
@ -80,6 +80,11 @@ class Genome:
|
||||
for _ in range(outputs):
|
||||
genome.add_node(node_type=NodeType.OUTPUT)
|
||||
|
||||
# Fully connect
|
||||
for i in range(inputs):
|
||||
for o in range(inputs, inputs + outputs):
|
||||
genome.add_connection(i, o, weight=1)
|
||||
|
||||
return genome
|
||||
|
||||
|
||||
@ -112,7 +117,7 @@ def _mutate_add_node(genome: Genome) -> None:
|
||||
|
||||
# Find connection to split
|
||||
try:
|
||||
connection = choice(list(genome.connections.values()))
|
||||
connection = choice([node for node in genome.connections.values() if not node.disabled])
|
||||
except IndexError:
|
||||
return
|
||||
connection.disabled = True
|
||||
|
||||
Reference in New Issue
Block a user