This repository contains a multi-objective optimization script for prosthetic heart valve leaflet design improvement using the pymoo library. The custom problem is described by parameters, multiple objectives, and constraints. The algorithm used is NSGA-II.
- optimizer.py: Contains an optimization algorithm based on the class
Problem
. Custom classProblem
(derived from pymoo'sElementwiseProblem
) defines objectives, parameters, and constraints, along with the_evaluate
method to calculate them. - test_problem.py: Contains
optimization_problem_test
, which evaluates a specific problem ("welded_beam") based on given parameters and returns objective and constraint results. - visualization.py: Contains functions to create various plots, such as Pareto fronts, objective convergence, hypervolume, scatter plots, and parallel coordinates.
The custom problem class Problem
is defined with:
- Parameters: Dictionary of parameter names and their lower and upper bounds (e.g.,
'param1': (0.01, 10.0)
). - Objectives: List of objective names to optimize (e.g.,
['objective1', 'objective2']
). - Constraints: List of constraint names representing conditions to meet
(e.g.,
['constraint1', 'constraint2', 'constraint3', 'constraint4']
):- Constraints are defined numerically, where each constraint function outputs a value representing the degree of violation.
- A constraint value less than or equal to zero (<= 0) indicates that the constraint is satisfied (non-violated).
- A positive constraint value (> 0) indicates a violation.
The optimization is using the following components:
- Algorithm Initialization: Defines population size, crossover, mutation, and other parameters.
- Termination Criteria: Conditions for ending the optimization, such as maximum generations and evaluations.
- Results Extraction: A function
extract_optimization_results
that extracts optimization results into DataFrames for analysis and storage.
The repository contains several visualization functions to analyze the optimization results:
- Pareto Front: Shows the Pareto-optimal solutions.
- Objective Convergence: Displays how objectives improve over generations.
- Hypervolume: Shows convergence by hypervolume.
- Scatter Plots: Plots objectives against parameters and constraints.
- Parallel Coordinates: Plots multiple variables on parallel axes to understand relationships.
Necessary dependencies are listed in requirements.txt
.
- Try R-NSGA-II.
- Try NSGA-III.
- Try U-NSGA-III.
- Try R-NSGA-III.
- Try MOEA/D.
For more information about pymoo and its multi-objective optimization features, refer to the [pymoo documentation] (https://pymoo.org/documentation.html).