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

ConstraintStreams: ScoreImpacter's matchScoreConsumer got bolted on

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • None
    • None
    • optaplanner-core
    • None
    • NEW
    • NEW

    Description

      ...ore/src/main/java/org/optaplanner/core/impl/score/buildin/bendable/BendableScoreInliner.java

                          if (constraintMatchEnabled) {
                              matchScoreConsumer.accept(BendableScore.ofHard(hardScores.length, softScores.length, level, hardImpact));
                          }
                          return () -> this.hardScores[level] -= hardImpact;
      

      This last statement is hard to read.

      My main concern is that constraint match totals got bolted on, causing the ScoreImpacter to have a matchScoreConsumer - this had a noticeable performance impact even when constraint matches are disabled. I suspect much of this code will change when I take a second stab at it. Right now, the behaviour is correct - but it's too complex, it needs to be simplified.

      Attachments

        Issue Links

          Activity

            People

              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: