Class TerminationConfig
java.lang.Object
org.optaplanner.core.config.AbstractConfig<TerminationConfig>
org.optaplanner.core.config.solver.termination.TerminationConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionTypically implemented by constructing a new instance and callingAbstractConfig.inherit(AbstractConfig)
on it.Class<? extends Termination>
inherit
(TerminationConfig inheritedConfig) Inherits each property of theinheritedConfig
unless that property (or a semantic alternative) is defined by this instance (which overwrites the inherited behaviour).boolean
Return true if this TerminationConfig configures a termination condition.void
overwriteSpentLimit
(Duration spentLimit) void
overwriteUnimprovedSpentLimit
(Duration unimprovedSpentLimit) void
setBestScoreFeasible
(Boolean bestScoreFeasible) void
setBestScoreLimit
(String bestScoreLimit) void
setDaysSpentLimit
(Long daysSpentLimit) void
setHoursSpentLimit
(Long hoursSpentLimit) void
setMillisecondsSpentLimit
(Long millisecondsSpentLimit) void
setMinutesSpentLimit
(Long minutesSpentLimit) void
setScoreCalculationCountLimit
(Long scoreCalculationCountLimit) void
setSecondsSpentLimit
(Long secondsSpentLimit) void
setSpentLimit
(Duration spentLimit) void
setStepCountLimit
(Integer stepCountLimit) void
setTerminationClass
(Class<? extends Termination> terminationClass) void
setTerminationCompositionStyle
(TerminationCompositionStyle terminationCompositionStyle) void
setTerminationConfigList
(List<TerminationConfig> terminationConfigList) void
setUnimprovedDaysSpentLimit
(Long unimprovedDaysSpentLimit) void
setUnimprovedHoursSpentLimit
(Long unimprovedHoursSpentLimit) void
setUnimprovedMillisecondsSpentLimit
(Long unimprovedMillisecondsSpentLimit) void
setUnimprovedMinutesSpentLimit
(Long unimprovedMinutesSpentLimit) void
setUnimprovedScoreDifferenceThreshold
(String unimprovedScoreDifferenceThreshold) void
setUnimprovedSecondsSpentLimit
(Long unimprovedSecondsSpentLimit) void
setUnimprovedSpentLimit
(Duration unimprovedSpentLimit) void
setUnimprovedStepCountLimit
(Integer unimprovedStepCountLimit) void
shortenTimeMillisSpentLimit
(long timeMillisSpentLimit) void
visitReferencedClasses
(Consumer<Class<?>> classVisitor) Call the class visitor on each (possibly null) Class instance provided to this config by the user (including those provided in child configs).withBestScoreFeasible
(Boolean bestScoreFeasible) withBestScoreLimit
(String bestScoreLimit) withDaysSpentLimit
(Long daysSpentLimit) withHoursSpentLimit
(Long hoursSpentLimit) withMillisecondsSpentLimit
(Long millisecondsSpentLimit) withMinutesSpentLimit
(Long minutesSpentLimit) withScoreCalculationCountLimit
(Long scoreCalculationCountLimit) withSecondsSpentLimit
(Long secondsSpentLimit) withSpentLimit
(Duration spentLimit) withStepCountLimit
(Integer stepCountLimit) withTerminationClass
(Class<? extends Termination> terminationClass) withTerminationCompositionStyle
(TerminationCompositionStyle terminationCompositionStyle) withTerminationConfigList
(List<TerminationConfig> terminationConfigList) withUnimprovedDaysSpentLimit
(Long unimprovedDaysSpentLimit) withUnimprovedHoursSpentLimit
(Long unimprovedHoursSpentLimit) withUnimprovedMillisecondsSpentLimit
(Long unimprovedMillisecondsSpentLimit) withUnimprovedMinutesSpentLimit
(Long unimprovedMinutesSpentLimit) withUnimprovedScoreDifferenceThreshold
(String unimprovedScoreDifferenceThreshold) withUnimprovedSecondsSpentLimit
(Long unimprovedSecondsSpentLimit) withUnimprovedSpentLimit
(Duration unimprovedSpentLimit) withUnimprovedStepCountLimit
(Integer unimprovedStepCountLimit) Methods inherited from class org.optaplanner.core.config.AbstractConfig
toString
-
Constructor Details
-
TerminationConfig
public TerminationConfig()
-
-
Method Details
-
getTerminationClass
-
setTerminationClass
-
getTerminationCompositionStyle
-
setTerminationCompositionStyle
-
getSpentLimit
-
setSpentLimit
-
getMillisecondsSpentLimit
-
setMillisecondsSpentLimit
-
getSecondsSpentLimit
-
setSecondsSpentLimit
-
getMinutesSpentLimit
-
setMinutesSpentLimit
-
getHoursSpentLimit
-
setHoursSpentLimit
-
getDaysSpentLimit
-
setDaysSpentLimit
-
getUnimprovedSpentLimit
-
setUnimprovedSpentLimit
-
getUnimprovedMillisecondsSpentLimit
-
setUnimprovedMillisecondsSpentLimit
-
getUnimprovedSecondsSpentLimit
-
setUnimprovedSecondsSpentLimit
-
getUnimprovedMinutesSpentLimit
-
setUnimprovedMinutesSpentLimit
-
getUnimprovedHoursSpentLimit
-
setUnimprovedHoursSpentLimit
-
getUnimprovedDaysSpentLimit
-
setUnimprovedDaysSpentLimit
-
getUnimprovedScoreDifferenceThreshold
-
setUnimprovedScoreDifferenceThreshold
-
getBestScoreLimit
-
setBestScoreLimit
-
getBestScoreFeasible
-
setBestScoreFeasible
-
getStepCountLimit
-
setStepCountLimit
-
getUnimprovedStepCountLimit
-
setUnimprovedStepCountLimit
-
getScoreCalculationCountLimit
-
setScoreCalculationCountLimit
-
getTerminationConfigList
-
setTerminationConfigList
-
withTerminationClass
-
withTerminationCompositionStyle
public TerminationConfig withTerminationCompositionStyle(TerminationCompositionStyle terminationCompositionStyle) -
withSpentLimit
-
withMillisecondsSpentLimit
-
withSecondsSpentLimit
-
withMinutesSpentLimit
-
withHoursSpentLimit
-
withDaysSpentLimit
-
withUnimprovedSpentLimit
-
withUnimprovedMillisecondsSpentLimit
public TerminationConfig withUnimprovedMillisecondsSpentLimit(Long unimprovedMillisecondsSpentLimit) -
withUnimprovedSecondsSpentLimit
-
withUnimprovedMinutesSpentLimit
-
withUnimprovedHoursSpentLimit
-
withUnimprovedDaysSpentLimit
-
withUnimprovedScoreDifferenceThreshold
public TerminationConfig withUnimprovedScoreDifferenceThreshold(String unimprovedScoreDifferenceThreshold) -
withBestScoreLimit
-
withBestScoreFeasible
-
withStepCountLimit
-
withUnimprovedStepCountLimit
-
withScoreCalculationCountLimit
-
withTerminationConfigList
-
overwriteSpentLimit
-
calculateTimeMillisSpentLimit
-
shortenTimeMillisSpentLimit
public void shortenTimeMillisSpentLimit(long timeMillisSpentLimit) -
overwriteUnimprovedSpentLimit
-
calculateUnimprovedTimeMillisSpentLimit
-
isConfigured
public boolean isConfigured()Return true if this TerminationConfig configures a termination condition. Note: this does not mean it will always terminate: ex: bestScoreLimit configured, but it is impossible to reach the bestScoreLimit. -
inherit
Description copied from class:AbstractConfig
Inherits each property of theinheritedConfig
unless that property (or a semantic alternative) is defined by this instance (which overwrites the inherited behaviour).After the inheritance, if a property on this
AbstractConfig
composition is replaced, it should not affect the inherited composition instance.- Specified by:
inherit
in classAbstractConfig<TerminationConfig>
- Parameters:
inheritedConfig
- never null- Returns:
- this
-
copyConfig
Description copied from class:AbstractConfig
Typically implemented by constructing a new instance and callingAbstractConfig.inherit(AbstractConfig)
on it.- Specified by:
copyConfig
in classAbstractConfig<TerminationConfig>
- Returns:
- new instance
-
visitReferencedClasses
Description copied from class:AbstractConfig
Call the class visitor on each (possibly null) Class instance provided to this config by the user (including those provided in child configs). Required to create the bean factory in Quarkus.- Specified by:
visitReferencedClasses
in classAbstractConfig<TerminationConfig>
- Parameters:
classVisitor
- The visitor of classes, never null. Can accept null instances of Class.
-