genome.py
def add_connection_mutation(self):
        """
        In the add connection mutation, a single new connection gene is added
        connecting two previously unconnected nodes.
        """
        # TODO: better algorithm?

        potential_inputs = [n.id for n in self.node_genes if n.type != 'output']
        potential_outputs = [n.id for n in self.node_genes if n.type != 'input' and n.type != 'bias']

        if len(potential_outputs) is not 0 and len(potential_inputs) is not 0:
            node_in_id = random.choice(potential_inputs)
            node_out_id = random.choice(potential_outputs)

            if self._is_valid_connection(node_in_id, node_out_id):
                # Add connection
                self.add_connection_gene(node_in_id, node_out_id)

        In the add connection mutation, a single new connection gene is added
        connecting two previously unconnected nodes.
        
In the add connection mutation, a single new connection gene is added
connecting two previously unconnected nodes.
In the add connection mutation a single new connection gene is added connecting two previously unconnected nodes .
def add_connection_mutation(self):
        potential_inputs = [n.id for n in self.node_genes if n.type != 'output']
        potential_outputs = [n.id for n in self.node_genes if n.type != 'input' and n.type != 'bias']
        if len(potential_outputs) is not 0 and len(potential_inputs) is not 0:
            node_in_id = random.choice(potential_inputs)
            node_out_id = random.choice(potential_outputs)
            if self._is_valid_connection(node_in_id, node_out_id):
                self.add_connection_gene(node_in_id, node_out_id)
def add_connection_mutation ( self ) : potential_inputs = [ n . id for n in self . node_genes if n . type != 'output' ] potential_outputs = [ n . id for n in self . node_genes if n . type != 'input' and n . type != 'bias' ] if len ( potential_outputs ) is not 0 and len ( potential_inputs ) is not 0 : node_in_id = random . choice ( potential_inputs ) node_out_id = random . choice ( potential_outputs ) if self . _is_valid_connection ( node_in_id , node_out_id ) : self . add_connection_gene ( node_in_id , node_out_id )
In the add connection mutation, a single new connection gene is added
connecting two previously unconnected nodes.
In the add connection mutation a single new connection gene is added connecting two previously unconnected nodes .
"""
        In the add connection mutation, a single new connection gene is added
        connecting two previously unconnected nodes.
        """ # TODO: better algorithm? # Add connection
self