:py:mod:`desdeo_emo.population.Population_old`
==============================================

.. py:module:: desdeo_emo.population.Population_old


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   desdeo_emo.population.Population_old.Population




.. py:class:: Population(problem: desdeo_problem.MOProblem, assign_type: str = 'RandomDesign', pop_size=None, recombination_type=None, crossover_type='simulated_binary_crossover', mutation_type='bounded_polynomial_mutation', *args)

   Define the population.

   .. py:method:: add(new_pop: list)

      Evaluate and add individuals to the population. Update ideal and nadir point.

      :param new_pop: Decision variable values for new population.
      :type new_pop: list


   .. py:method:: append_individual(ind: numpy.ndarray)

      Evaluate and add individual to the population.

      :param ind:
      :type ind: np.ndarray


   .. py:method:: evaluate_individual(ind: numpy.ndarray)

      Evaluate individual.

      Returns objective values, constraint violation, and fitness.

      :param ind:
      :type ind: np.ndarray


   .. py:method:: eval_fitness(obj)

      Calculate fitness based on objective values. Fitness = obj if minimized.


   .. py:method:: update_fitness()

      Include or exclude objectives from fitness calculation.
      Problem.minimize should be a list of booleans of same length as the number of
      objectives.


   .. py:method:: delete(indices, preserve=False)

      Remove from population individuals which are in indices if preserve=False,
      otherwise preserve them and remove all others.

      :param indices: Indices of individuals to keep or delete.
      :type indices: array_like
      :param preserve: Whether to delete individuals at indices from current population, or
                       preserve them and delete others.
      :type preserve: bool


   .. py:method:: evolve(EA: BaseEA = None, ea_parameters: dict = None)

      Evolve the population with interruptions.

      Evolves the population based on the EA sent by the user.

      :param EA: Should be a derivative of BaseEA (Default value = None)
      :type EA: "BaseEA"
      :param ea_parameters: Contains the parameters needed by EA (Default value = None)
      :type ea_parameters: dict


   .. py:method:: mate(mating_pop=None, params=None)

      Conduct crossover and mutation over the population.




   .. py:method:: plot_init_()

      Initialize animation object. Return figure


   .. py:method:: plot_objectives(iteration: int = None)

      Plot the objective values of individuals.

      :param iteration: Iteration count.
      :type iteration: int


   .. py:method:: plot_pareto(name, show_all=False)

      Plot the pareto front. REMOVE THIS IN THE FUTURE.

      :param name: Name to append to the plot filename.
      :type name: str
      :param show_all: Show all solutions, including those not on the pareto front.
      :type show_all: bool


   .. py:method:: hypervolume(ref_point)

      Calculate hypervolume. Uses package pygmo. Add checks to prevent errors.

      :param ref_point:


   .. py:method:: non_dominated()

      Fix this. check if nd2 and nds mean the same thing


   .. py:method:: update_ideal_and_nadir(new_objective_vals: list = None)

      Updates self.ideal and self.nadir in the fitness space.

      Uses the entire population if new_objective_vals is none.

      :param new_objective_vals: Objective values for a newly added individual (the default is None, which
                                 calculated the ideal and nadir for the entire population.)
      :type new_objective_vals: list, optional



