我正在尝试实现FlowShop。我需要安排许多不同的工作。我的作业存在所有相同数量的操作,并且可以在某些计算机上处理这些操作。大多数只能由一台机器处理,但是存在一种操作,其中两个不同的机器可以处理它。
因此,我需要计划哪个机器处理哪个操作以及不同作业的顺序。我的第一种方法是给每个操作按顺序分配一个职位,而作业的所有操作都具有相同的职位。但是,当求解器更改某个操作的位置时,同一作业的其他操作的位置也发生了更改,而我无法解决该问题。因此,我决定添加第二个计划实体Job。相同作业的操作引用相同作业对象。但是现在我有了两个计划实体(工作和运营),而且我总是遇到一个异常,我不知道该如何处理。
Exception in thread "main" java.lang.IllegalArgumentException: The config (QueuedEntityPlacerConfig(null, null)) has no entityClass (null) configured and because there are multiple in the entityClassSet ([class ProductionPlan.domain.Operation, class ProductionPlan.domain.Task]), it can not be deduced automatically.
at org.optaplanner.core.config.AbstractConfig.deduceEntityDescriptor(AbstractConfig.java:63)
at org.optaplanner.core.config.constructionheuristic.placer.QueuedEntityPlacerConfig.buildEntitySelectorConfig(QueuedEntityPlacerConfig.java:144)
at org.optaplanner.core.config.constructionheuristic.placer.QueuedEntityPlacerConfig.buildEntityPlacer(QueuedEntityPlacerConfig.java:107)
at org.optaplanner.core.config.constructionheuristic.placer.QueuedEntityPlacerConfig.buildEntityPlacer(QueuedEntityPlacerConfig.java:42)
at org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig.buildPhase(ConstructionHeuristicPhaseConfig.java:200)
at org.optaplanner.core.config.constructionheuristic.ConstructionHeuristicPhaseConfig.buildPhase(ConstructionHeuristicPhaseConfig.java:52)
at org.optaplanner.core.config.solver.SolverConfig.buildPhaseList(SolverConfig.java:668)
at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:539)
at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildSolver(DefaultSolverFactory.java:49)
at ScheduleAppLocalSearch.main(ScheduleAppLocalSearch.java:14)
[如果有人可以帮助我,如何摆脱那个异常,我将非常高兴
添加:我现在添加了高级配置,但是异常仍然存在
<constructionHeuristic>
<entitySorterManner>NONE</entitySorterManner>
<valueSorterManner>NONE</valueSorterManner>
<queuedEntityPlacer>
<entitySelector id="TaskEntitySelector">
<cacheType>PHASE</cacheType>
<entityClass>ProductionPlan.domain.Task</entityClass>
</entitySelector>
<changeMoveSelector>
<entitySelector mimicSelectorRef="TaskEntitySelector"/>
</changeMoveSelector>
</queuedEntityPlacer>
</constructionHeuristic>
<constructionHeuristic>
<entitySorterManner>NONE</entitySorterManner>
<valueSorterManner>NONE</valueSorterManner>
<queuedEntityPlacer>
<entitySelector id="OperationEntitySelector">
<cacheType>PHASE</cacheType>
<entityClass>ProductionPlan.domain.Operation</entityClass>
</entitySelector>
<changeMoveSelector>
<entitySelector mimicSelectorRef="OperationEntitySelector"/>
</changeMoveSelector>
</queuedEntityPlacer>
</constructionHeuristic>
具有2个计划实体类别的构造启发式方法需要an advanced configuration。