OptaPlanner:如何在不构建任何解决方案的情况下计算给定实体的分数

OptaPlanner: how to compute the score on the given entities without constructing any solution

在我的项目中,我必须找到一种方法来初始化一些实体和 return 它们的分数而不改变它们的值。可能吗?

查看 "score calculation" 章中的文档部分 "Explaining the score"。

基本上,调用 Solver.getScoreDirectoFactory() 并调用 ScoreDirector.setWorkingSolution()ScoreDirector.calculateScore()