OptaPlanner construction phase - Is there a way to define filters?

天大地大妈咪最大 提交于 2019-12-12 03:29:22

问题


In local search phase you can configure filters for entities, values and moves. You can even provide a custom move factory if you want.

However, I can't find any documentation on how to do the same in construction phase. The only configuration is a heuristic type and forager: Chapter 8. Construction heuristics

I want to implement some of my very hard rules in filters, however, without the ability to filter in construction phase I must also define them as scoring rules to avoid bad construction.

Is there a way to define filters for construction phase?


回答1:


Yes, there is (requires at least 6.0.0.CR1, but best the latest and greatest), but it's not yet documented.

Follow the rabit hole down from ConstructionHeuristicSolverPhaseConfig and QueuedEntityPlacerConfig. It's something like:

   <constructionHeuristic>
     <queuedEntityPlacer>
       <entitySelector id="a"/>
       <changeMoveSelector>
         <mimicEntitySelector refId="a"/>
         <valueSelector>
       </changeMoveSelector>
     </queuedEntityPlacer>
   </constructionHeuristic>


来源:https://stackoverflow.com/questions/19925384/optaplanner-construction-phase-is-there-a-way-to-define-filters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!