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

.. py:module:: desdeo_mcdm.interactive.ENautilus


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

Classes
~~~~~~~

.. autoapisummary::

   desdeo_mcdm.interactive.ENautilus.ENautilusInitialRequest
   desdeo_mcdm.interactive.ENautilus.ENautilusRequest
   desdeo_mcdm.interactive.ENautilus.ENautilusStopRequest
   desdeo_mcdm.interactive.ENautilus.ENautilus




.. py:exception:: ENautilusException

   Bases: :py:obj:`Exception`

   Raised when an exception related to ENautilus is encountered.




.. py:class:: ENautilusInitialRequest(ideal: numpy.ndarray, nadir: numpy.ndarray)

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

   A request class to handle the initial preferences.



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


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



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

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

   A request class to handle the intermediate requests.



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



.. py:class:: ENautilusStopRequest(preferred_point: numpy.ndarray, solution: Optional[numpy.ndarray] = None)

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

   A request class to handle termination.




.. py:class:: ENautilus(pareto_front: numpy.ndarray, ideal: numpy.ndarray, nadir: numpy.ndarray, objective_names: Optional[List[str]] = None, variables: Optional[numpy.ndarray] = None)

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

   The base class for interactive methods.

   :param problem: The problem being solved in an interactive method.
   :type problem: MOProblem

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


   .. py:method:: iterate(request: Union[ENautilusInitialRequest, ENautilusRequest]) -> Union[ENautilusRequest, ENautilusStopRequest]

      Perform the next logical iteration step based on the given request type.




   .. py:method:: handle_initial_request(request: ENautilusInitialRequest) -> ENautilusRequest

      Handles the initial request by parsing the response appropriately.




   .. py:method:: handle_request(request: ENautilusRequest) -> Union[ENautilusRequest, ENautilusStopRequest]

      Handles the intermediate requests.




   .. py:method:: calculate_representative_points(pareto_front: numpy.ndarray, subset_indices: List[int], n_points: int) -> numpy.ndarray

      Calculates the most representative points on the Pareto front. The points are clustered using k-means.

      :param pareto_front: The Pareto front.
      :type pareto_front: np.ndarray
      :param subset_indices: A list of indices representing the
                             subset of the points on the Pareto front for which the
                             representative points should be calculated.
      :type subset_indices: List[int]
      :param n_points: The number of representative points to be calculated.
      :type n_points: int

      :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.
      :rtype: np.ndarray


   .. py:method:: calculate_intermediate_points(preferred_point: numpy.ndarray, zbars: numpy.ndarray, n_iterations_left: int) -> numpy.ndarray

      Calculates the intermediate points between representative points an a preferred point.

      :param preferred_point: The preferred point, 1D array.
      :type preferred_point: np.ndarray
      :param zbars: The representative points, 2D array.
      :type zbars: np.ndarray
      :param n_iterations_left: The number of iterations left.
      :type n_iterations_left: int

      :returns: The intermediate points as a 2D array.
      :rtype: np.ndarray


   .. py:method:: calculate_bounds(pareto_front: numpy.ndarray, intermediate_points: numpy.ndarray) -> Tuple[numpy.ndarray, numpy.ndarray]

      Calculate the new bounds of the reachable points on the Pareto
      optimal front from each of the intermediate points.

      :param pareto_front: The Pareto optimal front.
      :type pareto_front: np.ndarray
      :param intermediate_points: The current intermediate points as a 2D array.
      :type intermediate_points: np.ndarray

      :returns: The lower and upper bounds for each of the intermediate points.
      :rtype: Tuple[np.ndarray, np.ndarray]


   .. py:method:: calculate_distances(intermediate_points: numpy.ndarray, zbars: numpy.ndarray, nadir: numpy.ndarray) -> numpy.ndarray


   .. 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]



