Class ConstraintMatchTotal
- java.lang.Object
-
- org.optaplanner.core.api.score.constraint.ConstraintMatchTotal
-
- All Implemented Interfaces:
Serializable
,Comparable<ConstraintMatchTotal>
public final class ConstraintMatchTotal extends Object implements Serializable, Comparable<ConstraintMatchTotal>
Explains theScore
of aPlanningSolution
, from the opposite side thanIndictment
. Retrievable fromScoreDirector.getConstraintMatchTotalMap()
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConstraintMatchTotal(String constraintPackage, String constraintName, Score zeroScore)
ConstraintMatchTotal(String constraintPackage, String constraintName, Score constraintWeight, Score zeroScore)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ConstraintMatch
addConstraintMatch(List<Object> justificationList, Score score)
int
compareTo(ConstraintMatchTotal other)
static String
composeConstraintId(String constraintPackage, String constraintName)
boolean
equals(Object o)
String
getConstraintId()
To create a constraintId, usecomposeConstraintId(String, String)
.int
getConstraintMatchCount()
Set<ConstraintMatch>
getConstraintMatchSet()
String
getConstraintName()
String
getConstraintPackage()
Score
getConstraintWeight()
The value of theConstraintWeight
annotated member of theConstraintConfiguration
.Score
getScore()
Sum of thegetConstraintMatchSet()
'sConstraintMatch.getScore()
.Score
getScoreTotal()
Deprecated.in favor ofgetScore()
int
hashCode()
void
removeConstraintMatch(ConstraintMatch constraintMatch)
String
toString()
-
-
-
Constructor Detail
-
ConstraintMatchTotal
public ConstraintMatchTotal(String constraintPackage, String constraintName, Score zeroScore)
- Parameters:
constraintPackage
- never nullconstraintName
- never nullzeroScore
- never null
-
ConstraintMatchTotal
public ConstraintMatchTotal(String constraintPackage, String constraintName, Score constraintWeight, Score zeroScore)
- Parameters:
constraintPackage
- never nullconstraintName
- never nullconstraintWeight
- null ifConstraintWeight
isn't used for this constraintzeroScore
- never null
-
-
Method Detail
-
composeConstraintId
public static String composeConstraintId(String constraintPackage, String constraintName)
- Parameters:
constraintPackage
- never nullconstraintName
- never null- Returns:
- never null
-
getConstraintPackage
public String getConstraintPackage()
- Returns:
- never null
-
getConstraintName
public String getConstraintName()
- Returns:
- never null
-
getConstraintWeight
public Score getConstraintWeight()
The value of theConstraintWeight
annotated member of theConstraintConfiguration
. It's independent to the state of theplanning variables
. Do not confuse withgetScore()
.- Returns:
- null if
ConstraintWeight
isn't used for this constraint
-
getConstraintMatchSet
public Set<ConstraintMatch> getConstraintMatchSet()
- Returns:
- never null
-
getConstraintMatchCount
public int getConstraintMatchCount()
- Returns:
>= 0
-
getScore
public Score getScore()
Sum of thegetConstraintMatchSet()
'sConstraintMatch.getScore()
.- Returns:
- never null
-
getScoreTotal
@Deprecated public Score getScoreTotal()
Deprecated.in favor ofgetScore()
- Returns:
- never null
-
addConstraintMatch
public ConstraintMatch addConstraintMatch(List<Object> justificationList, Score score)
-
removeConstraintMatch
public void removeConstraintMatch(ConstraintMatch constraintMatch)
-
getConstraintId
public String getConstraintId()
To create a constraintId, usecomposeConstraintId(String, String)
.- Returns:
- never null
-
compareTo
public int compareTo(ConstraintMatchTotal other)
- Specified by:
compareTo
in interfaceComparable<ConstraintMatchTotal>
-
-