Details

      Description

      Here's what I'd like to be able to do:

      rule "serviceConflict"
          when
              $leftProcessAssignment : MrProcessAssignment($service : service, $machine : machine, $leftId : id)
              $rightProcessAssignment : MrProcessAssignment(service == $service, machine == $machine, id > $leftId)
          then
              scoreCalculator.addToHardScore(1); // No insertLogical or accumulate of those ConstraintOccurence's needed
          undo-then
              scoreCalculator.substractFromHardScore(1);
      end
      

      And here's a more complex example where the weight isn't a static "1":

      rule "serviceLocationSpread"
          when
              $service : MrService($locationSpread : locationSpread)
              $spreadCount : Number(intValue < $locationSpread) from accumulate(
                      $location : MrLocation()
                      and exists MrProcessAssignment(service == $service, location == $location),
                  count($location)
              )
          then
              scoreCalculator.addToHardScore($locationSpread - $spreadCount.intValue());
          undo-then
              scoreCalculator.substractFromHardScore($locationSpread - $spreadCount.intValue());
              // $spreadCount should still be the same as it used to be
      end
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mark.proctor Mark Proctor
                Reporter:
                ge0ffrey Geoffrey De Smet
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: