Pareto Front
- class SAES.multiobjective.pareto_front.Front(fronts_path: str, references_path: str, metric: str, dimensions: int)
Bases:
ABC
Abstract class to generate Pareto fronts for different algorithms and instances.
- Attributes:
- fronts_path (str):
The path to the folder containing the Pareto fronts.
- references_path (str):
The path to the folder containing the reference fronts.
- metric (str):
The metric used to generate the fronts.
- algorithms (list):
A list of algorithms present in the fronts path.
- instances (list):
A list of instances present in the fronts path.
- logger (Logger):
A logger object to record and display log messages.
- Methods:
- __init__(fronts_path: str, references_path: str, metric: str):
Initializes the Front object with the given fronts path, references path, and metric.
- save(instance: str, output_path: str, median: bool=True):
Generates a Pareto front for the specified instance and saves it to the specified output path.
- show(instance: str, median: bool=True):
Generates a Pareto front for the specified instance and displays it.
- save(instance: str, output_path: str, file_name: str = None, median: bool = True) None
Generates a Pareto front for the specified instance and saves it to the specified output path.
- Args:
- instance (str):
The name of the instance for which the Pareto front is to be generated.
- output_path (str):
The path where the Pareto front image will be saved.
- median (bool):
A boolean indicating whether to generate the median front or the best front. Default is True.
- Returns:
None
- Example:
>>> from SAES.multiobjective.pareto_front import Front2D >>> >>> fronts_path = "path/to/fronts" >>> references_path = "path/to/references" >>> metric = "HV" >>> front = Front2D(fronts_path, references_path, metric) >>> front.save("ZDT1", "path/to/output")
- show(instance: str, median: bool = True) None
Generates a Pareto front for the specified instance and displays it.
- Args:
- instance (str):
The name of the instance for which the Pareto front is to be generated.
- median (bool):
A boolean indicating whether to generate the median front or the best front. Default is True.
- Returns:
None
- Example:
>>> from SAES.multiobjective.pareto_front import Front2D >>> >>> fronts_path = "path/to/fronts" >>> references_path = "path/to/references" >>> metric = "HV" >>> front = Front2D(fronts_path, references_path, metric) >>> front.show("ZDT1")
- class SAES.multiobjective.pareto_front.Front2D(fronts_path: str, references_path: str, metric: str)
Bases:
Front
Class to generate 2D Pareto fronts for different algorithms and instances.