Class DefaultConstraintMatchTotal<Score_ extends Score<Score_>>
java.lang.Object
ai.timefold.solver.core.impl.score.constraint.DefaultConstraintMatchTotal<Score_>
- Type Parameters:
Score_-
- All Implemented Interfaces:
ConstraintMatchTotal<Score_>,Comparable<DefaultConstraintMatchTotal<Score_>>
public final class DefaultConstraintMatchTotal<Score_ extends Score<Score_>>
extends Object
implements ConstraintMatchTotal<Score_>, Comparable<DefaultConstraintMatchTotal<Score_>>
If possible, prefer using
SolutionManager.analyze(Object) instead.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConstraintMatchTotal(ConstraintRef constraintRef) Deprecated, for removal: This API element is subject to removal in a future version.DefaultConstraintMatchTotal(ConstraintRef constraintRef, Score_ constraintWeight) DefaultConstraintMatchTotal(Constraint constraint, Score_ constraintWeight) Deprecated, for removal: This API element is subject to removal in a future version.DefaultConstraintMatchTotal(String constraintPackage, String constraintName) Deprecated, for removal: This API element is subject to removal in a future version.DefaultConstraintMatchTotal(String constraintPackage, String constraintName, Score_ constraintWeight) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstraintMatch(ConstraintMatch<Score_> constraintMatch) addConstraintMatch(ConstraintJustification justification, Collection<Object> indictedObjects, Score_ score) Creates aConstraintMatchand adds it to the collection returned bygetConstraintMatchSet().addConstraintMatch(List<Object> justifications, Score_ score) Creates aConstraintMatchand adds it to the collection returned bygetConstraintMatchSet().intboolean@NonNull Set<ConstraintMatch<Score_>>@NonNull ConstraintRef@NonNull Score_The effective value of constraint weight after applying optional overrides.@NonNull Score_getScore()inthashCode()voidremoveConstraintMatch(ConstraintMatch<Score_> constraintMatch) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ai.timefold.solver.core.api.score.constraint.ConstraintMatchTotal
getConstraintId, getConstraintMatchCount, getConstraintName, getConstraintPackage
-
Constructor Details
-
DefaultConstraintMatchTotal
@Deprecated(forRemoval=true, since="1.4.0") public DefaultConstraintMatchTotal(String constraintPackage, String constraintName) Deprecated, for removal: This API element is subject to removal in a future version. -
DefaultConstraintMatchTotal
@Deprecated(forRemoval=true, since="1.5.0") public DefaultConstraintMatchTotal(ConstraintRef constraintRef) Deprecated, for removal: This API element is subject to removal in a future version. -
DefaultConstraintMatchTotal
@Deprecated(forRemoval=true, since="1.4.0") public DefaultConstraintMatchTotal(Constraint constraint, Score_ constraintWeight) Deprecated, for removal: This API element is subject to removal in a future version. -
DefaultConstraintMatchTotal
@Deprecated(forRemoval=true, since="1.4.0") public DefaultConstraintMatchTotal(String constraintPackage, String constraintName, Score_ constraintWeight) Deprecated, for removal: This API element is subject to removal in a future version. -
DefaultConstraintMatchTotal
-
-
Method Details
-
getConstraintRef
- Specified by:
getConstraintRefin interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
-
getConstraintWeight
Description copied from interface:ConstraintMatchTotalThe effective value of constraint weight after applying optional overrides. It is independent to the state of theplanning variables. Do not confuse withConstraintMatchTotal.getScore().- Specified by:
getConstraintWeightin interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
-
getConstraintMatchSet
- Specified by:
getConstraintMatchSetin interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
-
getScore
Description copied from interface:ConstraintMatchTotal- Specified by:
getScorein interfaceConstraintMatchTotal<Score_ extends Score<Score_>>
-
addConstraintMatch
Creates aConstraintMatchand adds it to the collection returned bygetConstraintMatchSet(). It will useDefaultConstraintJustification, whoseDefaultConstraintJustification.getFacts()method will return the given list of justifications. Additionally, the constraint match will indict the objects in the given list of justifications.- Parameters:
justifications- never null, never emptyscore- never null- Returns:
- never null
-
addConstraintMatch
public ConstraintMatch<Score_> addConstraintMatch(ConstraintJustification justification, Collection<Object> indictedObjects, Score_ score) Creates aConstraintMatchand adds it to the collection returned bygetConstraintMatchSet(). It will be justified with the providedConstraintJustification. Additionally, the constraint match will indict the objects in the given list of indicted objects.- Parameters:
indictedObjects- never null, may be emptyscore- never null- Returns:
- never null
-
addConstraintMatch
-
removeConstraintMatch
-
compareTo
- Specified by:
compareToin interfaceComparable<Score_ extends Score<Score_>>
-
equals
-
hashCode
public int hashCode() -
toString
-
DefaultConstraintMatchTotal(ConstraintRef, Score_).