257.6. 终止

只要 solverConfig 中的规定,解决将花费很长时间。

<solver>
  ...
  <termination>
    <!-- Terminate after 10 seconds, unless it's not feasible by then yet -->
    <terminationCompositionStyle>AND</terminationCompositionStyle>
    <secondsSpentLimit>10</secondsSpentLimit>
    <bestScoreLimit>-1hard/0soft</bestScoreLimit>
  </termination>
  ...
<solver>

 

257.6.1. Samples

解决使用 OptaPlanner 的 ActiveMQ 队列上的计划问题:

from("activemq:My.Queue").
  .to("optaplanner:/org/foo/barSolverConfig.xml");

公开 OptaPlanner 作为 REST 服务:

from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
  .to("optaplanner:/org/foo/barSolverConfig.xml");