modified for optaplanner
(cherry picked from commit 8bf547db44d150c355016a214389577bf4a63b87)