"Unfortunately, I cannot put an array of doubles back to Score since there is no useful method for that in the Score interface."
Very good point - I 'll add ScoreDefinition.fromLevelNumbers(Number[]) to remedy that.

The workaround, using (int) casts works well on int based scores, but won't work properly on SimpleDoubleScore, HardSoftDoubleScore, SimpleBigDecimalScore, HardSoftBigDecimalScore.

Note: Originally, I didn't want to add fromLevelNumbers() because it's incompatible with pareto scoring (unimplemented feature [1]). But I 'll fix that later by renaming toLevelNumbers() & fromLevelNumbers() to toPartNumbers() & fromPartNumbers() or something like that. It's just the naming that is wrong: no code relies on a hierarchical ordering of the levelNumbers AFAIK (just a reliable ordering is enough).

[1] https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-docs/src/main/docbook/en-US/images/Chapter-Score_calculation/scoreComposition.png