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

Allow setting a global variable (for example a service) which can be used by the score rules

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Won't Do
    • Major
    • None
    • None
    • optaplanner-core
    • None

    Description

      Currently, it is not possible to set a global variable in the working memory used by the solver. If a scoring rule needs an external helper for calculating scores (e.g. a dependency injected with OSGi DS), a workaround using a static variable in some class accessible by the scoring rules is needed.

      The easiest implementation is probably a new method in the Solver interface: // Impossible
      public WorkingMemory getWorkingMemory();
      which provides access to the working memory used by the solver.
      => Impossible because the number of WorkingMemory equals the number of threads being used by Planner, and sometimes they are reset.

      Attachments

        Issue Links

          Activity

            People

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              whorre Wouter Horré (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: