Annotation Type PlanningScore
-
@Target({METHOD,FIELD}) @Retention(RUNTIME) public @interface PlanningScore
Specifies that a property (or a field) on aPlanningSolutionclass holds theScoreof that solution.This property can be null if the
PlanningSolutionis uninitialized.This property is modified by the
Solver, every time when theScoreof thisPlanningSolutionhas been calculated.
-
-
Field Summary
Fields Modifier and Type Fields Description static intNO_LEVEL_SIZEWorkaround for annotation limitation inbendableHardLevelsSize()andbendableSoftLevelsSize().
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description intbendableHardLevelsSizeRequired for bendable scores.intbendableSoftLevelsSizeRequired for bendable scores.Class<? extends ScoreDefinition>scoreDefinitionClassOverrides the default determinedScoreDefinitionto implement a custom one.
-
-
-
Field Detail
-
NO_LEVEL_SIZE
static final int NO_LEVEL_SIZE
Workaround for annotation limitation inbendableHardLevelsSize()andbendableSoftLevelsSize().
-
-
Element Detail
-
bendableHardLevelsSize
int bendableHardLevelsSize
Required for bendable scores.For example with 3 hard levels, hard level 0 always outweighs hard level 1 which always outweighs hard level 2, which outweighs all the soft levels.
- Returns:
- 0 or higher if the
Scoreis aAbstractBendableScore, not used otherwise
- Default:
- -1
-
-
-
bendableSoftLevelsSize
int bendableSoftLevelsSize
Required for bendable scores.For example with 3 soft levels, soft level 0 always outweighs soft level 1 which always outweighs soft level 2.
- Returns:
- 0 or higher if the
Scoreis aAbstractBendableScore, not used otherwise
- Default:
- -1
-
-
-
scoreDefinitionClass
Class<? extends ScoreDefinition> scoreDefinitionClass
Overrides the default determinedScoreDefinitionto implement a custom one.If this is not specified, the
ScoreDefinitionis automatically determined based on the return type of the annotated property (or field) on aPlanningSolution.- Returns:
PlanningScore.NullScoreDefinitionwhen it is null (workaround for annotation limitation)
- Default:
- org.optaplanner.core.api.domain.solution.PlanningScore.NullScoreDefinition.class
-
-