<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">Op 30-01-13 10:41, Michiel Vermandel
      schreef:<br>
    </div>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div>Hi,</div>
        <div><br>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">Is it possible to use
          caching on a custom created MoveListFactory?</div>
      </div>
    </blockquote>
    yes, use PHASE caching.<br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;"><br>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">I mean, I created a custom
          MoveListFactory and configured it like this:</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>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">            
          <moveListFactory><br>
        </div>
      </div>
    </blockquote>
    <cacheType>PHASE</><br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">                 
<moveListFactoryClass>my.planner.solver.ProjectShiftFactory</moveListFactoryClass><br>
                      </moveListFactory></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>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">I noticed that the
          createMoveList method is called upon every step.</div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">Though, if I get things
          right, in the case that the step did not result in a better
          score, the solution will not be cloned and thus (in my case)
          the <br>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">calling of the
          createMoveList in the next step will result in exactly the
          same list containing the same object instances.</div>
      </div>
    </blockquote>
    Cloning doesn't impact it either. The working solution instance
    doesn't change: it's the best solution instance that gets replaced
    by a clone, but the MoveListFactory is based on the working
    solution.<br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;"><br>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">I think it would be OK if
          the createMoveListis only called when a better score is
          reached and a cloneSolution will be executed (and thus my
          object instances get obsolete).</div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">1) I hope my theory makes
          sense end if so my question is: can I cache the list on the
          level as described?</div>
      </div>
    </blockquote>
    yes, see above<br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;"><br>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">2) One more question about
          steps: if a step does not result in a better score, what
          happens then? <br>
        </div>
      </div>
    </blockquote>
    it's still taken, as it might lead out of a local optima.<br>
    See why hill climbing is bad and tabu search isn't.<br>
 <a class="moz-txt-link-freetext" href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/index.html#d0e6264">http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/index.html#d0e6264</a><br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">- A new number of moves is
          launched up to the limit defined by minimalAcceptedSelection?</div>
      </div>
    </blockquote>
    Looking though all possible moves doesn't scale with more than 100
    entities * 100 values, so we look through a random subset of all
    moves (minimalAcceptedSelection)<br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">But what is the difference
          with the previous step?</div>
      </div>
    </blockquote>
    It always starts from a different solution: the step is always taken
    (even if it's worse - in fact Sim Ann, Late acceptance and to lesser
    degree Tabu Search heavily need this).<br>
    And it's uses a different random subset to evaluate
    (minimalAcceptedSelection).<br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">Is it the fact that a
          "different" solution with the same score will be used as
          starting point of the new step (given that one uses tabu)?<br>
        </div>
      </div>
    </blockquote>
    <br>
    You might look into all this and feel like it's black magic,
    lowering your thrust in it.<br>
    In that case, take a look at how many possible solutions your
    problem has, to put things in perspective.<br>
    Usually it is: valueSize to the power entitySize. (docs on master
    have numbers on this in the "use cases" section)<br>
    These planning problems are NP complete, which means that there's no
    software on this planet which solves them optimally and scales.<br>
    Research competitions with real-world cases (roadef, ITC2007, ...)
    clearly show that metaheuristics work best and most reliable,
    heavily outperforming all other techniques (including human
    planners).<br>
    <blockquote
      cite="mid:1359538893.17333.YahooMailNeo@web161305.mail.bf1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:arial,
        helvetica, sans-serif;font-size:10pt">
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;"><br>
        </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>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">Thanks,</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>
        </div>
        <div style="color: rgb(0, 0, 0); font-size: 13.3333px;
          font-family: arial,helvetica,sans-serif; background-color:
          transparent; font-style: normal;">Michiel</div>
        <div> </div>
        <div>-----------------<br>
          <a class="moz-txt-link-freetext" href="http://www.codessentials.com">http://www.codessentials.com</a> - Your essential software, for
          free!<br>
          Follow us at <a class="moz-txt-link-freetext" href="http://twitter.com/#!/Codessentials">http://twitter.com/#!/Codessentials</a><span
            class="tab">    </span><br>
          <span class="tab">    </span><br>
          <span class="tab">    </span><br>
          <span class="tab">    <br>
          </span></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>