计算智能01_2022秋_第一次作业

Homework1_CI_2022F

The first course assignment of Computational Intelligence 01 in Fall 2022
用遗传算法编码求解Dejong1和Dejong2:

Dejong1:

%MATLAB:
function y = dejong1(x1, x2)
    y = x1.^2 + x2.^2;
end

% -5.12<= x <= 5.12

Dejong2:

%MATLAB:
function y = dejong2(x1, x2)
    y = 100*(x1.^2 - x2).^2 + (1-x1).^2; 
end

% -2.048<= x <= 2.048

Requirements:

Design a genetic algorithm to solve for the minimum value of dejong1 and dejong2 in a given range and follow the following requirements:

1. clearly pointintg out the following steps in the implementations:

  • initialization
  • fitness evaluation
  • selection for crossover and mutation
  • environmental selection

2. please set the following components based on your own preferences:

  • the probabilities of crossover, mutation, elitsm
  • the size of population, the types of crossover and mutation
  • and etc.

3. please independently run the algorithms at least 30 times, and finally report the mean and std values

4. please draw the evolutionary process using the data from any run

  • collecting the data (the generation number as well as its corresponding fitness value) during some run, say the fifth run;
  • plot the data in a two-dimension axis;
  • the horizontal axis denotes the generation number, and the vertical axis denotes the fitness value.
  • try to conclude something from this figure plotted.

5. please draw the mean, max, and min values of the same generation in different runs (boxplot?)

  • collecting the fitness values of the same generations in all runs;
  • using boxplot to plot the data collected from the 30 runs;
  • try to conclude something from this figure plotted.

要求:

#设计一个遗传算法来求解dejong1和dejong2在给定范围内的最小值,并遵循以下要求:

1.在实现中明确指出以下步骤:

  • 初始化;
  • 适度值评估;
  • 交叉和变异的选择;
  • 环境选择。

2.请根据你自己的喜好来设置以下组件:

  • 交叉、变异概率;
  • 精英主义的比例;
  • 群体的大小,交叉和变异的类型;
  • 等等。

3、请独立运行算法至少30次,最后报告平均值和标准值

4. 请用任何一次运行的数据画出进化过程

  • 在某次运行中收集相应的数据(代数以及相应的适度值),例如第五次运行中,适度值为多少…;
  • 将数据绘制在一个二维轴上;
  • 横轴表示代数,纵轴表示适度值;
  • 试着从这个图中得出一些结论。

5.请画出同一代在不同运行中的平均值、最大值和最小值(boxplot?)

  • 收集所有运行中同一世代的适度值;
  • 使用boxplot绘制从30次运行中收集的数据;
  • 试着从这幅图中得出一些结论。

算法实现参考链接:https://blog.csdn.net/silence1214/article/details/48409383?locationNum=14&fps=1
请各位同学自行设计实现,作业检查会在百度和Github中进行查重。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值