desdeo_mcdm.interactive.ParetoNavigator
Module Contents
Classes
A request class to handle the Decision Maker's initial preferences for the first iteration round. |
|
A request class to handle navigation preferences after the first iteration round. |
|
A request class to handle requests to see pareto optimal solution. |
|
A request class to handle termination. |
|
Paretonavigator as described in 'Pareto navigator for interactive nonlinear |
Functions
|
- exception desdeo_mcdm.interactive.ParetoNavigator.ParetoNavigatorException[source]
Bases:
Exception
Raised when an exception related to Pareto Navigator is encountered.
- class desdeo_mcdm.interactive.ParetoNavigator.ParetoNavigatorInitialRequest(ideal: numpy.ndarray, nadir: numpy.ndarray, allowed_speeds: numpy.ndarray, po_solutions: numpy.ndarray)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
A request class to handle the Decision Maker’s initial preferences for the first iteration round.
- Parameters:
ideal (np.ndarray) – Ideal vector
nadir (np.ndarray) – Nadir vector
allowed_speeds (np.ndarray) – Allowed movement speeds
po_solutions – (np.ndarray): A set of pareto optimal solutions
- msg = Please specify a starting point as 'preferred_solution'.[source]
Or specify a reference point as ‘reference_point’.
- classmethod init_with_method(method: desdeo_mcdm.interactive.InteractiveMethod.InteractiveMethod)[source]
Initialize request with given instance of ParetoNavigator.
- Parameters:
method (ParetoNavigator) – Instance of ReferencePointMethod-class.
- Returns:
Initial request.
- Return type:
- class desdeo_mcdm.interactive.ParetoNavigator.ParetoNavigatorRequest(current_solution: numpy.ndarray, ideal: numpy.ndarray, nadir: numpy.ndarray, allowed_speeds: numpy.ndarray, valid_classifications: numpy.ndarray)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
A request class to handle navigation preferences after the first iteration round.
- Parameters:
current_solution (np.ndarray) – Current solution.
ideal (np.ndarray) – Ideal vector.
nadir (np.ndarray) – Nadir vector.
allowed_speeds (np.ndarray) – Allowed movement speeds
valid_classifications (np.ndarray) – Valid classifications
- classmethod init_with_method(method: desdeo_mcdm.interactive.InteractiveMethod.InteractiveMethod)[source]
Initialize request with given instance of ParetoNavigator.
- Parameters:
method (ParetoNavigator) – Instance of ParetoNavigator-class.
- Returns:
Initial request.
- Return type:
- class desdeo_mcdm.interactive.ParetoNavigator.ParetoNavigatorSolutionRequest(approx_solution: numpy.ndarray, pareto_optimal_solution: numpy.ndarray, objective_values: numpy.ndarray)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
A request class to handle requests to see pareto optimal solution.
- Parameters:
approx_solution (np.ndarray) – The approximated solution received by navigation
pareto_optimal_solution (np.ndarray) – A pareto optimal solution (decision variables).
objective_values (np.ndarray) – Objective vector.
- class desdeo_mcdm.interactive.ParetoNavigator.ParetoNavigatorStopRequest(approx_solution: numpy.ndarray, final_solution: numpy.ndarray, objective_values: numpy.ndarray)[source]
Bases:
desdeo_tools.interaction.request.BaseRequest
A request class to handle termination.
- Parameters:
approx_solution (np.ndarray) – The approximated solution received by navigation.
final_solution (np.ndarray) – Solution (decision variables).
objective_values (np.ndarray) – Objective values.
- class desdeo_mcdm.interactive.ParetoNavigator.ParetoNavigator(problem: desdeo_problem.problem.MOProblem | desdeo_problem.problem.DiscreteDataProblem, pareto_optimal_solutions: numpy.ndarray | None = None, scalar_method: desdeo_tools.solver.ScalarSolver.ScalarMethod | None = None)[source]
Bases:
desdeo_mcdm.interactive.InteractiveMethod.InteractiveMethod
Paretonavigator as described in ‘Pareto navigator for interactive nonlinear multiobjective optimization’ (2008) [Petri Eskelinen · Kaisa Miettinen · Kathrin Klamroth · Jussi Hakanen].
- Parameters:
problem (MOProblem) – The problem to be solved.
pareto_optimal_solutions (np.ndarray) – Some pareto optimal solutions to construct the polyhedral set.
scalar_method – (Optional[ScalarMethod], optional): The scalar method used to solve asf
Note
- pareto_optimal_solutions must be provided for problems of type MOProblem.
For DiscreteDataProblems if no pareto optimal solutions are provided the method will use the objective values from the problem.
- iterate(request: ParetoNavigatorInitialRequest | ParetoNavigatorRequest | ParetoNavigatorSolutionRequest | ParetoNavigatorStopRequest) → ParetoNavigatorRequest | ParetoNavigatorSolutionRequest | ParetoNavigatorStopRequest[source]
Perform the next logical iteration step based on the given request type.
- Parameters:
(Union[ParetoNavigatorInitialRequest (request) – ParetoNavigatorSolutionRequest, ParetoNavigatorStopRequest]): A ParetoNavigatorRequest
ParetoNavigatorRequest – ParetoNavigatorSolutionRequest, ParetoNavigatorStopRequest]): A ParetoNavigatorRequest
- :paramParetoNavigatorSolutionRequest, ParetoNavigatorStopRequest]):
A ParetoNavigatorRequest
- Returns:
A new request with content depending on the Decision Maker’s preferences.
- Return type:
Union[ParetoNavigatorRequest, ParetoNavigatorSolutionRequest, ParetoNavigatorStopRequest]
- handle_initial_request(request: ParetoNavigatorInitialRequest) → ParetoNavigatorRequest[source]
Handles the initial request.
- Parameters:
request (ParetoNavigatorInitialRequest) – Initial request
- Returns:
A navigation request
- Return type:
- handle_request(request: ParetoNavigatorRequest) → ParetoNavigatorRequest | ParetoNavigatorSolutionRequest | ParetoNavigatorStopRequest[source]
Handles a navigation request.
- Parameters:
request (ParetoNavigatorRequest) – A request
- Returns:
Next request corresponding the DM’s preferences
- Return type:
Union[ParetoNavigatorRequest, ParetoNavigatorSolutionRequest, ParetoNavigatorStopRequest]
- handle_solution_request(request: ParetoNavigatorSolutionRequest) → ParetoNavigatorRequest | ParetoNavigatorStopRequest[source]
Handle a solution request
- Parameters:
request (ParetoNavigatorSolutionRequest) – A solution request
- Returns:
A navigation request or a stop request depending on whether the DM wishes to continue or stop
- Return type:
- calculate_extremes(points: numpy.ndarray) → Tuple[numpy.ndarray, numpy.ndarray][source]
Calculate the minimum and maximum points of a given array.
- Parameters:
points (np.ndarray) – A two dimensional array
- Returns:
The min and max values of each column
- Return type:
Tuple[np.ndarray, np.ndarray]
- calculate_speed(given_speed: int) → float[source]
Calculate a speed value from given integer value.
- Parameters:
given_speed (int) – a speed value where 1 is slowest and 5 fastest
- Returns:
- A speed value calculated from given integer value.
Is between 0 and 1
- Return type:
float
Note
The denominator 10 is not mentioned in the article, but it is included because the navigation speed seems to be too fast without it.
- calculate_weights(ideal: numpy.ndarray, nadir: numpy.ndarray)[source]
Calculate the scaling coefficients w from ideal and nadir.
- Parameters:
ideal (np.ndarray) – Ideal vector
nadir (np.ndarray) – Nadir vector
- Returns:
The scaling coefficients
- Return type:
np.ndarray
- polyhedral_set_eq(po_solutions: numpy.ndarray) → Tuple[numpy.ndarray, numpy.ndarray][source]
Construct a polyhedral set as convex hull from the set of pareto optimal solutions
- Parameters:
po_solutions (np.ndarray) – Some pareto optimal solutions
- Returns:
- Matrix A and vector b from the
convex hull inequality representation Az <= b
- Return type:
Tuple[np.ndarray, np.ndarray]
- construct_lppp_A(weights, A)[source]
The matrix A used in the linear parametric programming problem
- Parameters:
weights (np.ndarray) – Scaling coefficients
A (np.ndarray) – Matrix A from the convex hull representation Ax < b
- Returns:
The matrix A’ in the linear parametric programming problem A’x<b’
- Return type:
np.ndarray
- calculate_direction(current_solution: numpy.ndarray, ref_point: numpy.ndarray)[source]
Calculate a new direction from current solution and a given reference point
- Parameters:
current_solution (np.ndarray) – The current solution
ref_point (np.ndarray) – A reference point
- Returns:
A new direction
- Return type:
np.ndarray
- classification_to_ref_point(classifications, ideal, nadir, current_solution)[source]
Transform classifications to a reference point
- Parameters:
classifications (np.ndarray) – Classification for each objective
ideal (np.ndarray) – Ideal point
nadir (np.ndarray) – Nadir point
current_solution (np.ndarray) – Current solution
- Returns:
A reference point which is constructed from the classifications
- Return type:
np.ndarray
- solve_linear_parametric_problem(current_sol: numpy.ndarray, ideal: numpy.ndarray, nadir: numpy.ndarray, direction: numpy.ndarray, a: float, A: numpy.ndarray, b: numpy.ndarray) → numpy.ndarray[source]
Solves the linear parametric programming problem as defined in (3)
- Parameters:
current_sol (np.ndarray) – Current solution
ideal (np.ndarray) – Ideal vector
nadir (np.ndarray) – Nadir vector
direction (np.ndarray) – Navigation direction
a (float) – Alpha in problem (3)
A (np.ndarray) – Matrix A from Az <= b
b (np.ndarray) – Vector b from Az <= b
- Returns:
- Optimal vector from the linear parametric programming problem.
This is the new solution to be used in the navigation.
- Return type:
np.ndarray
- solve_asf(problem: desdeo_problem.problem.MOProblem | desdeo_problem.problem.DiscreteDataProblem, ref_point: numpy.ndarray, method: desdeo_tools.solver.ScalarSolver.ScalarMethod | None = None)[source]
Solve the achievement scalarizing function
- Parameters:
problem (MOProblem) – The problem
ref_point – A reference point
method (Optional[ScalarMethod], optional) – A method provided to the scalar minimizer
- Returns:
The decision vector which solves the achievement scalarizing function
- Return type:
np.ndarray