Package org.optaplanner.core.impl.score

## Class ScoreUtils

- java.lang.Object
- - org.optaplanner.core.impl.score.ScoreUtils

-     public class ScoreUtils
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static double` | `calculateTimeGradient​(Number[] totalDiffNumbers, Number[] scoreDiffNumbers, double[] timeGradientWeightNumbers, int levelDepth)` |
    `static double[]` | `extractLevelDoubles​(Score score)` |
    `static Score` | `parseScore​(Class<? extends Score<?>> scoreClass, String scoreString)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### parseScore

          public static Score parseScore​(Class<? extends Score<?>> scoreClass,
                                         String scoreString)

      Parameters:
        `scoreClass` - never null, should be of the same `ClassLoader` as this class.
        `scoreString` - never null
      Returns:
        never null
      Throws:
        `IllegalArgumentException` - if the scoreClass is a custom `Score`
      See Also:
        `ScoreDefinition.parseScore(String)`

    - #### extractLevelDoubles

          public static double[] extractLevelDoubles​(Score score)

    - #### calculateTimeGradient

          public static double calculateTimeGradient​(Number[] totalDiffNumbers,
                                                     Number[] scoreDiffNumbers,
                                                     double[] timeGradientWeightNumbers,
                                                     int levelDepth)

      Parameters:
        `totalDiffNumbers` - never null
        `scoreDiffNumbers` - never null
        `timeGradientWeightNumbers` - never null
        `levelDepth` - The number of levels of the diffNumbers that are included
      Returns:
        `0.0 <= value <= 1.0`