找回密码
 注册
Simdroid-非首页
查看: 283|回复: 9

MATLAB 怎么在优化中得到PARETO 解?

[复制链接]
发表于 2009-5-5 14:40:42 | 显示全部楼层 |阅读模式 来自 陕西西安
如果使用的是遗传算法,

怎么才能得到问题的PARETO 解?

好像遗传算法出来的都是收敛到一个单一的点
发表于 2009-5-5 16:31:21 | 显示全部楼层 来自 陕西西安
Simdroid开发平台
无论遗传算法,还是一般的优化解法,都是单个解。
多目标的时候,需要一组非劣解,需要进行相应的程序来求解
下面是matlab的一个简单的遗传算法对两个目标优化求解过程,
怎么得到pareto解应该很清楚

GA Multiobjective
This example optimizes two objectives defined by Schaffer'ssecond function: a vector-valued function of two components and oneinput argument. The Pareto front is disconnected. Define this functionin an M-file:
function y = schaffer2(x) % y has two columns

% Initialize y for two objectives and for all x
y = zeros(length(x),2);

% Evaluate first objective.
% This objective is piecewise continuous.
for i = 1:length(x)
    if x(i) <= 1
        y(i,1) = -x(i);
    elseif x(i) <=3
        y(i,1) = x(i) -2;
    elseif x(i) <=4
        y(i,1) = 4 - x(i);
    else
        y(i,1) = x(i) - 4;
    end
end

% Evaluate second objective
y(:,2) = (x -5).^2;First, plot the two objectives:
x = -1:0.1:8;
y = schaffer2(x);

plot(x,y(:,1),'.r'); hold on
plot(x,y(:,2),'.b');The two component functions compete in the range [1, 3] and[4, 5]. But the Pareto-optimal front consists of only two disconnectedregions: [1, 2] and [4, 5]. This is because the region [2, 3] is inferiorto [1, 2].
Next, impose a bound constraint on x,
-5<x<10,setting
lb = -5;
ub = 10;The best way to view the results of the genetic algorithm isto visualize the Pareto front directly using the @gaplotpareto option. To optimize Schaffer's function, a larger population sizethan the default (15) is needed, because of the disconnected front.This example uses 60. Set the optimization options as:
options = gaoptimset('PopulationSize',60,'PlotFcns',...
@gaplotpareto);
Now call gamultiobj, specifying one independentvariable and only the bound constraints:
[x,f,exitflag] = gamultiobj(@schaffer2,1,[],[],[],[],...
lb,ub,options);

Optimization terminated: average change in the spread of
Pareto solutions less than options.TolFun.

exitflag
exitflag = 1The vectors x, f(:,1),and f(:,2) respectively contain the Pareto setand both objectives evaluated on the Pareto set.

评分

1

查看全部评分

回复 不支持

使用道具 举报

发表于 2009-5-5 16:37:06 | 显示全部楼层 来自 陕西西安
上面程序加了说明,有点乱,为了方便,可以下载附件,里面有这两个m文件直接运行

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×

评分

2

查看全部评分

回复 不支持

使用道具 举报

 楼主| 发表于 2009-5-6 13:57:21 | 显示全部楼层 来自 陕西西安
多谢 akjuan !
回复 不支持

使用道具 举报

发表于 2010-11-1 08:49:08 | 显示全部楼层 来自 湖南长沙
多谢指点,受益匪浅

评分

1

查看全部评分

回复 不支持

使用道具 举报

发表于 2010-11-10 00:46:46 | 显示全部楼层 来自 北京
谢谢,学到不少东西~

评分

1

查看全部评分

回复 不支持

使用道具 举报

发表于 2011-1-31 06:04:57 | 显示全部楼层 来自 德国
多谢多谢,学习一下

评分

1

查看全部评分

回复 不支持

使用道具 举报

发表于 2011-6-13 16:25:01 | 显示全部楼层 来自 江苏南京
正用到,感谢啊,论坛就是学习的地方
回复 不支持

使用道具 举报

发表于 2011-6-25 14:14:27 | 显示全部楼层 来自 安徽
可以到MATLAB官网去下载
回复 不支持

使用道具 举报

发表于 2014-6-19 15:30:28 | 显示全部楼层 来自 江苏南京
正在学习,好东西
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-6-26 19:37 , Processed in 0.058633 second(s), 22 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表