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

Write projectJobSchedulingScoreRules.drl

XMLWordPrintable

      The DRL is an alternative way of calculating the score than the ProjectJobSchedulingIncrementalScoreCalculator. It's slower, but far more readable and maintainable.

      1) Finish the file projectJobSchedulingScoreRules.drl so it has all required score constraints of projectjobscheduling.
      https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-examples/src/main/resources/org/optaplanner/examples/projectjobscheduling/solver/projectJobSchedulingScoreRules.drl

      2) For a list of those score constraints, read the documentation
      http://docs.jboss.org/drools/release/latest/optaplanner-docs/html_single/index.html#projectJobScheduling
      and look at ProjectJobSchedulingIncrementalScoreCalculator.java (which is much more complex because it actually does the delta's itself)
      In the docs, read up about "incremental score calculation":
      http://docs.jboss.org/drools/release/latest/optaplanner-docs/html_single/index.html#incrementalScoreCalculation
      and
      http://docs.jboss.org/drools/release/latest/optaplanner-docs/html_single/index.html#d0e4210

      3) Use projectJobSchedulingSolverConfig.xml to verify if the DRL works properly by commenting out "<incrementalScoreCalculatorClass>" and commenting in "<scoreDrl>". Use "<assertionScoreDirectorFactory>" (see docs) to validate that it consistently gives the same score as ProjectJobSchedulingIncrementalScoreCalculator.
      Note: if you find a bug in ProjectJobSchedulingIncrementalScoreCalculator, let us know

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

              Created:
              Updated:
              Resolved: