Jmetal 4+ 使用指南五使用Jmetal进行试验-Running the experiments

323 阅读2分钟

本文已参与【新人创作礼】活动,一起开启掘金创作之路

Jmetal 4+ 使用指南五

使用Jmetal进行试验-Running the experiments

Experimentation with jMetal

觉得有用的话,欢迎一起讨论相互学习~

我的微博我的github我的B站

  • 本文以Jmetal官网文档为基础,结合自身理解

链接如下

Jmetal 4+ 使用指南一

Jmetal 4+ 使用指南二

Jmetal 4+ 使用指南三

Jmetal 4+ 使用指南四

  • 如果你还不了解NSGA-II可以参考

NSGA-II入门

​多目标优化拥挤距离计算

多目标优化按支配关系分层实现

Running the experiments

R脚本的运行

需要安装R语言和Rstudio

  • 运行以下语句即可
Rscript ZDT.HV.Boxlplot.R
Rscript ZDT.HV.Wilcox.R
Rscript ZDT.EPSILON.Boxplot.R
Rscript ZDT.EPSILON.Wilcox.R

注意绝对路径的使用

exp.experimentBaseDirectory_ 务必使用绝对路径

这是因为相对地址在我目前的环境下win10+R下读不出来,因此此处换成绝对地址。在java环境中这种写法是正确的的,但是在R语言的环境中,这是有错误的 有两个地方

write("", "./log/NSGAIIStudy/R/Problems.SPSILON.Wilcox.tex",append=FALSE)
resultDirectory<-"./log/NSGAIIStudy/data"

一个是上面的tex文件的地址,一个是下面的resultDirectory 而在Jmetal4+的code中:

  • "./log/NSGAIIStudy/R/Problems.SPSILON.Wilcox.tex" 对应着jmetal/experiments/util/RWilcoxon.java中的texFile 而 String texFile = rDirectory + "/" + prefix + "." + experiment.indicatorList_[indicator] + ".Wilcox.tex"; 因此,需要更改rDirectory rDirectory = experiment.experimentBaseDirectory_ + "/" + rDirectory; 因此,需要更改experiment.experimentBaseDirectory_experiment.experimentBaseDirectory_是在NSGAIIStudy中赋的值,因此在NSGAIIStudy中,应该修改
    exp.experimentBaseDirectory_ = "./log/" + exp.experimentName_;为绝对路径,而不是相对路径。 此处修改为我本机的绝对路径 exp.experimentBaseDirectory_ = "D:/Code/Coding/Constrained multiobjective/jmetal4.5.2/log/" +exp.experimentName_;

  • 使用Rstudio打开Problems.EPSILON.Wilcox.R,并在Terminal中输入语句Rscript Problems.EPSILON.Wilcox.R

  • 则此时文件夹下出现同名的tex文件,使用WinEdit即可进行编译

  • 结果发现SBX中的交叉概率对NSGAII算法的性能没有明显性的影响。