Skip to content
Advertisement

Is it possible to verify already existing solution by OptaPlanner to check how may rules get broken?

Here the already existing solution is generated by any other codebase/tool but we can adjust the attribute as per requirement for OptaPlanner.
Main aim is to verify that existing solution is breaking how many rules then the mature result from optaPlanner.

Advertisement

Answer

Yes, that’s possible.

See docs section “explaining the score”. Basically you use SolverFactory.getScoreDirectorFactory() to build a ScoreDirector and then use setWorkingSolution(), calculateScore() and then explainScore() (in that order).

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement