Получение исключения при использовании nearSelection в VRPTW в optaplanner

Я видел блог о масштабировании VRPTW для более чем 1000 местоположений с помощью выбора поблизости. Я попытался реализовать это, вот xml, который я написал:

<unionMoveSelector>
            <changeMoveSelector>
                <entitySelector id="entitySelector1">
                    <entityClass>vehiclerouting.domain.Customer</entityClass>
                </entitySelector>
                <valueSelector variableName="previousStandstill">
                    <nearbySelection>
                        <originEntitySelector mimicSelectorRef="entitySelector1"/>
                        <nearbyDistanceMeterClass>vehiclerouting.domain.solver.nearby.CustomerNearbyDistanceMeter</nearbyDistanceMeterClass>
                        `<nearbySelectionDistributionType>PARABOLIC_DISTRIBUTION</nearbySelectionDistributionType>
                    </nearbySelection>
                </valueSelector>
            </changeMoveSelector>
            <swapMoveSelector>
                <entitySelector id="entitySelector2">
                    <entityClass>vehiclerouting.domain.Customer</entityClass>
                </entitySelector>
               <secondaryEntitySelector>
                    <entityClass>vehiclerouting.domain.Customer</entityClass>
                    <nearbySelection>
                        <originEntitySelector mimicSelectorRef="entitySelector2"/>
                        <nearbyDistanceMeterClass>vehiclerouting.domain.solver.nearby.CustomerNearbyDistanceMeter</nearbyDistanceMeterClass>
                        <nearbySelectionDistributionType>PARABOLIC_DISTRIBUTION</nearbySelectionDistributionType>
                    </nearbySelection>
                </secondaryEntitySelector>
            </swapMoveSelector>
        </unionMoveSelector>

Вот исключение, которое я получаю (при работе с 154 клиентами):

2017/09/12 12:15:00.538 [SimpleAsyncTaskExecutor-1] [DEBUG] org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase -     CH step (153), time spent (6850), score (-70002hard/-57992000soft), selected move count (156), picked move (161581 {null -> 161582}).
2017/09/12 12:15:00.547 [SimpleAsyncTaskExecutor-1] [INFO] org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase - Construction Heuristic phase (0) ended: time spent (6859), best score (-70002hard/-57992000soft), score calculation speed (1842/sec), step total (154).
2017/09/12 12:15:00.599 [SimpleAsyncTaskExecutor-1] [DEBUG] org.drools.core.common.DefaultAgenda - State was INACTIVE is now DISPOSED
2017/09/12 12:15:00.603 [SimpleAsyncTaskExecutor-1] [DEBUG] org.drools.core.common.DefaultAgenda - State was INACTIVE is now FIRING_ALL_RULES
2017/09/12 12:15:00.607 [SimpleAsyncTaskExecutor-1] [DEBUG] org.drools.core.common.DefaultAgenda - State was FIRING_ALL_RULES is now HALTING
2017/09/12 12:15:00.607 [SimpleAsyncTaskExecutor-1] [DEBUG] org.drools.core.common.DefaultAgenda - State was HALTING is now INACTIVE
2017/09/12 12:15:00.641 [SimpleAsyncTaskExecutor-1] [DEBUG] mobi.fareye.module.rabbitmq.AutoRoutingListener - Exception : 
java.lang.NegativeArraySizeException: null
    at org.optaplanner.core.impl.heuristic.selector.common.nearby.NearbyDistanceMatrix.addAllDestinations(NearbyDistanceMatrix.java:35) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.heuristic.selector.entity.nearby.NearEntityNearbyEntitySelector.phaseStarted(NearEntityNearbyEntitySelector.java:96) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.phase.event.PhaseLifecycleSupport.firePhaseStarted(PhaseLifecycleSupport.java:37) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.heuristic.selector.AbstractSelector.phaseStarted(AbstractSelector.java:49) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.phase.event.PhaseLifecycleSupport.firePhaseStarted(PhaseLifecycleSupport.java:37) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.heuristic.selector.AbstractSelector.phaseStarted(AbstractSelector.java:49) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.heuristic.selector.move.decorator.FilteringMoveSelector.phaseStarted(FilteringMoveSelector.java:51) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.phase.event.PhaseLifecycleSupport.firePhaseStarted(PhaseLifecycleSupport.java:37) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.heuristic.selector.AbstractSelector.phaseStarted(AbstractSelector.java:49) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.localsearch.decider.LocalSearchDecider.phaseStarted(LocalSearchDecider.java:95) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.phaseStarted(DefaultLocalSearchPhase.java:115) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.localsearch.DefaultLocalSearchPhase.solve(DefaultLocalSearchPhase.java:64) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]
    at org.optaplanner.core.impl.solver.AbstractSolver.runPhases(AbstractSolver.java:87) ~[optaplanner-core-7.2.0.Final.jar:7.2.0.Final]

Я думаю, что могу ошибаться в конфигурации xml. Спасибо за помощь.


person Rahul kumar    schedule 12.09.2017    source источник
comment
Попробуйте поставить точку останова на этой строке и выяснить, почему значение destinationSize отрицательное. Отрицательный ли childSize или totalSizeMaximum?   -  person Geoffrey De Smet    schedule 12.09.2017
comment
@GeoffreyDeSmet - Это происходит из-за отрицательного значения totalSizeMaximum: if (destinationSize > overallSizeMaximum) { destinationSize = overallSizeMaximum; }   -  person Rahul kumar    schedule 12.09.2017
comment
Можете ли вы создать jira с помощью репродуктора?   -  person Geoffrey De Smet    schedule 12.09.2017
comment
@GeoffreyDeSmet -Ладно, буду. На данный момент есть какое-то временное исправление, чтобы я мог использовать близлежащий выбор.   -  person Rahul kumar    schedule 12.09.2017
comment
Еще одна вещь. Это не работает, только если я использую: <nearbySelectionDistributionType>PARABOLIC_DISTRIBUTION</nearbySelectionDistributionType>   -  person Rahul kumar    schedule 12.09.2017
comment
вы можете связать эту jira здесь?   -  person Geoffrey De Smet    schedule 24.01.2018


Ответы (1)


Это невозможно, потому что есть sizeMaximum, по крайней мере, 1 проверка, на востоке в 7.7.0.Final и более поздних (а также в нескольких версиях раньше).

person Geoffrey De Smet    schedule 03.04.2018
comment
Я также столкнулся с этой проблемой и, соответственно, поднял ошибку issues.jboss.org/browse/PLANNER-1225 < / а> - person Woodz; 19.08.2018