问题描述
我刚刚开始使用Optaplanner.通常在本地搜索元启发式方法中,通常从搜索空间中的多个初始解开始,然后尝试同时进行改进.这样,我们就可以降低陷入局部最优的风险,并选择得分最高的最终解决方案.
I just started using Optaplanner. Usually in local search metaheuristics, it is common to start from multiple initial solutions in the search space and try to improve them in parallel. That way we decrease the risk of falling in a local optimum and we choose the final solution with the best score.
例如,我可以说在Optaplanner中有类似的功能可以使用这100个初始解来开始求解吗?
Is there a similar feature in Optaplanner where I could say, for example, start solving using those 100 initial solutions?
谢谢
Antoine
推荐答案
不是开箱即用的,但是添加起来也很简单(我过去也这样做过).使用自己的求解器,只需启动n个线程即可.最后,以整体最佳分数获得线程的解决方案.
Not out-of-the-box, but it's trivial too add (and I have done so in the past). Just start n threads, using their own Solver. At the end, take the solution of the thread with the overall best score.
要让每个规划求解尝试不同的方法,请使用environmentMode PRODUCTION(使用随机randomSeed),或配置其他求解器配置(具有不同的TS或LA参数等)
To have each Solver try something different, either use environmentMode PRODUCTION (which uses a random randomSeed), or configure alternative solver configurations (with different TS or LA parameters etc)
将CPU核心的数量增加n(或者使用某些技术甚至减少一半)不是一个好主意.
It's not a good idea to take an n higher than your number of CPU cores (or even half of them with some technologies).
这篇关于并行解决多个初始解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!