Skip to content

fitness

FitnessDefault

fitness(self, *, population, points, **kwargs)

Assesses population fitness using supplied mapping

Parameters:

Name Type Description Default
population ndarray

the population to assess fitness

required
points ndarray

1D array of projected points in same order as pool

required
**kwargs

Arbitrary keyword arguments

{}

Returns:

Type Description
np.ndarray

1D array of float

Source code in pangadfs/fitness.py
def fitness(self,
            *, 
            population: np.ndarray, 
            points: np.ndarray,
            **kwargs):
    """Assesses population fitness using supplied mapping

    Args:
        population (np.ndarray): the population to assess fitness
        points (np.ndarray): 1D array of projected points in same order as pool
        **kwargs: Arbitrary keyword arguments

    Returns:
        np.ndarray: 1D array of float

    """
    return np.sum(points[population], axis=1)