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

Constraint Streams: solve discrepancies when selecting entities with null fields

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 8.14.0.Final
    • 8.12.0.Final
    • optaplanner-core
    • None
    • 2021 Week 40-42 (from Oct 4), 2021 Week 43-45 (from Oct 25)
    • 1
    • NEW
    • NEW

      At the moment, we have in Constraint Streams:

      • fromUnfiltered() selecting all entities and
      • from() selecting only entities with non-null variables, or entities whose variables are set to nullable.

      This leads to a situation where, when going from standard planning to over-constrained planning, users suddenly need to add null checks. Effectively, these users need to start doing the filtering on their own.

      This is a discrepancy which we want to address; over-constrained planning should not be making people change their constraints. However, from() and fromUnfiltered() are cornerstones of the CS API, and we can not change their behavior. Not in 8.x, not ever.

      Therefore, we propose the following:

      • from() and fromUnfiltered() are deprecated for removal in 9.0 at some point in the far future,
      • new methods are devised with the proper behavior, their names are TBD,
      • users are encouraged to migrate to these new methods, with explanatory Javadocs and upgrade recipe.

      (https://docs.google.com/document/d/1lGWfRBnpvevT9RNeOK392orc0804De07thN_Qglr4aQ/edit#)

      This will also allow us to do some more things in the future, such as fromUniquePairFiltered(), naming TBD.

              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: