# 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


class Population:

    """
    Model of a population in the ecologigal sense
    """

    def __init__(self, loci: int,
                 fitness_function: callable,
                 fitness_weights=None,
                 limit: int=100,
                 grade_function: callable=None,
                 mate_function: callable=None,
                 mutate_function: callable=None,
                 **kw):
        """
        :param loci: number of elements in an individual's chromosome
        :param fitness_function: accepts a genotype, returns a tuple of fitnesses
        :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


# 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



class Population:

    """
    Model of a population in the ecologigal sense
    """

    def __init__(self, loci: int,
                 fitness_function: callable,
                 fitness_weights=None,
                 limit: int=100,
                 grade_function: callable=None,
                 mate_function: callable=None,
                 mutate_function: callable=None,
                 **kw):
        """
        :param loci: number of elements in an individual's chromosome
        :param fitness_function: accepts a genotype, returns a tuple of fitnesses
        :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)