ImageVerifierCode 换一换
格式:DOCX , 页数:17 ,大小:19.53KB ,
资源ID:18142589      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/18142589.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(NSGAII源程序Word格式文档下载.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

NSGAII源程序Word格式文档下载.docx

1、 objective(i).range = . sorted(i).individual(length(sorted(i).individual) - . sorted(i).individual(1); % Maximum and minimum objectives value for the ith objective% Caluclate the crowding distance for front one. distance(j).individual = distance(j).individual + . (sorted(i).individual(j + 1) - sorte

2、d(i).individual(j - 1)/. objective(i).range; y(sorted(i).index(j),M + V + 2) = distance(j).individual;/PRE Published with MATLAB 7.0function f = genetic_operator(parent_chromosome,pro,mu,mum);% This function is utilized to produce offsprings from parent chromosomes.% The genetic operators corssover

3、and mutation which are carried out with% slight modifications from the original design. For more information read% the document enclosed.N,M = size(parent_chromosome);switch prop = 1;was_crossover = 0;was_mutation = 0;l_limit = 0;u_limit = 1; N if rand(1) 0.9 child_1 = ; child_2 = ; parent_1 = round

4、(N*rand(1); if parent_1 1 parent_1 = 1; parent_2 = round(N*rand(1); if parent_2 parent_2 = 1; while isequal(parent_chromosome(parent_1,:),parent_chromosome(parent_2,:) parent_1 = parent_chromosome(parent_1,: parent_2 = parent_chromosome(parent_2,: for j = 1 : V % SBX (Simulated Binary Crossover) % G

5、enerate a random number u(j) = rand(1); if u(j) u_limit child_1(j) = u_limit; elseif child_1(j) child_2(j) = u_limit; elseif child_2(j) child_2(j) = l_limit; child_1(:,V + 1: M + V) = evaluate_objective(child_1,pro); child_2(: M + V) = evaluate_objective(child_2,pro); was_crossover = 1; was_mutation

6、 = 0; parent_3 = round(N*rand(1); if parent_3 parent_3 = 1; % Make sure that the mutation does not result in variables out of % the search space. For both the MOPs the range for decision space % is 0,1. In case different variables have different decision % space each variable can be assigned a range

7、. child_3 = parent_chromosome(parent_3,: r(j) = rand(1); if r(j) child_3(j) = u_limit; elseif child_3(j) child_3(j) = l_limit; child_3(: M + V) = evaluate_objective(child_3,pro); was_mutation = 1; was_crossover = 0; if was_crossover child(p,:) = child_1; child(p+1,:) = child_2; was_cossover = 0; p =

8、 p + 2; elseif was_mutation) = child_3(1,1 : M + V); p = p + 1;f = child;Published with MATLABfunction f = initialize_variables(N,problem)% function f = initialize_variables(N,problem)% N - Population size% problem - takes integer values 1 and 2 where,% 1 for MOP12 for MOP2% This function initialize

9、s the population with N individuals and each% individual having M decision variables based on the selected problem.% M = 6 for problem MOP1 and M = 12 for problem MOP2. The objective space% for MOP1 is 2 dimensional while for MOP2 is 3 dimensional.% Both the MOPs has 0 to 1 as its range for all the

10、decision variables.min = 0;max = 1; M = 6; K = 8; M = 12; K = 15; % Initialize the decision variables f(i,j) = rand(1); % i.e f(i,j) = min + (max - min)*rand(1); % Evaluate the objective function f(i,M + 1: K) = evaluate_objective(f(i,:),problem); Non-Donimation SortThis function sort the current po

11、pultion based on non-domination. All the individuals in the first front are given a rank of 1, the second front individuals are assigned rank 2 and so on. After assigning the rank the crowding in each front is calculated. front = 1;% There is nothing to this assignment, used only to manipulate easil

12、y in% MATLAB.F(front).f = ;individual = ; % Number of individuals that dominate this individual individual(i).n = 0; % Individuals which this individual dominate individual(i).p = ; dom_less = 0; dom_equal = 0; dom_more = 0; for k = 1 : if (x(i,V + k) x(j,V + k) dom_less = dom_less + 1; elseif (x(i,

13、V + k) = x(j,V + k) dom_equal = dom_equal + 1; dom_more = dom_more + 1; if dom_less = 0 & dom_equal = M individual(i).n = individual(i).n + 1; elseif dom_more = 0 & individual(i).p = individual(i).p j; if individual(i).n = 0 x(i,M + V + 1) = 1; F(front).f = F(front).f i;% Find the subsequent frontsw

14、hile isempty(F(front).f) Q = ; for i = 1 : if isempty(individual(F(front).f(i).p) for j = 1 : length(individual(F(front).f(i).p) individual(individual(F(front).f(i).p(j).n = . individual(individual(F(front).f(i).p(j).n - 1; if individual(individual(F(front).f(i).p(j).n = 0 x(individual(F(front).f(i)

15、.p(j),M + V + 1) = . front + 1; Q = Q individual(F(front).f(i).p(j); front = front + 1; F(front).f = Q;temp,index_of_fronts = sort(x(:,M + V + 1); length(index_of_fronts) sorted_based_on_front(i,:) = x(index_of_fronts(i),:current_index = 0;% Find the crowding distance for each individual in each fro

16、ntfor front = 1 : (length(F) - 1) objective = ; distance = 0; y = ; previous_index = current_index + 1;) = sorted_based_on_front(current_index + i,: current_index = current_index + i; % Sort each individual based on the objective sorted_based_on_objective = ; sorted_based_on_objective, index_of_obje

17、ctives = . sort(y(: length(index_of_objectives) sorted_based_on_objective(j,:) = y(index_of_objectives(j),: f_max = . sorted_based_on_objective(length(index_of_objectives), V + i); f_min = sorted_based_on_objective(1, V + i); y(index_of_objectives(length(index_of_objectives),M + V + 1 + i). = Inf; y

18、(index_of_objectives(1),M + V + 1 + i) = Inf; length(index_of_objectives) - 1 next_obj = sorted_based_on_objective(j + 1,V + i); previous_obj = sorted_based_on_objective(j - 1,V + i); if (f_max - f_min = 0) y(index_of_objectives(j),M + V + 1 + i) = Inf; y(index_of_objectives(j),M + V + 1 + i) = . (n

19、ext_obj - previous_obj)/(f_max - f_min); distance = ; distance(:,1) = zeros(length(F(front).f),1);,1) = distance(:,1) + y(:,M + V + 1 + i); y(:,M + V + 2) = distance; y = y(:,1 : M + V + 2); z(previous_index:current_index,:) = y;f = z();Main FunctionMain program to run the NSGA-II MOEA. Read the cor

20、responding documentation to learn more about multiobjective optimization using evolutionary algorithms. initialize_variables has two arguments; First being the population size and the second the problem number. corresponds to MOP1 and corresponds to MOP2. ContentsInitialize the variables Sort the in

21、itialized population Start the evolution process Result Visualize Initialize the variablesDeclare the variables and initialize their values pop - population gen - generations pro - problem numberpop = 200;gen = 1;pro = 1; % M is the number of objectives. % V is the number of decision variables. In t

22、his case it is % difficult to visualize the decision variables space while the % objective space is just two dimensional.% Initialize the populationchromosome = initialize_variables(pop,pro);Sort the initialized populationSort the population using non-domination-sort. This returns two columns for ea

23、ch individual which are the rank and the crowding distance corresponding to their position in the front they belong. chromosome = non_domination_sort_mod(chromosome,pro);Start the evolution process% The following are performed in each generation% Select the parents% Perfrom crossover and Mutation op

24、erator% Perform Selection gen % Select the parents % Parents are selected for reproduction to generate offspring. The % original NSGA-II uses a binary tournament selection based on the % crowded-comparision operator. The arguments are % pool - size of the mating pool. It is common to have this to be half the % population size. % tour - Tournament siz

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1