Package org.optaplanner.test.impl.score
Class AbstractScoreVerifier<Solution_>
java.lang.Object
org.optaplanner.test.impl.score.AbstractScoreVerifier<Solution_>
- Type Parameters:
- Solution_- the solution type, the class with the- PlanningSolutionannotation
- Direct Known Subclasses:
- BendableBigDecimalScoreVerifier,- BendableLongScoreVerifier,- BendableScoreVerifier,- HardMediumSoftLongScoreVerifier,- HardMediumSoftScoreVerifier,- HardSoftBigDecimalScoreVerifier,- HardSoftLongScoreVerifier,- HardSoftScoreVerifier,- SimpleBigDecimalScoreVerifier,- SimpleLongScoreVerifier,- SimpleScoreVerifier
Deprecated, for removal: This API element is subject to removal in a future version.
Score DRL is deprecated and will be removed in a future major version of OptaPlanner.
             See DRL to
             Constraint Streams migration recipe.
Used in unit tests to assert that 1 particular solution has a specific weight for a specific constraint.
 This works well to verify that the implementation is in sync with the business constraints.
 This does not work well to detect score corruption,
 use 
ScoreDirectorFactoryConfig.setAssertionScoreDirectorFactory(ScoreDirectorFactoryConfig) for that instead.
 
 Do not use this class directly, instead use the specific subclass for your Score type,
 such as HardSoftScoreVerifier.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final InnerScoreDirectorFactory<Solution_,?> Deprecated, for removal: This API element is subject to removal in a future version.
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractScoreVerifier(SolverFactory<Solution_> solverFactory, Class<? extends Score<?>> expectedScoreClass) Deprecated, for removal: This API element is subject to removal in a future version.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidassertWeight(String constraintPackage, String constraintName, int scoreLevel, Number expectedWeight, Solution_ solution) Deprecated, for removal: This API element is subject to removal in a future version.Assert that the constraint ofPlanningSolutionhas the expected weight for that score level.
- 
Field Details- 
scoreDirectorFactoryDeprecated, for removal: This API element is subject to removal in a future version.
 
- 
- 
Constructor Details- 
AbstractScoreVerifierpublic AbstractScoreVerifier(SolverFactory<Solution_> solverFactory, Class<? extends Score<?>> expectedScoreClass) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
- solverFactory- never null, the- SolverFactoryof which you want to test the constraints.
- expectedScoreClass- never null, used to fail fast if a- SolverFactorywith another- Scoretype is used.
 
 
- 
- 
Method Details- 
assertWeightprotected void assertWeight(String constraintPackage, String constraintName, int scoreLevel, Number expectedWeight, Solution_ solution) Deprecated, for removal: This API element is subject to removal in a future version.Assert that the constraint ofPlanningSolutionhas the expected weight for that score level.- Parameters:
- constraintPackage- sometimes null. When null,- constraintNamefor the- scoreLevelmust be unique.
- scoreLevel- at least 0
- constraintName- never null, the name of the constraint
- expectedWeight- never null, the total weight for all matches of that 1 constraint
- solution- never null
 
 
-