2016-12-20 5 views
1

局所探索の前に、ヒューリスティックな構造によって解を初期化する必要があります。建設ヒューリスティック

[main] INFO org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase - Construction Heuristic phase (0) ended: step total (273), time spent (5903), best score (-429hard/-5400soft). 
    Exception in thread "main" java.lang.IllegalStateException: Local Search phase (1) needs to start from an initialized solution, but the planning variable (Task.previousTaskOrMachinePlan) is uninitialized for the entity ([email protected]). 
     Initialize the solution by configuring a Construction Heuristic phase before this phase. 
     at org.optaplanner.core.impl.phase.AbstractPhase.assertWorkingSolutionInitialized(AbstractPhase.java:141) 
     at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.phaseStarted(DefaultLocalSearchPhase.java:124) 
     at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.solve(DefaultLocalSearchPhase.java:66) 
     at org.optaplanner.core.impl.solver.DefaultSolver.runPhases(DefaultSolver.java:215) 
     at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:176) 
     at com.esquel.fas.aps.App.main(App.java:127) 

ソルバー設定で次の項目を追加すると、すべてが完全に破損します。

<constructionHeuristic> 
    <constructionHeuristicType>FIRST_FIT</constructionHeuristicType> 
    </constructionHeuristic> 

しかし、KIE Workbenchのソルバーの設定は、ソースレベルでは編集できませんし、ユーザーインターフェイスでのオプションはありません、我々はKIEのプロジェクト内で、これを含めることができるか疑問?ありがとう。

+0

またはが存在しない場合は、デフォルトで両方の値が設定されている必要があります。そのため、ローカル検索でCHが初期化されているため、 CHを明示的に追加すると、LSが実行されない(ソリューションの品質が低下する)ことを意味します。 –

+0

どこか奇妙なことをする必要があります。 DEBUGログを追加し、CHがタスク 'com.esquel.fas.aps.Task @ ac91282'を初期化するかどうかを確認してください。 –

答えて

1

ドメインモデル、特にタスクでセッターとゲッターをチェックしてください。 DEBUGログを確認してください。

+1

あなたは正しいです。Geoffrey、クラスTaskのCustomShadowVariableにバグがあります。ありがとう。 –