<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 22-02-13 10:11, Michiel Vermandel
schreef:<br>
</div>
<blockquote
cite="mid:1361524273.20260.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<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. <br>
</span></div>
</div>
</blockquote>
In one implementation we added an extra "score level", a subsoft
level, to make the score function favor "defragmented" solutions
(less small gaps between items).<br>
This technique is proven to work out well. Too bad that
HardMediumSoftScore and BendableScore aren't available in
5.5.0.Final yet: just copy paste one of them from master into your
package structure.<br>
<br>
<blockquote
cite="mid:1361524273.20260.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:Courier
New, courier, monaco, monospace, sans-serif;font-size:10pt">
<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>
</blockquote>
If you create them JIT enabled, that should be fine. Either combing
existing moveSelectors with cartesianProduct, and make sure they are
all selectionOrder RANDOM,<br>
or use MoveIteratorFactory (as opposed to MoveListFactory)<br>
<blockquote
cite="mid:1361524273.20260.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:Courier
New, courier, monaco, monospace, sans-serif;font-size:10pt">
<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>
</blockquote>
<blockquote
cite="mid:1361524273.20260.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:Courier
New, courier, monaco, monospace, sans-serif;font-size:10pt">
<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>
</blockquote>
Because doing it in the ScoreDirectory all the time is annoying, I
see. Makes sense if you want to go this way.<br>
<blockquote
cite="mid:1361524273.20260.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:Courier
New, courier, monaco, monospace, sans-serif;font-size:10pt">
<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>
</blockquote>
I seriously doubt this is the right path to go.<br>
- It sounds like you're making everything far more complex than it
needs to be. Re-examen your domain model. Compare it with the
curriculum course domain model.<br>
- Trying to guide what local search actually needs to select doesn't
usually work out well. It often does more harm than good after the 1
minute of running. If you go down this path, at least give local
search multiple area's that you're focusing on.<br>
- Given the dilemma, I would strongly prefer "cartesian moves" (= a
single move that does 2 moves) over "let's see what move local
search ended up taking and try to now select a companion move in
that area". That second approach is pretty much doomed in my eyes.<br>
<blockquote
cite="mid:1361524273.20260.YahooMailNeo@web161301.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:Courier
New, courier, monaco, monospace, sans-serif;font-size:10pt">
<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> </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><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 <a class="moz-txt-link-rfc2396E" href="mailto:ge0ffrey.spam@gmail.com"><ge0ffrey.spam@gmail.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a> <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>
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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> </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></div>
</div>
<br>
<fieldset class="yiv903406828mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true"
ymailto="mailto:rules-users@lists.jboss.org"
href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a moz-do-not-send="true"
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>
<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>