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

VRP time windows: ChainedChangeMove (etc) need to be able to signal Drools that the every planning entity in the tail of the chain is potentially modified

XMLWordPrintable

      Drools has the following principle:
      "When a fact in the Drools session is changed, the session needs to be notified by a modified() call".
      In OptaPlanner, normally only the planning entities change during solving, and if they change, the Move's notify the ScoreDirector, who notifies the Drools session.

      ChainedChangeMove, ChainedSwapMove, SubchainChangeMove, etc. are special. If the anchor or even the order of a chain changes, it's possible that all the trailing entities from the point of change, implicitly change too.

      For example, VRP with time windows might hit this problem.
      If a Visit is added to the beginning of a chain (being moved from another chain), then all the trailing Visit's arrivalTime will be incremented.
      There are 2 alternatives to implement this:
      A) Arrival time is calculated on the Visit by a method (just like Visit.getVehicle())
      B) Arrival time is calculated by insertLogicals, to avoid unnecessarily disrupting incremental score calculation.

      Pro/con:
      A) requires the Change*Move's to notify drools for the entire trailing chain, which it currently doesn't
      B) doesn't, but might be a pita to write in the DRL.

      Note: because the example already uses "Visit.getVehicle()", subchain moves notify the entire subchain. This is a de-optimization if alternative B) is the recommended strategy.

      Conclusion: optaplanner-examples VRP example needs to have time windows - every user/customer that implements VRP is asking about it and they have trouble with it. It will be much easier if we can just point to the example.

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

              Created:
              Updated:
              Resolved: