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

2 shadow vars updated by the same variable listener should not require 2 variable listener instances

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Critical Critical
    • 6.3.0.CR1
    • None
    • optaplanner-core
    • None

      OLD:

      @PEntity class MyEntity {
      
          @Variable(listeners = FireToLavaAndSmoke, FireAndWaterToSteam)
          Fire fire; // genuine variable
          @Variable(listeners = FireAndWaterToSteam)
          Water water; // genuine variable
      
          Lava lava; // shadow variable depends on fire
          Smoke smoke; // shadow variable depends on fire
      
          Steam steam; // shadow variable depends on fire and water
      }
      

      NEW:

      @PEntity class MyEntity {
      
          @Variable
          Fire fire; // genuine variable
          @Variable
          Water water; // genuine variable
      
          @CustomShadowVariable(source = {fire}, listener = FireToLavaAndSmoke) // Workaround: also affects smoke
          Lava lava; // shadow variable depends on fire
          @CustomShadowVariable(source = {fire}, listener = FireToLavaAndSmoke) // Workaround: make this a dummy
          Smoke smoke; // shadow variable depends on fire
      
          @CustomShadowVariable(source = {fire, water}, listener = FireAndWaterToSteam)
          Steam steam; // shadow variable depends on fire and water
      }
      

      ISSUE: listener FireToLavaAndSmoke of lava and smoke need to the same instance!

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

                Created:
                Updated:
                Resolved: