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

Throw an exception if a Move or a Problem Change calls beforeVariableChanged() on a list variable

    XMLWordPrintable

Details

    • Story
    • Resolution: Unresolved
    • Major
    • None
    • None
    • optaplanner-core
    • None

    Description

      Ideally, make it impossible by making beforeVariableChanged accept BasicVariableDescriptor. This might require redesign of the variable descriptors type hierarchy. BasicVariableDescriptor is now a child of GenuineVariableDescriptor. Without changing that, it wouldn't be possible for variable listeners to change "basic" shadow variables.

      The proposal above only applies to the InnerScoreDirector, that takes a variable descriptor as one of the arguments.

      The public APIs (ScoreDirector, ProblemChangeDirector, IncrementalScoreCalculator) identify a variable using the variableName string. In this case it's only possible to detect the illegal call in runtime and throw an exception.

      Attachments

        Activity

          People

            jlocker Jiří Locker
            jlocker Jiří Locker
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: