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

Nearby Selection with <swapMoveSelector> should not throw mimic not found exception (regression)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 6.3.0.CR2
    • 6.3.0.CR1
    • optaplanner-core
    • None
    • NEW
    • NEW

      This config

         <swapMoveSelector>
              <entitySelector id="entitySelector2"/>
              <secondaryEntitySelector>
                <nearbySelection>
                  <originEntitySelector mimicSelectorRef="entitySelector2"/>
                  <nearbyDistanceMeterClass>org.optaplanner.examples.vehiclerouting.domain.solver.nearby.CustomerNearbyDistanceMeter</nearbyDistanceMeterClass>
                  <parabolicDistributionSizeMaximum>40</parabolicDistributionSizeMaximum>
                </nearbySelection>
              </secondaryEntitySelector>
            </swapMoveSelector>
      

      leads to this exception

      Exception in thread "main" java.lang.IllegalArgumentException: The entitySelectorConfig (EntitySelectorConfig(null)) has a mimicSelectorRef (entitySelector2) for which no entitySelector with that id exists (in its solver phase).
      	at org.optaplanner.core.config.heuristic.selector.entity.EntitySelectorConfig.buildMimicReplaying(EntitySelectorConfig.java:295)
      	at org.optaplanner.core.config.heuristic.selector.entity.EntitySelectorConfig.buildEntitySelector(EntitySelectorConfig.java:243)
      	at org.optaplanner.core.config.heuristic.selector.common.nearby.NearbySelectionConfig.applyNearbyEntitySelector(NearbySelectionConfig.java:185)
      	at org.optaplanner.core.config.heuristic.selector.entity.EntitySelectorConfig.buildEntitySelector(EntitySelectorConfig.java:263)
      	at org.optaplanner.core.config.heuristic.selector.move.generic.SwapMoveSelectorConfig.buildBaseMoveSelector(SwapMoveSelectorConfig.java:84)
      	at org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig.buildMoveSelector(MoveSelectorConfig.java:193)
      	at org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig.buildMoveSelector(MoveSelectorConfig.java:182)
      	at org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig.buildBaseMoveSelector(UnionMoveSelectorConfig.java:76)
      	at org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig.buildMoveSelector(MoveSelectorConfig.java:193)
      	at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildMoveSelector(LocalSearchPhaseConfig.java:230)
      	at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildDecider(LocalSearchPhaseConfig.java:129)
      	at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildPhase(LocalSearchPhaseConfig.java:114)
      	at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildPhase(LocalSearchPhaseConfig.java:57)
      	at org.optaplanner.core.config.solver.SolverConfig.buildPhaseList(SolverConfig.java:273)
      	at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:203)
      	at org.optaplanner.core.impl.solver.XStreamXmlSolverFactory.buildSolver(XStreamXmlSolverFactory.java:142)
      	at org.optaplanner.examples.vehiclerouting.app.VehicleRoutingApp.createSolver(VehicleRoutingApp.java:53)
      	at org.optaplanner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:90)
      	at org.optaplanner.examples.common.app.CommonApp.init(CommonApp.java:77)
      	at org.optaplanner.examples.common.app.CommonApp.init(CommonApp.java:73)
      	at org.optaplanner.examples.vehiclerouting.app.VehicleRoutingApp.main(VehicleRoutingApp.java:36)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
      

              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: