# Path: brainforge/config/numeric.py

# 
# Path: brainforge/util/typing.py
# def zX(*dims, dtype=floatX):
#     return np.zeros(dims, dtype=dtype)
# 
# def zX_like(array, dtype=floatX):
#     return zX(*array.shape, dtype=dtype)


import warnings
import numpy as np
from ..config.numeric import floatX
from ..util.typing import zX, zX_like
        :param fitness_weights: used as summation weights if grade_function is not set
        :param limit: maximum number of individuals
        :param grade_function: accepts fitnesses of an individual, returns scalar
        :param mate_function: accepts two genotypes, returns an offspring genotype
        :param mutate_function: accepts individuals and mutation rate, returns mutants
         and index of mutants
        """
        del kw
        self.fitness = fitness_function
        self.limit = limit

        self.grades = zX(limit)
        if grade_function is None:
            if fitness_weights is None:
                fitness_weights = np.array([1.])
            self.grade_function = self._default_grade_function
        else:
            if fitness_weights is not None:
                warnings.warn("grade_function supplied, fitness_weights ignored!")
            self.grade_function = grade_function

        self.mate_function = (self._default_mate_function
                              if mate_function is None
                              else mate_function)
        self.mutation = (self._default_mutate_function
                         if mutate_function is None
                         else mutate_function)

        self.fitnesses = zX(limit, len(fitness_weights))
        self.fitness_w = fitness_weights

# Path: brainforge/config/numeric.py

# 
# Path: brainforge/util/typing.py
# def zX(*dims, dtype=floatX):
#     return np.zeros(dims, dtype=dtype)
# 
# def zX_like(array, dtype=floatX):
#     return zX(*array.shape, dtype=dtype)


# Path: brainforge/evolution/_evolution.py
import warnings
import numpy as np
from ..config.numeric import floatX
from ..util.typing import zX, zX_like

        :param fitness_weights: used as summation weights if grade_function is not set
        :param limit: maximum number of individuals
        :param grade_function: accepts fitnesses of an individual, returns scalar
        :param mate_function: accepts two genotypes, returns an offspring genotype
        :param mutate_function: accepts individuals and mutation rate, returns mutants
         and index of mutants
        """
        del kw
        self.fitness = fitness_function
        self.limit = limit

        self.grades = zX(limit)
        if grade_function is None:
            if fitness_weights is None:
                fitness_weights = np.array([1.])
            self.grade_function = self._default_grade_function
        else:
            if fitness_weights is not None:
                warnings.warn("grade_function supplied, fitness_weights ignored!")
            self.grade_function = grade_function

        self.mate_function = (self._default_mate_function
                              if mate_function is None
                              else mate_function)
        self.mutation = (self._default_mutate_function
                         if mutate_function is None
                         else mutate_function)

        self.fitnesses = zX(limit, len(fitness_weights))
        self.fitness_w = fitness_weights

        self.individuals = np.random.uniform(size=(limit, loci)).astype(floatX)