desdeo_mcdm.interactive.ENautilus
Module Contents
Classes
A request class to handle the initial preferences. |
|
A request class to handle the intermediate requests. |
|
A request class to handle termination. |
|
The base class for interactive methods. |
- exception desdeo_mcdm.interactive.ENautilus.ENautilusException[source]
Bases:
Exception
Raised when an exception related to ENautilus is encountered.
- class desdeo_mcdm.interactive.ENautilus.ENautilusInitialRequest(ideal: numpy.ndarray, nadir: numpy.ndarray)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
A request class to handle the initial preferences.
- class desdeo_mcdm.interactive.ENautilus.ENautilusRequest(ideal: numpy.ndarray, nadir: numpy.ndarray, points: numpy.ndarray, lower_bounds: numpy.ndarray, upper_bounds: numpy.ndarray, n_iterations_left: int, distances: numpy.ndarray)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
A request class to handle the intermediate requests.
- class desdeo_mcdm.interactive.ENautilus.ENautilusStopRequest(preferred_point: numpy.ndarray, solution: numpy.ndarray | None = None)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
A request class to handle termination.
- class desdeo_mcdm.interactive.ENautilus.ENautilus(pareto_front: numpy.ndarray, ideal: numpy.ndarray, nadir: numpy.ndarray, objective_names: List[str] | None = None, variables: numpy.ndarray | None = None)[source]
Bases:
desdeo_mcdm.interactive.InteractiveMethod.InteractiveMethod
The base class for interactive methods.
- Parameters:
problem (MOProblem) – The problem being solved in an interactive method.
- start() ENautilusInitialRequest [source]
- iterate(request: ENautilusInitialRequest | ENautilusRequest) ENautilusRequest | ENautilusStopRequest [source]
Perform the next logical iteration step based on the given request type.
- handle_initial_request(request: ENautilusInitialRequest) ENautilusRequest [source]
Handles the initial request by parsing the response appropriately.
- handle_request(request: ENautilusRequest) ENautilusRequest | ENautilusStopRequest [source]
Handles the intermediate requests.
- calculate_representative_points(pareto_front: numpy.ndarray, subset_indices: List[int], n_points: int) numpy.ndarray [source]
Calculates the most representative points on the Pareto front. The points are clustered using k-means.
- Parameters:
pareto_front (np.ndarray) – The Pareto front.
subset_indices (List[int]) – A list of indices representing the subset of the points on the Pareto front for which the representative points should be calculated.
n_points (int) – The number of representative points to be calculated.
- Returns:
- A 2D array of the most representative points. If the
subset of Pareto efficient points is less than n_points, returns the subset of the Pareto front.
- Return type:
np.ndarray
- calculate_intermediate_points(preferred_point: numpy.ndarray, zbars: numpy.ndarray, n_iterations_left: int) numpy.ndarray [source]
Calculates the intermediate points between representative points an a preferred point.
- Parameters:
preferred_point (np.ndarray) – The preferred point, 1D array.
zbars (np.ndarray) – The representative points, 2D array.
n_iterations_left (int) – The number of iterations left.
- Returns:
The intermediate points as a 2D array.
- Return type:
np.ndarray
- calculate_bounds(pareto_front: numpy.ndarray, intermediate_points: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray] [source]
Calculate the new bounds of the reachable points on the Pareto optimal front from each of the intermediate points.
- Parameters:
pareto_front (np.ndarray) – The Pareto optimal front.
intermediate_points (np.ndarray) – The current intermediate points as a 2D array.
- Returns:
The lower and upper bounds for each of the intermediate points.
- Return type:
Tuple[np.ndarray, np.ndarray]
- calculate_distances(intermediate_points: numpy.ndarray, zbars: numpy.ndarray, nadir: numpy.ndarray) numpy.ndarray [source]
- calculate_reachable_point_indices(pareto_front: numpy.ndarray, lower_bounds: numpy.ndarray, upper_bounds: numpy.ndarray) List[int] [source]
Calculate the indices of the reachable Pareto optimal solutions based on lower and upper bounds.
- Returns:
List of the indices of the reachable solutions.
- Return type:
List[int]