:py:mod:`desdeo_emo.recombination`
==================================

.. py:module:: desdeo_emo.recombination

.. autoapi-nested-parse::

   This module provides implementations of various crossover and mutation operators.



Submodules
----------
.. toctree::
   :titlesonly:
   :maxdepth: 1

   BoundedPolynomialMutation/index.rst
   SimulatedBinaryCrossover/index.rst
   SinglePointCrossoverMutation/index.rst
   biogp_mutation/index.rst
   biogp_xover/index.rst
   evodn2_xover_mutation/index.rst
   evonn_xover_mutation/index.rst


Package Contents
----------------

Classes
~~~~~~~

.. autoapisummary::

   desdeo_emo.recombination.BioGP_mutation
   desdeo_emo.recombination.BioGP_xover
   desdeo_emo.recombination.BP_mutation
   desdeo_emo.recombination.EvoDN2Recombination
   desdeo_emo.recombination.EvoNNRecombination
   desdeo_emo.recombination.SBX_xover
   desdeo_emo.recombination.SinglePoint_Xover
   desdeo_emo.recombination.SinglePoint_Mutation




.. py:class:: BioGP_mutation(probability_mutation: float)

   .. py:method:: do(offspring)



.. py:class:: BioGP_xover(probability_crossover: float = 0.9, probability_standard: float = 0.5)

   .. py:method:: do(pop, mating_pop_ids)



.. py:class:: BP_mutation(lower_limits: numpy.ndarray, upper_limits: numpy.ndarray, ProM: float = None, DisM: float = 20)

   .. py:method:: do(offspring: numpy.ndarray)

      Conduct bounded polynomial mutation. Return the mutated individuals.

      :param offspring: The array of offsprings to be mutated.
      :type offspring: np.ndarray

      :returns: The mutated offsprings
      :rtype: np.ndarray



.. py:class:: EvoDN2Recombination(evolver: BaseEA, ProC: float = 0.8, ProM: float = 0.3, mutation_strength: float = 1.0)

   .. py:method:: do(pop, mating_pop_ids: list = None)



.. py:class:: EvoNNRecombination(evolver: BaseEA, ProC: float = 0.8, ProM: float = 0.3, mutation_strength: float = 1.0, mutation_type: str = 'gaussian')

   .. py:method:: do(pop, mating_pop_ids: list = None)



.. py:class:: SBX_xover(ProC: float = 1, DisC: float = 30)

   Simulated binary crossover.

   Parameters
       ----------
       ProC : float, optional
           [description], by default 1
       DisC : float, optional
           [description], by default 30

   .. py:method:: do(pop: numpy.ndarray, mating_pop_ids: list = None) -> numpy.ndarray

      Consecutive members of mating_pop_ids are crossed over
          in pairs. Example: if mating_pop_ids = [0, 2, 3, 6, 5] then the individuals
          are crossover as: [0, 2], [3, 6], [5, 0]. Note: if the number of elements
          is odd, the last individual is crossed over with the first one.

      :param pop: Array of all individuals
      :type pop: np.ndarray
      :param mating_pop_ids:
                             Indices of population members to mate, by default None, which shuffles and
                                 mates whole population
      :type mating_pop_ids: list, optional

      :returns: The offspring produced as a result of crossover.
      :rtype: np.ndarray



.. py:class:: SinglePoint_Xover(ProC: float = 1, DisC: float = 30)

   Simple single point crossover and mutation.

   Parameters
       ----------
       ProC : float, optional
           [description], by default 1
       DisC : float, optional
           [description], by default 30

   .. py:method:: crossover(ind_0, ind_1)

      Single point crossover.
      :param ind_0: individual_0
      :param ind_1: individual_1

      Ret:
          new_0, new_1: the individuals generatd after crossover.


   .. py:method:: mutation(indi)

      Simple mutation.
      Arg:
          indi: individual to mutation.


   .. py:method:: do(pop: numpy.ndarray, mating_pop_ids: list = None) -> numpy.ndarray

      Consecutive members of mating_pop_ids are crossed over
          in pairs. Example: if mating_pop_ids = [0, 2, 3, 6, 5] then the individuals
          are crossover as: [0, 2], [3, 6], [5, 0]. Note: if the number of elements
          is odd, the last individual is crossed over with the first one.

      :param pop: Array of all individuals
      :type pop: np.ndarray
      :param mating_pop_ids:
                             Indices of population members to mate, by default None, which shuffles and
                                 mates whole population
      :type mating_pop_ids: list, optional

      :returns: The offspring produced as a result of crossover.
      :rtype: np.ndarray



.. py:class:: SinglePoint_Mutation(ProC: float = 1, DisC: float = 30)

   Simple single point crossover and mutation.

   Parameters
       ----------
       ProC : float, optional
           [description], by default 1
       DisC : float, optional
           [description], by default 30

   .. py:method:: mutation(indi)

      Simple mutation.
      Arg:
          indi: individual to mutation.


   .. py:method:: do(offspring: numpy.ndarray)

      Consecutive members of mating_pop_ids are crossed over
          in pairs. Example: if mating_pop_ids = [0, 2, 3, 6, 5] then the individuals
          are crossover as: [0, 2], [3, 6], [5, 0]. Note: if the number of elements
          is odd, the last individual is crossed over with the first one.

      :param pop: Array of all individuals
      :type pop: np.ndarray
      :param mating_pop_ids:
                             Indices of population members to mate, by default None, which shuffles and
                                 mates whole population
      :type mating_pop_ids: list, optional

      :returns: The offspring produced as a result of crossover.
      :rtype: np.ndarray



