对于optplanner来说,我是新手,并且尝试使用它来解决时间表问题,但是在所有设置之后,当我试图解决这个问题时,我会得到以下错误:
java.lang.IllegalStateException: The selectionList contains 2 times the same selection (c0001{t000}-0 @ null + null) and (c0001{t000}-1 @ null + null).
at org.optaplanner.core.impl.heuristic.selector.common.decorator.WeightFactorySelectionSorter.sort(WeightFactorySelectionSorter.java:58)
at org.optaplanner.core.impl.heuristic.selector.entity.decorator.SortingEntitySelector.constructCache(SortingEntitySelector.java:44)
at org.optaplanner.core.impl.heuristic.selector.common.SelectionCacheLifecycleBridge.phaseStarted(SelectionCacheLifecycleBridge.java:49)
at org.optaplanner.core.impl.phase.event.PhaseLifecycleSupport.firePhaseStarted(PhaseLifecycleSupport.java:39)
at org.optaplanner.core.impl.heuristic.selector.AbstractSelector.phaseStarted(AbstractSelector.java:47)
at org.optaplanner.core.impl.phase.event.PhaseLifecycleSupport.firePhaseStarted(PhaseLifecycleSupport.java:39)
at org.optaplanner.core.impl.heuristic.selector.AbstractSelector.phaseStarted(AbstractSelector.java:47)
at org.optaplanner.core.impl.phase.event.PhaseLifecycleSupport.firePhaseStarted(PhaseLifecycleSupport.java:39)
at org.optaplanner.core.impl.constructionheuristic.placer.AbstractEntityPlacer.phaseStarted(AbstractEntityPlacer.java:41)
at org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase.phaseStarted(DefaultConstructionHeuristicPhase.java:124)
at org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase.solve(DefaultConstructionHeuristicPhase.java:67)
at org.optaplanner.core.impl.solver.DefaultSolver.runPhases(DefaultSolver.java:214)
at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:176)以前有没有人遇到过这种情况,如果你遇到了,你能帮忙吗?
发布于 2015-09-17 07:09:51
它看起来像是dataset中的一个问题(或者是域对象的equals()方法中的问题)。
selectionList包含2倍相同的选择(c0001{t000}-0 @ null + null)和(c0001{t000}-1 @ null + null)。
它认为这两个讲座是一样的:
显然,它们是不平等的,因为它们有不同的lectureIndexInCourse。
课程继承了AbstractPersistable的“等于”方法,该方法基于id进行等式。
我敢打赌,您在dataset中的讲座要么有空id,要么有副本。
https://stackoverflow.com/questions/32614204
复制相似问题