在VehicleRouting示例中如何实现约束匹配总数

时间:2019-03-28 14:13:46

标签: optaplanner

我试图用GUI解释VehicleRouting示例的得分,但我不明白这一点:“请勿尝试解析此字符串或在您的UI或公开的服务中使用它。而是使用下面的ConstraintMatch API并正确地做。”什么是ConstraintMatch API,如何通过GUI示例实现它?

我只尝试打印resolver.explainBestScore(),但显示为“请勿尝试解析此字符串或在您的UI或公开的服务中使用它”。

1 个答案:

答案 0 :(得分:0)

看看该javadoc的其余部分:

 * Do not parse this string.
 * Instead, to provide this information in a UI or a service, use {@link #getScoreDirectorFactory()}
 * to retrieve {@link ScoreDirector#getConstraintMatchTotals()} and {@link ScoreDirector#getIndictmentMap()}
 * and convert those into a domain specific API.

在文档中,执行ctrl -f“ getConstraintMatchTotals()”,然后您将在“解释分数”部分中找到完成该方法的文档。

相关问题