Description of problem: I've observed that some phases in planner runs well despite of wrongly set scoreDefinitionType in configuration. For instnace construction heuristics creates TSP problem from OptaplannerExamples although there is different score option in configuration than SimpleLong, which is used by TSP. Expected results: I would expect some exeption explaining that there are different score types. Or If planner is so clever it is able to determine score type from domain itsel, it would be good if there was no option in config such as "scoreDefinitionType". But some phases (for example BRANCH_AND_BOUND) can't deal with this wrong config option anyway, which is be expected. But if it is expected here, it should be expected everywhere.
Interesting case. BruteForce doesn't need the ScoreDefinition, so it's the Solution<FooScore> and ScoreCalculator<FooScore>'s score type that is used (and they must match). Nevertheless, this should fail fast of course, so I am fixing it. Note: If a Drools score calculator is used, the wrong scoreDefinition does fail fast due to clashing with the score holder in the DRL.
Fixed on master: https://github.com/droolsjbpm/optaplanner/commit/611a9d1e493262590a76a8581fde2b95e1a15b51 https://github.com/droolsjbpm/optaplanner/commit/e841f44dfa452bce531030490f6c24622aa23830 https://github.com/droolsjbpm/optaplanner/commit/03bf731f9e1c2afe015155c29bb70533c4fe42a5
Not backported to 6.2.x because blocker tag is missing (and I don't think it's needed)
Verified. (as we discussed earlier that fixing this consistency breaks backward compatibility)