【发布时间】:2019-04-24 01:03:36
【问题描述】:
我之前用过MOEA Framework,它知道约束的概念。也就是说,问题的解决方案可能具有良好的适应度,但不可行。例如,在使用knapsack problem 时,特定的物品组合可能会带来高利润,但它们的重量超过了背包的容量。相应的适应度函数将包括如下行:
// Set the fitness (=> profit) of the solution (=> knapsack).
solution.setObjective(0, profit)
// Set the constrain (=> 0.0 if OK, , otherwise the distance to the boundary).
solution.setConstraint(0, (weight <= capacity) ? 0.0 : weight - capacity)
另一个多目标背包问题的例子是一个背包不允许使用已经在另一个背包中使用的物品。
Jenetics 有类似的东西吗?或者我如何将约束编码为适应度函数的一部分(或其他地方)?
【问题讨论】:
标签: java optimization genetic-algorithm jenetics