我可以设置minimalAcceptedSelection编辑SampleDroolsConfig.xml
...
<acceptor>
<solutionTabuSize>1000</solutionTabuSize>
<planningEntityTabuSize>7</planningEntityTabuSize>
</acceptor>
<forager>
<minimalAcceptedSelection>200</minimalAcceptedSelection>
</forager>
</localSearch>
</solver>
是否有可能在运行时设置此参数?
答案 0 :(得分:1)
是:
XmlSolverFactory solverFactory = new XmlSolverFactory(SOLVER_CONFIG);
LocalSearchSolverPhaseConfig localSearchSolverPhaseConfig = (LocalSearchSolverPhaseConfig) solverFactory.getSolverConfig().getSolverPhaseConfigList().get(1);
localSearchSolverPhaseConfig.getForagerConfig().setMinimalAcceptedSelection(200);
请参阅Drools Planner手册部分,了解有关按Java(而非XML)配置的信息。