Class BendableBigDecimalScoreVerifier<Solution_>
- java.lang.Object
-
- org.optaplanner.test.impl.score.AbstractScoreVerifier<Solution_>
-
- org.optaplanner.test.impl.score.buildin.bendablebigdecimal.BendableBigDecimalScoreVerifier<Solution_>
-
- Type Parameters:
Solution_
- the solution type, the class with thePlanningSolution
annotation
public class BendableBigDecimalScoreVerifier<Solution_> extends AbstractScoreVerifier<Solution_>
To assert the constraints of aSolverFactory
that uses aBendableBigDecimalScore
. If you're usingConstraintStream
s, useConstraintVerifier
instead.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
hardLevelsSize
-
Fields inherited from class org.optaplanner.test.impl.score.AbstractScoreVerifier
scoreDirectorFactory
-
-
Constructor Summary
Constructors Constructor Description BendableBigDecimalScoreVerifier(SolverFactory<Solution_> solverFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertHardWeight(String constraintName, int hardLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.void
assertHardWeight(String constraintPackage, String constraintName, int hardLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.void
assertSoftWeight(String constraintName, int softLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.void
assertSoftWeight(String constraintPackage, String constraintName, int softLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.-
Methods inherited from class org.optaplanner.test.impl.score.AbstractScoreVerifier
assertWeight
-
-
-
-
Constructor Detail
-
BendableBigDecimalScoreVerifier
public BendableBigDecimalScoreVerifier(SolverFactory<Solution_> solverFactory)
- Parameters:
solverFactory
- never null, theSolverFactory
of which you want to test the constraints.
-
-
Method Detail
-
assertHardWeight
public void assertHardWeight(String constraintName, int hardLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.- Parameters:
constraintName
- never null, the name of the constrainthardLevel
-0 <= hardLevel <
hardLevelSize
. ThescoreLevel
ishardLevel
for hard levels andsoftLevel + hardLevelSize
for soft levels.expectedWeight
- never null, the total weight for all matches of that 1 constraintsolution
- never null, the actualPlanningSolution
-
assertHardWeight
public void assertHardWeight(String constraintPackage, String constraintName, int hardLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.- Parameters:
constraintPackage
- sometimes null. When null,constraintName
for thescoreLevel
must be unique.constraintName
- never null, the name of the constrainthardLevel
-0 <= hardLevel <
hardLevelSize
. ThescoreLevel
ishardLevel
for hard levels andsoftLevel + hardLevelSize
for soft levels.expectedWeight
- never null, the total weight for all matches of that 1 constraintsolution
- never null, the actualPlanningSolution
-
assertSoftWeight
public void assertSoftWeight(String constraintName, int softLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.- Parameters:
constraintName
- never null, the name of the constraintsoftLevel
-0 <= softLevel <
softLevelSize
. ThescoreLevel
ishardLevel
for hard levels andsoftLevel + hardLevelSize
for soft levels.expectedWeight
- never null, the total weight for all matches of that 1 constraintsolution
- never null, the actualPlanningSolution
-
assertSoftWeight
public void assertSoftWeight(String constraintPackage, String constraintName, int softLevel, BigDecimal expectedWeight, Solution_ solution)
Assert that the constraint ofPlanningSolution
has the expected weight for that score level.- Parameters:
constraintPackage
- sometimes null. When null,constraintName
for thescoreLevel
must be unique.constraintName
- never null, the name of the constraintsoftLevel
-0 <= softLevel <
softLevelSize
. ThescoreLevel
ishardLevel
for hard levels andsoftLevel + hardLevelSize
for soft levels.expectedWeight
- never null, the total weight for all matches of that 1 constraintsolution
- never null, the actualPlanningSolution
-
-