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

Planner: DroolsScoreDirector's score corruption analysis returns the wrong lacking size

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.5.0.Final
    • None
    • optaplanner-core
    • None
    • Hide
      1. Run drools planner in debug mode
      2. Produce some type of score corruption that results in a lacking constraint
      3. Review the output, for example:
       The workingMemory has 0 ConstraintOccurrence(s) lacking:
        planners should have at least one 2-slot idle sequence per day/NEGATIVE_HARD:[Day@6b3b4105[date=2012-04-26]...]=10
      Check the score rules who created those ConstraintOccurrences. Verify that each ConstraintOccurrence's causes and weight is correct.
      
      Show
      Run drools planner in debug mode Produce some type of score corruption that results in a lacking constraint Review the output, for example: The workingMemory has 0 ConstraintOccurrence(s) lacking: planners should have at least one 2-slot idle sequence per day/NEGATIVE_HARD:[Day@6b3b4105[date=2012-04-26]...]=10 Check the score rules who created those ConstraintOccurrences. Verify that each ConstraintOccurrence's causes and weight is correct.

      The scoreCorruptionAnalysis report returns the size of the excessSet when it should be returning the size of the lackingSet:

      if (!lackingSet.isEmpty()) {
          analysis.append("  The workingMemory has ").append(excessSet.size()) // this should be lackingSet.size()
                  .append(" ConstraintOccurrence(s) lacking:\n");
          int count = 0;
          for (Object o : lackingSet) {
              if (count >= CONSTRAINT_OCCURRENCE_DISPLAY_LIMIT) {
                  analysis.append("    ... ").append(lackingSet.size() - CONSTRAINT_OCCURRENCE_DISPLAY_LIMIT)
                          .append(" more\n");
                  break;
              }
              analysis.append("    ").append(o.toString()).append("\n");
              count++;
          }
      }
      

      Patch forthcoming.

            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            cedric.hurst_jira Cedric Hurst (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: