:py:mod:`desdeo_mcdm.interactive.NautilusNavigator`
===================================================

.. py:module:: desdeo_mcdm.interactive.NautilusNavigator


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigatorStopRequest
   desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigatorRequest
   desdeo_mcdm.interactive.NautilusNavigator.NautilusNavigator




Attributes
~~~~~~~~~~

.. autoapisummary::

   desdeo_mcdm.interactive.NautilusNavigator.f1


.. py:class:: NautilusNavigatorStopRequest(reachable_idx: List[int], pareto_front: numpy.ndarray, decision_variables: Optional[numpy.ndarray] = None)

   Bases: :py:obj:`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.


.. py:class:: 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)

   Bases: :py:obj:`desdeo_tools.interaction.request.BaseRequest`

   Request to handle interactions with NAUTILUS Navigator. See the
   NautilusNavigator class for further details.

   .. py:method:: init_with_method(method)
      :classmethod:


   .. py:method:: validator(response: Dict) -> None



.. py:exception:: NautilusNavigatorException

   Bases: :py:obj:`Exception`

   Raised when an exception related to NAUTILUS Navigator is encountered.



.. py:class:: NautilusNavigator(pareto_front: numpy.ndarray, ideal: numpy.ndarray, nadir: numpy.ndarray, decision_variables: Optional[numpy.ndarray] = None)

   Bases: :py:obj:`desdeo_mcdm.interactive.InteractiveMethod.InteractiveMethod`

   Implementations of the NAUTILUS Navigator algorithm.

   :param pareto_front: A two dimensional numpy array
                        representing a Pareto front with objective vectors on each of its
                        rows.
   :type pareto_front: np.ndarray
   :param ideal: The ideal objective vector of the problem
                 being represented by the Pareto front.
   :type ideal: np.ndarray
   :param nadir: The nadir objective vector of the problem
                 being represented by the Pareto front.
   :type nadir: np.ndarray
   :param decision_variables: 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.
   :type decision_variables: Optional[np.ndarray]

   :raises NautilusNavigatorException: One or more dimension mismatches are
   :raises encountered among the supplies arguments.:

   .. py:method:: start() -> NautilusNavigatorRequest

      Returns the first Request object to begin iterating.

      :returns: The Request.
      :rtype: NautilusNavigatorRequest


   .. py:method:: iterate(request: NautilusNavigatorRequest) -> NautilusNavigatorRequest

      Perform the next logical step based on the response in the
      Request.


   .. py:method:: handle_request(request: NautilusNavigatorRequest) -> Union[NautilusNavigatorRequest, NautilusNavigatorStopRequest]

      Handle the Request and its contents.

      :param request: A Request with a defined response.
      :type request: NautilusNavigatorRequest

      :returns: Some of the contents of the response are invalid.
      :rtype: NautilusNavigatorRequest


   .. py:method:: update(ref_point: numpy.ndarray, speed: int, go_to_previous: bool, stop: bool, step_number: Optional[int] = None, nav_point: Optional[numpy.ndarray] = None, lower_bounds: Optional[numpy.ndarray] = None, upper_bounds: Optional[numpy.ndarray] = None, user_bounds: Optional[numpy.ndarray] = None, reachable_idx: Optional[List[int]] = None, distance: Optional[float] = None, steps_remaining: Optional[int] = None) -> Optional[NautilusNavigatorRequest]

      Update the internal state of self.

      :param ref_point: A reference point given by a decision maker.
      :type ref_point: np.ndarray
      :param speed: An integer value between 1-5 indicating the navigation speed.
      :type speed: int
      :param go_to_previous: If True, the parameters indicate the state
                             of a previous state, and the request is handled accordingly.
      :type go_to_previous: bool
      :param stop: If the navigation should stop. If True, returns a request with self's current state.
      :type stop: bool
      :param step_number: Current step number, or
                          previous step number if go_to_previous is True. Defaults to None.
      :type step_number: Optional[int], optional
      :param nav_point: The current
                        navigation point. Relevant if go_to_previous is True. Defaults to
                        None.
      :type nav_point: Optional[np.ndarray], optional
      :param lower_bounds: Lower bounds of
                           the reachable objective vector values. Relevant if go_to_previous
                           is True. Defaults to None.
      :type lower_bounds: Optional[np.ndarray], optional
      :param upper_bounds: Upper bounds of
                           the reachable objective vector values. Relevant if go_to_previous
                           is True. Defaults to None.
      :type upper_bounds: Optional[np.ndarray], optional
      :param user_bounds: The user given bounds for each objective.
                          The reachable lower limit with attempt to not exceed the given bounds for each
                          objective value.
      :type user_bounds: Optional[np.ndarray], optional
      :param reachable_idx: Indices of the
                            reachable Pareto optimal solutions. Relevant if go_to_previous is
                            True. Defaults to None.
      :type reachable_idx: Optional[List[int]], optional
      :param distance: Distance to the Pareto
                       optimal front. Relevant if go_to_previous is True. Defaults to
                       None.
      :type distance: Optional[float], optional
      :param steps_remaining: Remaining steps in the
                              navigation. Relevant if go_to_previous is True. Defaults to None.
      :type steps_remaining: Optional[int], optional

      :returns: Some of the given parameters are erroneous.
      :rtype: NautilusNavigatorRequest


   .. py:method:: calculate_reachable_point_indices(pareto_front: numpy.ndarray, lower_bounds: numpy.ndarray, upper_bounds: numpy.ndarray) -> List[int]

      Calculate the indices of the reachable Pareto optimal solutions
      based on lower and upper bounds.

      :returns: List of the indices of the reachable solutions.
      :rtype: List[int]


   .. py:method:: 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
      :staticmethod:

      Forms and solves the achievement scalarizing function to find the
      closest point on the Pareto optimal front to the given reference
      point.

      :param pareto_f: The whole Pareto optimal front.
      :type pareto_f: np.ndarray
      :param subset_indices: Indices of the currently reachable solutions.
      :type subset_indices: [type]
      :param ref_point: The reference point indicating a decision
                        maker's preference.
      :type ref_point: np.ndarray
      :param ideal: Ideal point.
      :type ideal: np.ndarray
      :param nadir: Nadir point.
      :type nadir: np.ndarray
      :param user_bounds: 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.
      :type user_bounds: np.ndarray

      :returns: Index of the closest point according the minimized value of the ASF.
      :rtype: int


   .. py:method:: calculate_navigation_point(projection: numpy.ndarray, nav_point: numpy.ndarray, steps_remaining: int) -> numpy.ndarray

      Calculate a new navigation point based on the projection of the
      preference point to the Pareto optimal front.

      :param projection: The point on the Pareto optimal front
                         closest to the preference point given by a decision maker.
      :type projection: np.ndarray
      :param nav_point: The previous navigation point.
      :type nav_point: np.ndarray
      :param steps_remaining: How many steps are remaining in the navigation.
      :type steps_remaining: int

      :returns: The new navigation point.
      :rtype: np.ndarray


   .. py:method:: 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]
      :staticmethod:

      Calculate the new bounds of the reachable points on the Pareto
      optimal front from a navigation point.

      :param pareto_front: The Pareto optimal front.
      :type pareto_front: np.ndarray
      :param nav_point: The current navigation point.
      :type nav_point: np.ndarray
      :param user_bounds: 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.
      :type user_bounds: np.ndarray
      :param previous_lb: If no new lower bound can be found for an objective, this value is used.
      :type previous_lb: np.ndarray
      :param previous_ub: If no new upper bound can be found for an objective, this value is used.
      :type previous_ub: np.ndarray

      :returns: The lower and upper bounds.
      :rtype: Tuple[np.ndarray, np.ndarray]


   .. py:method:: calculate_distance(nav_point: numpy.ndarray, projection: numpy.ndarray, nadir: numpy.ndarray) -> float

      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.

      :param nav_point: The navigation point.
      :type nav_point: np.ndarray
      :param projection: The point of the Pareto optimal front the distance is calculated to.
      :type projection: np.ndarray
      :param nadir: The nadir point of the Pareto optimal set.
      :type nadir: np.ndarray

      :returns: The distance.
      :rtype: float



.. py:data:: f1
   

   

