desdeo_mcdm.interactive.NautilusNavigator
Module Contents
Classes
Request to stop navigation and return the solution found (or the |
|
Request to handle interactions with NAUTILUS Navigator. See the |
|
Implementations of the NAUTILUS Navigator algorithm. |
Attributes
- class desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigatorStopRequest(reachable_idx: List[int], pareto_front: numpy.ndarray, decision_variables: numpy.ndarray | None = None)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
Request to stop navigation and return the solution found (or the currently reachable solutions, if stopped before the navigation ends.
- class desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigatorRequest(ideal: numpy.ndarray, nadir: numpy.ndarray, reachable_lb: numpy.ndarray, reachable_ub: numpy.ndarray, user_bounds: List[float], reachable_idx: List[int], step_number: int, steps_remaining: int, distance: float, allowed_speeds: List[int], current_speed: int, navigation_point: numpy.ndarray)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
Request to handle interactions with NAUTILUS Navigator. See the NautilusNavigator class for further details.
- exception desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigatorException[source]
Bases:
Exception
Raised when an exception related to NAUTILUS Navigator is encountered.
- class desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigator(pareto_front: numpy.ndarray, ideal: numpy.ndarray, nadir: numpy.ndarray, decision_variables: numpy.ndarray | None = None)[source]
Bases:
desdeo_mcdm.interactive.InteractiveMethod.InteractiveMethod
Implementations of the NAUTILUS Navigator algorithm.
- Parameters:
pareto_front (np.ndarray) – A two dimensional numpy array representing a Pareto front with objective vectors on each of its rows.
ideal (np.ndarray) – The ideal objective vector of the problem being represented by the Pareto front.
nadir (np.ndarray) – The nadir objective vector of the problem being represented by the Pareto front.
decision_variables (Optional[np.ndarray]) – Two dimensinoal numpy array of decision variables that can be optionally supplied. The i’th vector in decision_variables should result in the i’th objective vector in pareto_front. Defaults to None.
- Raises:
NautilusNavigatorException – One or more dimension mismatches are
encountered among the supplies arguments. –
- start() → NautilusNavigatorRequest[source]
Returns the first Request object to begin iterating.
- Returns:
The Request.
- Return type:
- iterate(request: NautilusNavigatorRequest) → NautilusNavigatorRequest[source]
Perform the next logical step based on the response in the Request.
- handle_request(request: NautilusNavigatorRequest) → NautilusNavigatorRequest | NautilusNavigatorStopRequest[source]
Handle the Request and its contents.
- Parameters:
request (NautilusNavigatorRequest) – A Request with a defined response.
- Returns:
Some of the contents of the response are invalid.
- Return type:
- update(ref_point: numpy.ndarray, speed: int, go_to_previous: bool, stop: bool, step_number: int | None = None, nav_point: numpy.ndarray | None = None, lower_bounds: numpy.ndarray | None = None, upper_bounds: numpy.ndarray | None = None, user_bounds: numpy.ndarray | None = None, reachable_idx: List[int] | None = None, distance: float | None = None, steps_remaining: int | None = None) → NautilusNavigatorRequest | None[source]
Update the internal state of self.
- Parameters:
ref_point (np.ndarray) – A reference point given by a decision maker.
speed (int) – An integer value between 1-5 indicating the navigation speed.
go_to_previous (bool) – If True, the parameters indicate the state of a previous state, and the request is handled accordingly.
stop (bool) – If the navigation should stop. If True, returns a request with self’s current state.
step_number (Optional[int], optional) – Current step number, or previous step number if go_to_previous is True. Defaults to None.
nav_point (Optional[np.ndarray], optional) – The current navigation point. Relevant if go_to_previous is True. Defaults to None.
lower_bounds (Optional[np.ndarray], optional) – Lower bounds of the reachable objective vector values. Relevant if go_to_previous is True. Defaults to None.
upper_bounds (Optional[np.ndarray], optional) – Upper bounds of the reachable objective vector values. Relevant if go_to_previous is True. Defaults to None.
user_bounds (Optional[np.ndarray], optional) – The user given bounds for each objective. The reachable lower limit with attempt to not exceed the given bounds for each objective value.
reachable_idx (Optional[List[int]], optional) – Indices of the reachable Pareto optimal solutions. Relevant if go_to_previous is True. Defaults to None.
distance (Optional[float], optional) – Distance to the Pareto optimal front. Relevant if go_to_previous is True. Defaults to None.
steps_remaining (Optional[int], optional) – Remaining steps in the navigation. Relevant if go_to_previous is True. Defaults to None.
- Returns:
Some of the given parameters are erroneous.
- Return type:
- 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]
- static solve_nautilus_asf_problem(pareto_f: numpy.ndarray, subset_indices: List[int], ref_point: numpy.ndarray, ideal: numpy.ndarray, nadir: numpy.ndarray, user_bounds: numpy.ndarray) → int[source]
Forms and solves the achievement scalarizing function to find the closest point on the Pareto optimal front to the given reference point.
- Parameters:
pareto_f (np.ndarray) – The whole Pareto optimal front.
subset_indices ([type]) – Indices of the currently reachable solutions.
ref_point (np.ndarray) – The reference point indicating a decision maker’s preference.
ideal (np.ndarray) – Ideal point.
nadir (np.ndarray) – Nadir point.
user_bounds (np.ndarray) – Bounds given by the user (the DM) for each objective,which should not be exceeded. A 1D array where NaN’s indicate ‘no bound is given’ for the respective objective value.
- Returns:
Index of the closest point according the minimized value of the ASF.
- Return type:
int
- calculate_navigation_point(projection: numpy.ndarray, nav_point: numpy.ndarray, steps_remaining: int) → numpy.ndarray[source]
Calculate a new navigation point based on the projection of the preference point to the Pareto optimal front.
- Parameters:
projection (np.ndarray) – The point on the Pareto optimal front closest to the preference point given by a decision maker.
nav_point (np.ndarray) – The previous navigation point.
steps_remaining (int) – How many steps are remaining in the navigation.
- Returns:
The new navigation point.
- Return type:
np.ndarray
- static calculate_bounds(pareto_front: numpy.ndarray, nav_point: numpy.ndarray, user_bounds: numpy.ndarray, previous_lb: numpy.ndarray, previous_ub: numpy.ndarray) → Tuple[numpy.ndarray, numpy.ndarray][source]
Calculate the new bounds of the reachable points on the Pareto optimal front from a navigation point.
- Parameters:
pareto_front (np.ndarray) – The Pareto optimal front.
nav_point (np.ndarray) – The current navigation point.
user_bounds (np.ndarray) – Bounds given by the user (the DM) for each objective,which should not be exceeded. A 1D array where NaN’s indicate ‘no bound is given’ for the respective objective value.
previous_lb (np.ndarray) – If no new lower bound can be found for an objective, this value is used.
previous_ub (np.ndarray) – If no new upper bound can be found for an objective, this value is used.
- Returns:
The lower and upper bounds.
- Return type:
Tuple[np.ndarray, np.ndarray]
- calculate_distance(nav_point: numpy.ndarray, projection: numpy.ndarray, nadir: numpy.ndarray) → float[source]
Calculate the distance to the Pareto optimal front from a navigation point. The distance is calculated to the supplied projection which is assumed to lay on the front.
- Parameters:
nav_point (np.ndarray) – The navigation point.
projection (np.ndarray) – The point of the Pareto optimal front the distance is calculated to.
nadir (np.ndarray) – The nadir point of the Pareto optimal set.
- Returns:
The distance.
- Return type:
float