<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt">Hi,<br><br>https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/Drools%20jBPM/view/Master/job/drools-planner/lastSuccessfulBuild/artifact/drools-planner-docs/target/docbook/publish/en-US/html_single/index.html#d0e5069<br>=&gt; "Computer says no" ;-)<br><br>I'm still running unit tests with very little entities / variables. That is then probably the cause.<br><div><br></div><div>First I thought it was because I wrote my own move factory, but after reverting to the default classes, it remained the same.</div><div>So, I do want to use a custom move factory; in that case would it be wise to change to "Cached shuffled selection" (because all moves are already cached because of my custom factory (without iterator - for the moment))?</div><div>Or would the benefit still be minimal?<br><span></span></div><div style="color: rgb(0, 0, 0); font-size:
 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Thanks</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span>Michiel<br></span></div><div>&nbsp;</div><div>-----------------<br>http://www.codessentials.com - Your essential software, for free!<br>Follow us at http://twitter.com/#!/Codessentials<br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif;
 font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Geoffrey De Smet &lt;ge0ffrey.spam@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Rules Users List &lt;rules-users@lists.jboss.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, January 25, 2013 2:47 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Planner: duplicate moves within a single step?<br> </font> </div> <br>
<div id="yiv735977214">
  

    
  
  <div>
    <br>
    <div class="yiv735977214moz-cite-prefix">Op 25-01-13 14:26, Michiel Vermandel
      schreef:<br>
    </div>
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:arial, helvetica, sans-serif;font-size:10pt;"><span><span style="
color:rgb(255, 0, 0);"><span style="color:rgb(0, 0, 0);"><span>Hi,</span></span><span style="font-weight:bold;"><br>
              <br>
            </span><span style="color:rgb(0, 0, 0);"><span>I noticed
                something really strange in my trace logging: certain
                moves are made multiple times, even consecutive.<br>
                How is this possible?<br>
                I am using Planner 5.5.0.Final and no custom move
                factories (see config below).<br>
                <br>
              </span></span><span style="font-weight:bold;"><br>
              TRACE: [2013-01-25 14:12:28,309] main
              org.drools.planner.core.localsearch.decider.DefaultDecider
              -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (12), score (-515hard/0soft),
              accepted (true) for move ({T= Inspect B747-AX1.I#1
              [7-&gt;7] Jesse IV} =&gt; (P4) ).</span></span><br>
          TRACE: [2013-01-25 14:12:28,309] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ignoring not doable move ({T= Inspect A380-TR1.I#0
          [5-&gt;6] Kristof IV} =&gt; IV).<br>
          TRACE: [2013-01-25 14:12:28,310] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (14), score (-2090hard/0soft), accepted
          (true) for move ({T= Inspect A380-TR1.I#1 [5-&gt;6] Gerald IV}
          =&gt; (P9) ).<br>
          TRACE: [2013-01-25 14:12:28,310] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ignoring not doable move ({T= Inspect A320-CZ4.I#0
          [7-&gt;9] Kristof IV} =&gt; IV).<br>
          TRACE: [2013-01-25 14:12:28,310] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ignoring not doable move ({T= Inspect A380-TR1.I#1
          [5-&gt;6] Gerald IV} =&gt; IV).<br>
          TRACE: [2013-01-25 14:12:28,311] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (17), score (-230hard/0soft), accepted
          (true) for move ({T= Inspect B747-AX1.I#1 [7-&gt;7] Jesse IV}
          =&gt; Andy).<br>
          <span style="color:rgb(0, 0, 255);"><span style="
font-weight:bold;">TRACE: [2013-01-25 14:12:28,312] main
              org.drools.planner.core.localsearch.decider.DefaultDecider
              -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (18), score (-120hard/0soft),
              accepted (true) for move ({T= Inspect B747-AX1.I#0
              [5-&gt;5] Andy IV} =&gt; (P7) ).<br>
              TRACE: [2013-01-25 14:12:28,313] main
              org.drools.planner.core.localsearch.decider.DefaultDecider
              -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (19), score (-120hard/0soft),
              accepted (true) for move ({T= Inspect B747-AX1.I#0
              [5-&gt;5] Andy IV} =&gt; (P7) ).</span></span><br>
        </span></div>
    </blockquote>
    "Just in time random selection" could explain this behavior. Read
    this section:<br>
    &nbsp;
<a rel="nofollow" class="yiv735977214moz-txt-link-freetext" target="_blank" href="https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/Drools%20jBPM/view/Master/job/drools-planner/lastSuccessfulBuild/artifact/drools-planner-docs/target/docbook/publish/en-US/html_single/index.html#d0e5069">https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/Drools%20jBPM/view/Master/job/drools-planner/lastSuccessfulBuild/artifact/drools-planner-docs/target/docbook/publish/en-US/html_single/index.html#d0e5069</a><br>
    <br>
    "selectionOrder RANDOM (default): Select the selections (<code class="yiv735977214literal">Move</code>s, entities, values, ...) in
    non-shuffled random order. <b>A selection might be selected
      multiple times</b>. This scales up well in performance because it
    does not require caching."<br>
    <br>
    It's very unlikely that this happens, except for toy problems. How
    many entities and variables does this dataset have?<br>
    <br>
    Switch to "Cached shuffled selection" to avoid it. Read those docs
    to understand the trade-off.<br>
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:arial, helvetica, sans-serif;font-size:10pt;"><span>TRACE: [2013-01-25
          14:12:28,313] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (20), score (-30hard/0soft), accepted
          (true) for move ({T= Inspect B747-AX1.I#1 [7-&gt;7] Jesse IV}
          =&gt; TL).<br>
          TRACE: [2013-01-25 14:12:28,315] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (21), score (-2180hard/0soft), accepted
          (true) for move ({T= Inspect B747-AX1.I#0 [5-&gt;5] Andy IV}
          =&gt; (P1) ).<br>
          <span style="color:rgb(255, 0, 0);"><span style="
font-weight:bold;">TRACE: [2013-01-25 14:12:28,316] main
              org.drools.planner.core.localsearch.decider.DefaultDecider
              -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (22), score (-515hard/0soft),
              accepted (true) for move ({T= Inspect B747-AX1.I#1
              [7-&gt;7] Jesse IV} =&gt; (P4) ).<br>
              TRACE: [2013-01-25 14:12:28,317] main
              org.drools.planner.core.localsearch.decider.DefaultDecider
              -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (23), score (-515hard/0soft),
              accepted (true) for move ({T= Inspect B747-AX1.I#1
              [7-&gt;7] Jesse IV} =&gt; (P4) ).</span></span><br>
          TRACE: [2013-01-25 14:12:28,318] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (24), score (-3180hard/0soft), accepted
          (true) for move ({T= Inspect A320-CZ4.I#1 [7-&gt;8] Andy IV}
          =&gt; (P1) ).<br>
          TRACE: [2013-01-25 14:12:28,318] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ignoring not doable move ({T= Inspect B747-AX1.I#1
          [7-&gt;7] Jesse IV} =&gt; IV).<br>
          TRACE: [2013-01-25 14:12:28,320] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (26), score (-120hard/0soft), accepted
          (true) for move ({T= Inspect B747-AX1.I#1 [7-&gt;7] Jesse IV}
          =&gt; (P5) ).<br>
          TRACE: [2013-01-25 14:12:28,322] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (27), score (-45hard/0soft), accepted
          (true) for move ({T= Inspect B747-AX1.I#1 [7-&gt;7] Jesse IV}
          =&gt; (P8) ).<br>
          TRACE: [2013-01-25 14:12:28,323] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (28), score (-30hard/0soft), accepted
          (true) for move ({T= Inspect A380-TR1.I#0 [5-&gt;6] Kristof
          IV} =&gt; TL).<br>
          TRACE: [2013-01-25 14:12:28,324] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (29), score (-2635hard/0soft), accepted
          (true) for move ({T= Inspect A320-CZ4.I#1 [7-&gt;8] Andy IV}
          =&gt; (P2) ).<br>
          TRACE: [2013-01-25 14:12:28,325] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (30), score (-650hard/0soft), accepted
          (true) for move ({T= Inspect A320-CZ4.I#0 [7-&gt;9] Kristof
          IV} =&gt; (P6) ).<br>
          TRACE: [2013-01-25 14:12:28,334] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ignoring not doable move ({T= Inspect A380-TR1.I#2
          [5-&gt;6] Jesse IV} =&gt; Jesse).<br>
          TRACE: [2013-01-25 14:12:28,335] main
          org.drools.planner.core.localsearch.decider.DefaultDecider
          -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (32), score (-230hard/0soft), accepted
          (true) for move ({T= Inspect B747-AX1.I#0 [5-&gt;5] Andy IV}
          =&gt; Gerald).<br>
          <span style="color:rgb(255, 0, 0);"><span style="
font-weight:bold;">TRACE: [2013-01-25 14:12:28,336] main
              org.drools.planner.core.localsearch.decider.DefaultDecider
              -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Move index (33), score (-515hard/0soft),
              accepted (true) for move ({T= Inspect B747-AX1.I#1
              [7-&gt;7] Jesse IV} =&gt; (P4) ).</span></span></span><span style="color:rgb(255, 0, 0);"><span style="
font-weight:bold;"><span></span></span></span><span style="
font-weight:bold;"><br>
        </span>
        <div>&nbsp;<br>
          Config:<br>
          <br>
          &lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
          &lt;solver&gt;<br>
          &nbsp;&nbsp;&nbsp; &lt;environmentMode&gt;DEBUG&lt;/environmentMode&gt;<br>
          <br>
          &nbsp;&nbsp;&nbsp; &lt;!-- Domain model configuration --&gt;<br>
          &nbsp;&nbsp;&nbsp;
&lt;solutionClass&gt;be.axi.planner.app.InspectionSchedule&lt;/solutionClass&gt;<br>
          &nbsp;&nbsp;&nbsp;
&lt;planningEntityClass&gt;be.axi.planner.domain.Task&lt;/planningEntityClass&gt;<br>
          <br>
          &nbsp;&nbsp;&nbsp; &lt;!-- Score configuration --&gt;<br>
          &nbsp;&nbsp;&nbsp; &lt;scoreDirectorFactory&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          &lt;scoreDefinitionType&gt;HARD_AND_SOFT&lt;/scoreDefinitionType&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;scoreDrl&gt;/inspectionRules.drl&lt;/scoreDrl&gt;<br>
          &nbsp;&nbsp;&nbsp; &lt;/scoreDirectorFactory&gt;<br>
          &nbsp;&nbsp;&nbsp; <br>
          &nbsp;&nbsp;&nbsp; &lt;constructionHeuristic&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;constructionHeuristicType&gt;BEST_FIT_DECREASING&lt;/constructionHeuristicType&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;constructionHeuristicPickEarlyType&gt;FIRST_LAST_STEP_SCORE_EQUAL_OR_IMPROVING&lt;/constructionHeuristicPickEarlyType&gt;<br>
          &nbsp;&nbsp;&nbsp; &lt;/constructionHeuristic&gt;<br>
          &nbsp;&nbsp;&nbsp; <br>
          &nbsp;&nbsp;&nbsp; &lt;!--customSolverPhase&gt;<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;customSolverPhaseCommandClass&gt;be.axi.planner.solution.SolutionInitializer&lt;/customSolverPhaseCommandClass&gt;<br>
          &nbsp;&nbsp;&nbsp; &lt;/customSolverPhase--&gt;<br>
          &nbsp;&nbsp;&nbsp;&nbsp; <br>
          &nbsp;&nbsp;&nbsp; &lt;localSearch&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;termination&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;terminationCompositionStyle&gt;OR&lt;/terminationCompositionStyle&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          &lt;maximumSecondsSpend&gt;3600&lt;/maximumSecondsSpend&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          &lt;scoreAttained&gt;0hard/0soft&lt;/scoreAttained&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/termination&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;unionMoveSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;changeMoveSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;valueSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          &lt;planningVariableName&gt;type&lt;/planningVariableName&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/valueSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/changeMoveSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;changeMoveSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;valueSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          &lt;planningVariableName&gt;spector&lt;/planningVariableName&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/valueSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/changeMoveSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;changeMoveSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;valueSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
          &lt;planningVariableName&gt;period&lt;/planningVariableName&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/valueSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/changeMoveSelector&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/unionMoveSelector&gt;<br>
          <br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;acceptor&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &lt;planningEntityTabuSize&gt;7&lt;/planningEntityTabuSize&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/acceptor&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;forager&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          &lt;minimalAcceptedSelection&gt;1000&lt;/minimalAcceptedSelection&gt;<br>
          &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/forager&gt;<br>
          &nbsp;&nbsp;&nbsp; &lt;/localSearch&gt;<br>
          &lt;/solver&gt;<br>
          <br>
          Thanks,<br>
          <br>
          Michiel<br>
        </div>
        <div>-----------------<br>
          <a rel="nofollow" class="yiv735977214moz-txt-link-freetext" target="_blank" href="http://www.codessentials.com/">http://www.codessentials.com</a> - Your essential software, for
          free!<br>
          Follow us at <a rel="nofollow" class="yiv735977214moz-txt-link-freetext" target="_blank" href="http://twitter.com/#!/Codessentials">http://twitter.com/#!/Codessentials</a></div>
      </div>
      <br>
      <fieldset class="yiv735977214mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
rules-users mailing list
<a rel="nofollow" class="yiv735977214moz-txt-link-abbreviated" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a rel="nofollow" class="yiv735977214moz-txt-link-freetext" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </div>

</div><br>_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br><br> </div> </div>  </div></body></html>