我試圖用得分導演像optaplnner:當constraintMatchEnabled(假)是禁用的,這種方法不應該叫
Solver solver = solverFactory.buildSolver();
ScoreDirectorFactory scoreDirectorFactory = solver.getScoreDirectorFactory();
ScoreDirector guiScoreDirector = scoreDirectorFactory.buildScoreDirector();
for (ConstraintMatchTotal constraintMatchTotal :guiScoreDirector.getConstraintMatchTotals()) {
}
但我得到以下情況例外,當我打電話getConstraintMatchTotals方法:
When constraintMatchEnabled (false) is disabled, this method should not be called.. Stacktrace follows:
Message: When constraintMatchEnabled (false) is disabled, this method should not be called.
Line | Method
->> 140 | getConstraintMatchTotals in org.optaplanner.core.impl.score.director.AbstractScoreDirector
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 57 | solve in com.volcare.optaplanner.TaskPlanningController
| 97 | index . . . . . . . . . in ''
| 200 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter . . . . . . . . in grails.plugin.cache.web.filter.AbstractFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
solverconfig.xml
<!-- Score configuration -->
<scoreDirectorFactory>
<scoreDefinitionType>HARD_SOFT_BIG_DECIMAL</scoreDefinitionType>
<simpleScoreCalculatorClass>com.volcare.optaplanner.TaskPlanScoreCalculator</simpleScoreCalculatorClass>
<!-- <scoreDrl>/taskPlanningScoreRules.drl</scoreDrl> -->
</scoreDirectorFactory>
我想知道你使用的是什麼得分導演(只有drools支持它開箱,但消息似乎關閉)。你能否在這裏複製解算器配置中的元素? –
2014-09-23 14:48:29
我正在使用簡單的java分數計算器,我添加了有問題的配置。 – 2014-09-24 04:57:37