python/src/genetic_search.py
def maybe_add_child_to_offspring(child_to_add: np.ndarray, child_idx: int) -> bool:
            """Adds child if it doesn't already exist by some fluke. Also checks bounds. Returns if child was added"""
            # Don't add if it would be out of bounds
            if child_idx >= offspring.shape[0]:
                return False

            for child in offspring:
                if (child_to_add == child).all():
                    return False  # if child already exists in offspring, don't add
            # Child not found in offspring, so it can be added
            offspring[child_idx] = child_to_add
            return True
Adds child if it doesn't already exist by some fluke. Also checks bounds. Returns if child was added
Adds child if it doesn't already exist by some fluke. Also checks bounds. Returns if child was added
Adds child if it doesn ' t already exist by some fluke . Also checks bounds . Returns if child was added
def maybe_add_child_to_offspring(child_to_add: np.ndarray, child_idx: int) -> bool:
            if child_idx >= offspring.shape[0]:
                return False
            for child in offspring:
                if (child_to_add == child).all():
                    return False  
            offspring[child_idx] = child_to_add
            return True
def maybe_add_child_to_offspring ( child_to_add : np . ndarray , child_idx : int ) -> bool : if child_idx >= offspring . shape [ 0 ] : return False for child in offspring : if ( child_to_add == child ) . all ( ) : return False offspring [ child_idx ] = child_to_add return True
Adds child if it doesn't already exist by some fluke.
Adds child if it doesn ' t already exist by some fluke .
"""Adds child if it doesn't already exist by some fluke. Also checks bounds. Returns if child was added""" # Don't add if it would be out of bounds # if child already exists in offspring, don't add # Child not found in offspring, so it can be added
child_to_add
np.ndarray
child_idx
int