Main Content

La traducción de esta página aún no se ha actualizado a la versión más reciente. Haga clic aquí para ver la última versión en inglés.

paretoplot

Gráfica de Pareto de valores multiobjetivo

Desde R2022a

Descripción

ejemplo

paretoplot(val) crea una gráfica de Pareto de los objetivos de val. Si val contiene más de tres objetivos, paretoplot representa los primeros tres objetivos.

ejemplo

paretoplot(val,objlabels) crea una gráfica de Pareto de los objetivos enumerados en objlabels. Utilice esta sintaxis si tiene etiquetas separadas para cada función objetivo.

ejemplo

paretoplot(val,objindex) crea una gráfica de Pareto de los objetivos enumerados en objindex. Utilice esta sintaxis si sus funciones objetivo no están etiquetadas.

ejemplo

h = paretoplot(___), para cualquier sintaxis de entrada anterior, devuelve un identificador h al objeto de dispersión resultante. Utilice h para establecer las propiedades del objeto de dispersión después de su creación.

paretoplot(ax,___) representa en los ejes con el identificador ax.

Ejemplos

contraer todo

Cree y resuelva un problema de optimización multiobjetivo utilizando variables de optimización.

x = optimvar("x",LowerBound=-1,UpperBound=2);
prob = optimproblem;
prob.Objective.obj1 = x^2;
prob.Objective.obj2 = (x-1)^2;
[sol,fval] = solve(prob,Solver="paretosearch");
Solving problem using paretosearch.

Pareto set found that satisfies the constraints. 

Optimization completed because the relative change in the volume of the Pareto set 
is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 
'options.ConstraintTolerance'.

Represente el frente de Pareto.

paretoplot(sol)

Figure contains an axes object. The axes object with title Pareto Front, xlabel obj1, ylabel obj2 contains 4 objects of type text, scatter.

Cree y resuelva un problema de optimización multiobjetivo con cuatro objetivos con nombre.

x = optimvar("x",2,LowerBound=-2,UpperBound=4);
prob = optimproblem;
prob.Objective.obj1 = norm(x)^2;
prob.Objective.obj2 = norm(x - [1;0])^2;
prob.Objective.obj3 = norm(x - [0;1])^2;
prob.Objective.obj4 = norm(x - [1;1])^2;
sol = solve(prob,Solver="paretosearch");
Solving problem using paretosearch.

Pareto set found that satisfies the constraints. 

Optimization completed because the relative change in the distance of the Pareto set 
is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 
'options.ConstraintTolerance'.

Cree una gráfica de Pareto de los primeros tres objetivos.

paretoplot(sol)

Figure contains an axes object. The axes object with title Pareto Front, xlabel obj1, ylabel obj2 contains 5 objects of type text, scatter.

Cree una gráfica de Pareto de los últimos tres objetivos.

paretoplot(sol,["obj2" "obj3" "obj4"])

Figure contains an axes object. The axes object with title Pareto Front, xlabel obj2, ylabel obj3 contains 5 objects of type text, scatter.

Cree y resuelva un problema de optimización multiobjetivo con cuatro objetivos. La función objetivo devuelve un vector de cuatro elementos.

x = optimvar("x",2,LowerBound=-2,UpperBound=4);
prob = optimproblem;
obj = [norm(x)^2,norm(x - [1;0])^2,norm(x - [0;1])^2,norm(x - [1;1])^2];
prob.Objective = obj;
sol = solve(prob,Solver="paretosearch");
Solving problem using paretosearch.

Pareto set found that satisfies the constraints. 

Optimization completed because the relative change in the distance of the Pareto set 
is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 
'options.ConstraintTolerance'.

Cree una gráfica de Pareto de los primeros tres objetivos.

paretoplot(sol)

Figure contains an axes object. The axes object with title Pareto Front, xlabel Objective(1), ylabel Objective(2) contains 5 objects of type text, scatter.

Cree una gráfica de Pareto de los últimos tres objetivos.

paretoplot(sol,[2 3 4])

Figure contains an axes object. The axes object with title Pareto Front, xlabel Objective(2), ylabel Objective(3) contains 5 objects of type text, scatter.

Cree y resuelva un problema de optimización multiobjetivo utilizando variables de optimización.

x = optimvar("x",LowerBound=-1,UpperBound=2);
prob = optimproblem;
prob.Objective.obj1 = x^2;
prob.Objective.obj2 = (x-1)^2;
[sol,fval] = solve(prob,Solver="paretosearch");
Solving problem using paretosearch.

Pareto set found that satisfies the constraints. 

Optimization completed because the relative change in the volume of the Pareto set 
is less than 'options.ParetoSetChangeTolerance' and constraints are satisfied to within 
'options.ConstraintTolerance'.

Represente el frente de Pareto. Para habilitar la edición, obtenga un identificador para la gráfica.

h = paretoplot(sol);

Figure contains an axes object. The axes object with title Pareto Front, xlabel obj1, ylabel obj2 contains 4 objects of type text, scatter.

Cambie los marcadores de azul 'o' a rojo 'x'. Para obtener una vista no distorsionada, configure los ejes de forma que tengan la misma longitud.

h.Marker = "x";
h.MarkerEdgeColor = "r";
axis equal

Figure contains an axes object. The axes object with title Pareto Front, xlabel obj1, ylabel obj2 contains 4 objects of type text, scatter.

Para obtener una lista completa de propiedades editables, consulte Scatter Properties.

Argumentos de entrada

contraer todo

Valores de optimización, especificados como un objeto OptimizationValues. Por lo general, vals es la solución a un problema multiobjetivo, la salida sol de solve.

paretoplot puede representar dos o tres objetivos. Si tiene más de tres objetivos, paretoplot representa los primeros tres. Especifique los dos o tres objetivos que se desea representar utilizando los argumentos objlabels u objindex.

Ejemplo: sol

Etiquetas de función objetivo, especificadas como un vector de cadenas de dos o tres entradas. Las entradas son etiquetas de función objetivo en el problema de optimización.

Ejemplo: ["obj1" "obj2"]

Tipos de datos: char | string

Índices de función objetivo, especificados como un vector de enteros positivos. objindex debe contener dos o tres entradas en un rango desde 1 hasta el número de objetivos.

Ejemplo: [4 1 3]

Tipos de datos: double

Ejes para la gráfica, especificados como un identificador.

Historial de versiones

Introducido en R2022a

Consulte también

(Global Optimization Toolbox) | (Global Optimization Toolbox) |