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

Build out the ScoreManager API

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 8.0.0.Beta1
    • None
    • optaplanner-core
    • None

      During deprecation review, we stumbled upon the ScoreManager API, which is underdeveloped and it lacks functionality, causing users to go to the (private) ScoreDirector.

      This is the minutes from that meeting, to give hints of what we may want to accomplish here:

      ScoreDirector methods that PFC and custom moves need:

      • getWorkingSolution()
      • before/after*
      • trigger*
      • lookup*

      ScoreDirector methods that we don't like to see in a public API:

      • setWorkingSolution()
      • close()/dispose()
      • explainScore()
      • calculateScore()
      • isConstraintMatchEnabled()
      • getConstraintMatchTotals() + getConstraintMatchTotalMap()
        • ConstraintMatchTotal is public API, and it is externally mutable.
        • It is also Comparable (packageName + constraintName).
      • getIndictmentMap()

      But users still need access to these! Therefore, deprecate + move to ScoreManager:

      • explainScore()
      • calculateScore()
      • getIndictmentMap()

      Solver#addProblemFactChanges

      • PFC is in impl package, depends on ScoreDirector
      • We want to promote PFC to API.

      If ScoreDirector gets rid of all the harmful methods, both PFC and ScoreDirector can become public API, closing one of the biggest leaks of internal classes.

            lpetrovi@redhat.com Lukáš Petrovický (Inactive)
            lpetrovi@redhat.com Lukáš Petrovický (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: