gpt4 book ai didi

evolutionary-algorithm - NSGA-II 实现

转载 作者:行者123 更新时间:2023-12-04 00:18:10 28 4
gpt4 key购买 nike

我研究了非支配排序算法(NSGA-II)。
我想用这个多目标优化算法。
任何人都可以通过在 java 或 matlab 中解决 NSGA-II 的任何免费实现来帮助我。

提前致谢

最佳答案

MOEA Framework是一个用于多目标优化的免费开源 Java 框架。它拥有所有图书馆中最大的 MOEA 集合,包括 NSGA-I、NSGA-II 和 NSGA-III。

我个人用它来实现和解决我硕士论文的多目标问题 (MOP),发现它远远优于 PyGMO (对于 python)和 jMetal (在 Java 中)。

以下代码演示了如何使用 MOEA Framework API 运行 NSGA-II 来解决 ZDT1 多目标问题:

import java.util.List;
import org.moeaframework.Executor;
import org.moeaframework.core.NondominatedPopulation;
import org.moeaframework.core.Solution;

public class NSGAIIExample {

public static void main(String[] args) {
// configure and run this experiment
NondominatedPopulation result = new Executor()
.withProblem("ZDT1")
.withAlgorithm("NSGAII")
.withMaxEvaluations(1000)
.distributeOnAllCores()
.run();

List<NondominatedPopulation> multiRuns = new Executor()
.withProblem("ZDT1")
.withAlgorithm("NSGAII")
.withMaxEvaluations(1000)
.distributeOnAllCores()
.runSeeds(3);

System.out.format("Obj1 Obj2%n");
for (Solution solution : result) {
System.out.format("%.5f\t%.5f%n", solution.getObjective(0),
solution.getObjective(1));
}
}
}

关于evolutionary-algorithm - NSGA-II 实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18418503/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com