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

NonUniqueNotificationVariableListener to forgo unique notification requirement in favor of performance gain

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Critical Critical
    • 7.0.0.Beta2
    • 6.3.0.Final
    • optaplanner-core
    • None
    • NEW
    • NEW

      There is a guarantee that the every notification to a VariableListener is unique. For example beforeVarChange(Paris) won't be called twice in the same move. This is interesting for when a shadow variable depends on 2 planning variable or for certain (custom) moves that might change the same entity twice (not applicable to CompositeMove).

      That uniqueness guarantee can be costly, for example in VRPTW for reversing chain moves. A VariableListener can be implemented to gracefully ignore non-unique notifications (without having to keep a Set), by simply doing nothing if the shadow variable is already in the deterministic state. If the VariableListener implements a new tagging interface, then VariableListenerNotifiable can use a List instead of a Set for the notificationQueue.

      (Based by Jiri's feedback)

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

                Created:
                Updated:
                Resolved: