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

Reusing distance matrix can cause index out of bounds if two nearby selectors have different distributionSizeMaximum

    XMLWordPrintable

Details

    • 2023 Week 12-14 (from Mar 20)
    • 5
    • NEW
    • NEW

    Description

      Reproducer: https://github.com/yurloc/optaplanner/tree/planner-2916.

      Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 5
      	at org.optaplanner.core.impl.heuristic.selector.common.nearby.NearbyDistanceMatrix.getDestination(NearbyDistanceMatrix.java:80)
      	at org.optaplanner.core.impl.heuristic.selector.value.nearby.NearEntityNearbyValueSelector$RandomEntityNearbyValueIterator.next(NearEntityNearbyValueSelector.java:233)
      	at org.optaplanner.core.impl.heuristic.selector.common.iterator.AbstractRandomChangeIterator.createUpcomingSelection(AbstractRandomChangeIterator.java:56)
      	at org.optaplanner.core.impl.heuristic.selector.common.iterator.AbstractRandomChangeIterator.createUpcomingSelection(AbstractRandomChangeIterator.java:9)
      	at org.optaplanner.core.impl.heuristic.selector.common.iterator.UpcomingSelectionIterator.hasNext(UpcomingSelectionIterator.java:27)
      

       

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: