Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-856

Inheriting termination a Termination with minutesSpentLimit on a termination with secondsSpentLimit should not sum them, but replace it

    XMLWordPrintable

Details

    • NEW
    • NEW

    Description

      The problem lies in TerminationConfig.inherit():

          @Override
          public void inherit(TerminationConfig inheritedConfig) {
              ...
              millisecondsSpentLimit = ConfigUtils.inheritOverwritableProperty(millisecondsSpentLimit,
                      inheritedConfig.getMillisecondsSpentLimit());
              secondsSpentLimit = ConfigUtils.inheritOverwritableProperty(secondsSpentLimit,
                      inheritedConfig.getSecondsSpentLimit());
              minutesSpentLimit = ConfigUtils.inheritOverwritableProperty(minutesSpentLimit,
                      inheritedConfig.getMinutesSpentLimit());
              hoursSpentLimit = ConfigUtils.inheritOverwritableProperty(hoursSpentLimit,
                      inheritedConfig.getHoursSpentLimit());
              daysSpentLimit = ConfigUtils.inheritOverwritableProperty(daysSpentLimit,
                      inheritedConfig.getDaysSpentLimit());
      
              unimprovedMillisecondsSpentLimit = ConfigUtils.inheritOverwritableProperty(unimprovedMillisecondsSpentLimit,
                      inheritedConfig.getUnimprovedMillisecondsSpentLimit());
              unimprovedSecondsSpentLimit = ConfigUtils.inheritOverwritableProperty(unimprovedSecondsSpentLimit,
                      inheritedConfig.getUnimprovedSecondsSpentLimit());
              unimprovedMinutesSpentLimit = ConfigUtils.inheritOverwritableProperty(unimprovedMinutesSpentLimit,
                      inheritedConfig.getUnimprovedMinutesSpentLimit());
              unimprovedHoursSpentLimit = ConfigUtils.inheritOverwritableProperty(unimprovedHoursSpentLimit,
                      inheritedConfig.getUnimprovedHoursSpentLimit());
              unimprovedDaysSpentLimit = ConfigUtils.inheritOverwritableProperty(unimprovedDaysSpentLimit,
                      inheritedConfig.getUnimprovedDaysSpentLimit());
              ...
          }
      

      Attachments

        Activity

          People

            rsynek@redhat.com Radovan Synek
            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: