<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt">Well,<br><br>I need to solve - let's say - a complex 2 dimensional puzzle.<br>The goal is to fill a 2D rectangle (with fixed dimensions) out of "puzzle pieces" that do not have a fixed shape.<br>A puzzle piece is built out of a number of bars of variable length and the bars can slide against each other (to some extend: differs per joint of two bars).<br><br><div><span>Just shifting and swapping around the "</span><span>puzzle pieces" is not quite well performing since that will result in many <br></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>violations although a shift or swap could match perfectly if you slide (some of) the bars of the piece at the same
 time.&nbsp;</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,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: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>Feeding all possible combinations of shifts and swaps combined with all possible forms of the pieces would result in ... well quite a lot of combinations.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>So I want to build a smarter mover that "knows" how to slide a piece in order to fit it in an available place (or swap it with an other piece to improve both pieces match).</span></div><div style="color: rgb(0, 0, 0); font-size:
 13.3333px; font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>I think the mover would perform far better if I have a "bit-map" that contains the 2D representation of the way everything is placed and which could calculate the best layout of the piece before putting it into the puzzle.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,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: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>Therefor I would like to know the last change applied so I can incrementally update the bit-map instead of recalculating it entirely every time.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier
 New,courier,monaco,monospace,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: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>Hey, hmmm... maybe I don't need to know the last accepted move. Just finding the diff between best-solution and previous best-solution might do the trick?!</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,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: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>For finding the best layout of a single piece, ?could I use a second instance of planner that does a "normal" bin-packaging of a single piece
 in the available container (container is then an available free area or the combination of one or more other pieces and the free space around that other piece)?</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,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: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>Maybe I'm going goofy on this... too many long nights are beginning to cloud my mind.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,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: Courier New,courier,monaco,monospace,sans-serif; background-color:
 transparent; font-style: normal;"><span>Well, any ideas are welcome.<br></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: Courier New,courier,monaco,monospace,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: Courier New,courier,monaco,monospace,sans-serif; background-color: transparent; font-style: normal;"><span>Regards.<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: Courier New, courier, monaco, monospace, 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@lists.jboss.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, February 21, 2013 10:37 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] Planner: Is it possible to know which move was selected on step-end?<br> </font> </div> <br>
<div id="yiv903406828">
  

    
  
  <div>
    Officially, in the public api (aka the "user facing api"), there's
    no such listener.<br>
    Why would you need this at runtime?<br>
    Open an issue: if there's a good reason to need this, we can talk
    about adding it to the public api.<br>
    &nbsp; <a rel="nofollow" class="yiv903406828moz-txt-link-freetext" target="_blank" href="https://issues.jboss.org/browse/PLANNER">https://issues.jboss.org/browse/PLANNER</a><br>
    <br>
    <br>
    That being said and handled first, the benchmarker actually hacks a
    step listener if I recall correctly:<br>
<a rel="nofollow" class="yiv903406828moz-txt-link-freetext" target="_blank" href="https://github.com/droolsjbpm/drools-planner/tree/master/drools-planner-benchmark/src/main/java/org/drools/planner/benchmark/core/statistic/calculatecount">https://github.com/droolsjbpm/drools-planner/tree/master/drools-planner-benchmark/src/main/java/org/drools/planner/benchmark/core/statistic/calculatecount</a><br>
    <br>
    <div class="yiv903406828moz-cite-prefix">Op 20-02-13 21:56, Michiel Vermandel
      schreef:<br>
    </div>
    <blockquote type="cite">
      <div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;">
        <div><span>Hi,</span></div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;"><br>
        </div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;">Is it
          possible to capture which move was selected on step-end?</div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;">I don't
          mean in the logging but by event or custom selector or... ?<br>
        </div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;"><br>
        </div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;">Thanks</div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;"><br>
        </div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;">Michiel<br>
          <span></span></div>
        <div style="color:rgb(0, 0, 0);font-size:13.3333px;font-family:Courier New, courier, monaco, monospace, sans-serif;background-color:transparent;font-style:normal;"><span></span></div>
        <div>&nbsp;</div>
        <div>-----------------<br>
          http://www.codessentials.com - Your essential software, for
          free!<br>
          Follow us at http://twitter.com/#!/Codessentials</div>
      </div>
      <br>
      <fieldset class="yiv903406828mimeAttachmentHeader"></fieldset>
      <br>
      <pre>_______________________________________________
rules-users mailing list
<a rel="nofollow" class="yiv903406828moz-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="yiv903406828moz-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> </div> </div>  </div></body></html>