如何在 VehicleRouting 示例中实现 Constraint Match Total
How to implement Constraint Match Total in VehicleRouting example
我试图用 GUI 解释 VehicleRouting 示例的分数,但我不明白这一点:"Do not attempt to parse this string or use it in your UI or exposed services. Instead use the ConstraintMatch API below and do it properly." 什么是 ConstraintMatch API,我如何实现它GUI 示例?
我只尝试打印 solver.explainBestScore(),但它说 "Do not attempt to parse this string or use it in your UI or exposed services"。
看看 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()",您将到达 "Explaining the score" 部分,其中记录了如何执行此操作。
我试图用 GUI 解释 VehicleRouting 示例的分数,但我不明白这一点:"Do not attempt to parse this string or use it in your UI or exposed services. Instead use the ConstraintMatch API below and do it properly." 什么是 ConstraintMatch API,我如何实现它GUI 示例?
我只尝试打印 solver.explainBestScore(),但它说 "Do not attempt to parse this string or use it in your UI or exposed services"。
看看 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()",您将到达 "Explaining the score" 部分,其中记录了如何执行此操作。