Class TerminationConfig

java.lang.Object
org.optaplanner.core.config.AbstractConfig<TerminationConfig>
org.optaplanner.core.config.solver.termination.TerminationConfig

public class TerminationConfig extends AbstractConfig<TerminationConfig>
  • Constructor Details

    • TerminationConfig

      public TerminationConfig()
  • Method Details

    • getTerminationClass

      @Deprecated(forRemoval=true) public Class<? extends Termination> getTerminationClass()
      Deprecated, for removal: This API element is subject to removal in a future version.
      A custom terminationClass is deprecated and will be removed in a future major version of OptaPlanner.
    • setTerminationClass

      @Deprecated(forRemoval=true) public void setTerminationClass(Class<? extends Termination> terminationClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      A custom terminationClass is deprecated and will be removed in a future major version of OptaPlanner.
    • getTerminationCompositionStyle

      public TerminationCompositionStyle getTerminationCompositionStyle()
    • setTerminationCompositionStyle

      public void setTerminationCompositionStyle(TerminationCompositionStyle terminationCompositionStyle)
    • getSpentLimit

      public Duration getSpentLimit()
    • setSpentLimit

      public void setSpentLimit(Duration spentLimit)
    • getMillisecondsSpentLimit

      public Long getMillisecondsSpentLimit()
    • setMillisecondsSpentLimit

      public void setMillisecondsSpentLimit(Long millisecondsSpentLimit)
    • getSecondsSpentLimit

      public Long getSecondsSpentLimit()
    • setSecondsSpentLimit

      public void setSecondsSpentLimit(Long secondsSpentLimit)
    • getMinutesSpentLimit

      public Long getMinutesSpentLimit()
    • setMinutesSpentLimit

      public void setMinutesSpentLimit(Long minutesSpentLimit)
    • getHoursSpentLimit

      public Long getHoursSpentLimit()
    • setHoursSpentLimit

      public void setHoursSpentLimit(Long hoursSpentLimit)
    • getDaysSpentLimit

      public Long getDaysSpentLimit()
    • setDaysSpentLimit

      public void setDaysSpentLimit(Long daysSpentLimit)
    • getUnimprovedSpentLimit

      public Duration getUnimprovedSpentLimit()
    • setUnimprovedSpentLimit

      public void setUnimprovedSpentLimit(Duration unimprovedSpentLimit)
    • getUnimprovedMillisecondsSpentLimit

      public Long getUnimprovedMillisecondsSpentLimit()
    • setUnimprovedMillisecondsSpentLimit

      public void setUnimprovedMillisecondsSpentLimit(Long unimprovedMillisecondsSpentLimit)
    • getUnimprovedSecondsSpentLimit

      public Long getUnimprovedSecondsSpentLimit()
    • setUnimprovedSecondsSpentLimit

      public void setUnimprovedSecondsSpentLimit(Long unimprovedSecondsSpentLimit)
    • getUnimprovedMinutesSpentLimit

      public Long getUnimprovedMinutesSpentLimit()
    • setUnimprovedMinutesSpentLimit

      public void setUnimprovedMinutesSpentLimit(Long unimprovedMinutesSpentLimit)
    • getUnimprovedHoursSpentLimit

      public Long getUnimprovedHoursSpentLimit()
    • setUnimprovedHoursSpentLimit

      public void setUnimprovedHoursSpentLimit(Long unimprovedHoursSpentLimit)
    • getUnimprovedDaysSpentLimit

      public Long getUnimprovedDaysSpentLimit()
    • setUnimprovedDaysSpentLimit

      public void setUnimprovedDaysSpentLimit(Long unimprovedDaysSpentLimit)
    • getUnimprovedScoreDifferenceThreshold

      public String getUnimprovedScoreDifferenceThreshold()
    • setUnimprovedScoreDifferenceThreshold

      public void setUnimprovedScoreDifferenceThreshold(String unimprovedScoreDifferenceThreshold)
    • getBestScoreLimit

      public String getBestScoreLimit()
    • setBestScoreLimit

      public void setBestScoreLimit(String bestScoreLimit)
    • getBestScoreFeasible

      public Boolean getBestScoreFeasible()
    • setBestScoreFeasible

      public void setBestScoreFeasible(Boolean bestScoreFeasible)
    • getStepCountLimit

      public Integer getStepCountLimit()
    • setStepCountLimit

      public void setStepCountLimit(Integer stepCountLimit)
    • getUnimprovedStepCountLimit

      public Integer getUnimprovedStepCountLimit()
    • setUnimprovedStepCountLimit

      public void setUnimprovedStepCountLimit(Integer unimprovedStepCountLimit)
    • getScoreCalculationCountLimit

      public Long getScoreCalculationCountLimit()
    • setScoreCalculationCountLimit

      public void setScoreCalculationCountLimit(Long scoreCalculationCountLimit)
    • getTerminationConfigList

      public List<TerminationConfig> getTerminationConfigList()
    • setTerminationConfigList

      public void setTerminationConfigList(List<TerminationConfig> terminationConfigList)
    • withTerminationClass

      @Deprecated(forRemoval=true) public TerminationConfig withTerminationClass(Class<? extends Termination> terminationClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      A custom terminationClass is deprecated and will be removed in a future major version of OptaPlanner.
    • withTerminationCompositionStyle

      public TerminationConfig withTerminationCompositionStyle(TerminationCompositionStyle terminationCompositionStyle)
    • withSpentLimit

      public TerminationConfig withSpentLimit(Duration spentLimit)
    • withMillisecondsSpentLimit

      public TerminationConfig withMillisecondsSpentLimit(Long millisecondsSpentLimit)
    • withSecondsSpentLimit

      public TerminationConfig withSecondsSpentLimit(Long secondsSpentLimit)
    • withMinutesSpentLimit

      public TerminationConfig withMinutesSpentLimit(Long minutesSpentLimit)
    • withHoursSpentLimit

      public TerminationConfig withHoursSpentLimit(Long hoursSpentLimit)
    • withDaysSpentLimit

      public TerminationConfig withDaysSpentLimit(Long daysSpentLimit)
    • withUnimprovedSpentLimit

      public TerminationConfig withUnimprovedSpentLimit(Duration unimprovedSpentLimit)
    • withUnimprovedMillisecondsSpentLimit

      public TerminationConfig withUnimprovedMillisecondsSpentLimit(Long unimprovedMillisecondsSpentLimit)
    • withUnimprovedSecondsSpentLimit

      public TerminationConfig withUnimprovedSecondsSpentLimit(Long unimprovedSecondsSpentLimit)
    • withUnimprovedMinutesSpentLimit

      public TerminationConfig withUnimprovedMinutesSpentLimit(Long unimprovedMinutesSpentLimit)
    • withUnimprovedHoursSpentLimit

      public TerminationConfig withUnimprovedHoursSpentLimit(Long unimprovedHoursSpentLimit)
    • withUnimprovedDaysSpentLimit

      public TerminationConfig withUnimprovedDaysSpentLimit(Long unimprovedDaysSpentLimit)
    • withUnimprovedScoreDifferenceThreshold

      public TerminationConfig withUnimprovedScoreDifferenceThreshold(String unimprovedScoreDifferenceThreshold)
    • withBestScoreLimit

      public TerminationConfig withBestScoreLimit(String bestScoreLimit)
    • withBestScoreFeasible

      public TerminationConfig withBestScoreFeasible(Boolean bestScoreFeasible)
    • withStepCountLimit

      public TerminationConfig withStepCountLimit(Integer stepCountLimit)
    • withUnimprovedStepCountLimit

      public TerminationConfig withUnimprovedStepCountLimit(Integer unimprovedStepCountLimit)
    • withScoreCalculationCountLimit

      public TerminationConfig withScoreCalculationCountLimit(Long scoreCalculationCountLimit)
    • withTerminationConfigList

      public TerminationConfig withTerminationConfigList(List<TerminationConfig> terminationConfigList)
    • overwriteSpentLimit

      public void overwriteSpentLimit(Duration spentLimit)
    • calculateTimeMillisSpentLimit

      public Long calculateTimeMillisSpentLimit()
    • shortenTimeMillisSpentLimit

      public void shortenTimeMillisSpentLimit(long timeMillisSpentLimit)
    • overwriteUnimprovedSpentLimit

      public void overwriteUnimprovedSpentLimit(Duration unimprovedSpentLimit)
    • calculateUnimprovedTimeMillisSpentLimit

      public Long 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

      public TerminationConfig inherit(TerminationConfig inheritedConfig)
      Description copied from class: AbstractConfig
      Inherits each property of the inheritedConfig 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 class AbstractConfig<TerminationConfig>
      Parameters:
      inheritedConfig - never null
      Returns:
      this
    • copyConfig

      public TerminationConfig copyConfig()
      Description copied from class: AbstractConfig
      Typically implemented by constructing a new instance and calling AbstractConfig.inherit(AbstractConfig) on it.
      Specified by:
      copyConfig in class AbstractConfig<TerminationConfig>
      Returns:
      new instance
    • visitReferencedClasses

      public void visitReferencedClasses(Consumer<Class<?>> classVisitor)
      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 class AbstractConfig<TerminationConfig>
      Parameters:
      classVisitor - The visitor of classes, never null. Can accept null instances of Class.