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

@ConstraintConfiguration: Score parameterization built-in support: make it technically easy to switch constraint weights

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Critical Critical
    • 7.16.0.Final
    • 7.8.0.Final
    • optaplanner-core
    • None
    • 2018 Week 39-41, 2018 Week 42-44, 2018 Week 45-47, 2018 Week 48-50
    • 8
    • NEW
    • NEW

      Projects sometimes fail because only 1 stakeholder (usually a financial one) was consulted and the other stakeholders veto the project.
      The score weight parameterization pattern (as demonstrated in the examination example video) can fix this - just retweak the weights to create a win-win situation for everyone.

      However, most developers don't implement that parameterization pattern - it takes some work. We can simplify this and making it the preferred, standard route.

      Proposal

      Proposal A2) - WINNER

      public class X<L extends LevelEnum> {
      
          private PosNeg posNeg;
          private L level;
          private int weight;
      
      }
      
      // constraint Id = constraintPackage + ":" + constraintName
      @PlanningParametrization(constraintPackage = "...")
      public class MyParametrization {
      
          @PlanningParameter("Driver cost")
          private X<HardSoftLevel> driverCost = X.of(NEG, SOFT, 10);
      
          @PlanningParameter("Driver well being")
          private X<HardSoftLevel> driverWellBeing = X.of(NEG, SOFT, 10);
      
      }
      
      rule "Driver cost"
          when
              Driver(..., $wage : wage)
              ...
          then
              scoreHolder.foo($wage);
      end
      

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

                Created:
                Updated:
                Resolved: