code: def add_node(self, node):
          
          num_agents = len(self.nodes(type=Agent))
          curr_generation = int((num_agents - 1) / float(self.generation_size))
          node.generation = curr_generation
  
          if curr_generation == 0 and self.initial_source:
              parent = self._select_oldest_source()
          else:
              parent = self._select_fit_node_from_generation(
                  node_type=type(node), generation=curr_generation - 1
              )
  
          if parent is not None:
              parent.connect(whom=node)
              parent.transmit(to_whom=node)
docs: Link to the agent from a parent based on the parent's fitness