desdeo_emo.population.Population_old
Module Contents
Classes
Define the population. |
- class desdeo_emo.population.Population_old.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)[source]
Define the population.
- add(new_pop: list)[source]
Evaluate and add individuals to the population. Update ideal and nadir point.
- Parameters:
new_pop (list) – Decision variable values for new population.
- append_individual(ind: numpy.ndarray)[source]
Evaluate and add individual to the population.
- Parameters:
ind (np.ndarray) –
- evaluate_individual(ind: numpy.ndarray)[source]
Evaluate individual.
Returns objective values, constraint violation, and fitness.
- Parameters:
ind (np.ndarray) –
- update_fitness()[source]
Include or exclude objectives from fitness calculation. Problem.minimize should be a list of booleans of same length as the number of objectives.
- delete(indices, preserve=False)[source]
Remove from population individuals which are in indices if preserve=False, otherwise preserve them and remove all others.
- Parameters:
indices (array_like) – Indices of individuals to keep or delete.
preserve (bool) – Whether to delete individuals at indices from current population, or preserve them and delete others.
- evolve(EA: BaseEA = None, ea_parameters: dict = None)[source]
Evolve the population with interruptions.
Evolves the population based on the EA sent by the user.
- Parameters:
EA ("BaseEA") – Should be a derivative of BaseEA (Default value = None)
ea_parameters (dict) – Contains the parameters needed by EA (Default value = None)
- plot_objectives(iteration: int = None)[source]
Plot the objective values of individuals.
- Parameters:
iteration (int) – Iteration count.
- plot_pareto(name, show_all=False)[source]
Plot the pareto front. REMOVE THIS IN THE FUTURE.
- Parameters:
name (str) – Name to append to the plot filename.
show_all (bool) – Show all solutions, including those not on the pareto front.
- hypervolume(ref_point)[source]
Calculate hypervolume. Uses package pygmo. Add checks to prevent errors.
- Parameters:
ref_point –
- update_ideal_and_nadir(new_objective_vals: list = None)[source]
Updates self.ideal and self.nadir in the fitness space.
Uses the entire population if new_objective_vals is none.
- Parameters:
new_objective_vals (list, optional) – Objective values for a newly added individual (the default is None, which calculated the ideal and nadir for the entire population.)