【发布时间】:2018-02-04 09:24:53
【问题描述】:
我的理解是蛮力总是会给出最好的解决方案,但不会扩展。而元启发式将在一定的时间限制内提供最好的。含义如果给定足够的时间,它应该与蛮力解决方案相匹配。
但是,在我的实现中并没有发生。我通过蛮力算法得到了最好的解决方案,但即使我给了足够的时间,MH 也不一样。可能是什么原因。我认为我能想到的原因是 MH 陷入了局部最大值。但是,我试图从我的理解中避免这种情况。
我不分享实现,因为它很复杂。如果需要将分享代码。
更新:
我的 MoveSelector 配置-
<?xml version="1.0" encoding="UTF-8"?>
<solver>
<!-- Domain model configuration -->
<solutionClass>com.example.CutSolution</solutionClass>
<entityClass>com.example.Size</entityClass>
<!-- Score configuration -->
<scoreDirectorFactory>
<easyScoreCalculatorClass>com.example.CutplanEasyScoreCalculator</easyScoreCalculatorClass>
</scoreDirectorFactory>
<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT</constructionHeuristicType>
</constructionHeuristic>
<localSearch>
<termination>
<unimprovedSecondsSpentLimit>10</unimprovedSecondsSpentLimit>
</termination>
<unionMoveSelector>
<changeMoveSelector/>
<swapMoveSelector/>
<pillarChangeMoveSelector/>
<pillarSwapMoveSelector/>
</unionMoveSelector>
<acceptor>
<entityTabuRatio>0.02</entityTabuRatio>
</acceptor>
<forager>
<acceptedCountLimit>1000</acceptedCountLimit>
</forager>
</localSearch>
</solver>
我只有一个计划实体和一个计划变量。
谢谢。
【问题讨论】:
标签: optaplanner drools-planner