<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>></span>With HashSet/Map, that order changes because Object.hashCode()
returns different ints, placing elements in different HashSet
buckets, which results into a different order.</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;">Does this mean that in an implementation without "Combination of Simulated Annealing with time spend
termination", maps and sets, the list of planning entities should have the same hashcodes every time? Or should they be sorted in the same order if sorted by hashcode?</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;"><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;">I have a very, very simple example, on construction phase, not a single map or set, and still sequential runs do not result in the same solution...</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;">What more can I check?</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<br></div><div> </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
<ge0ffrey.spam@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Rules Users List <rules-users@lists.jboss.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, February 12, 2013 8:16 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] planner environmentMode - no reproducibility<br> </font> </div> <br>
<div id="yiv641966407">
<div>
<br>
<div class="yiv641966407moz-cite-prefix">Op 12-02-13 20:04, 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;">Hi
Geoffrey,<br>
<br>
Thanks for your response.<br>
Indeed I use Simulated Annealing with maximumSecondsSpend. So
that explains the randomness of the LocalSearchPhase.<br>
Sorry for not remembering.<br>
<br>
Can you tell me please some more on "Use of HashSet in your
Solution class"?<br>
Do you mean a planning fact as a HashSet?<br>
</div>
</blockquote>
no, just entities and values, no worries :)<br>
<blockquote type="cite">
<div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;">I
have some HashMap fields in my Solution (which I also pass in
the cloneSolution method) but non of these fields are planning
variables/entity.<br>
</div>
</blockquote>
That's fine.<br>
<br>
The entity collection is best not a HashSet/Map, because FIRST_FIT
(as well as some entity selectors) will take the original order of
the entities to do things.<br>
With HashSet/Map, that order changes because Object.hashCode()
returns different ints, placing elements in different HashSet
buckets, which results into a different order.<br>
<blockquote type="cite">
<div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt;"><br>
Regards,<br>
Michiel<br>
<div> </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 <a rel="nofollow" class="yiv641966407moz-txt-link-rfc2396E" ymailto="mailto:ge0ffrey.spam@gmail.com" target="_blank" href="mailto:ge0ffrey.spam@gmail.com"><ge0ffrey.spam@gmail.com></a><br>
<b><span style="font-weight:bold;">To:</span></b> Rules
Users List <a rel="nofollow" class="yiv641966407moz-txt-link-rfc2396E" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="mailto:rules-users@lists.jboss.org"><rules-users@lists.jboss.org></a> <br>
<b><span style="font-weight:bold;">Sent:</span></b>
Tuesday, February 12, 2013 12:29 PM<br>
<b><span style="font-weight:bold;">Subject:</span></b>
Re: [rules-users] planner environmentMode<br>
</font> </div>
<br>
<div id="yiv641966407">
<div> Common causes:<br>
- Use of HashSet in your Solution class.<br>
- Combination of Simulated Annealing with time spend
termination (clearly documented in manual)<br>
<br>
<div class="yiv641966407moz-cite-prefix">Op 12-02-13
12:08, 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>
<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>Using
Planner 5.5.0-Final, currently my
environmentMode is set to DEBUG.</span></div>
<div>As I read here
(http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/#d0e3120)
this mode should produce a reproducible result.<br>
Though, even with o nly the construction phase
enabled, I get different results from sequential
runs on the same machine with the same code.<br>
Of course full solution (with LocalSearch) results
in different outcome too.<br>
<br>
How is this possible?<br>
<br>
Thanks<br>
<br>
<br>
</div>
<div>-----------------<br>
<a rel="nofollow" class="yiv641966407moz-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="yiv641966407moz-txt-link-freetext" target="_blank" href="http://twitter.com/#!/Codessentials">http://twitter.com/#!/Codessentials</a></div>
</div>
<br>
<fieldset class="yiv641966407mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
rules-users mailing list
<a rel="nofollow" class="yiv641966407moz-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="yiv641966407moz-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 rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
</div>
</div>
</div>
<br>
<fieldset class="yiv641966407mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
rules-users mailing list
<a rel="nofollow" class="yiv641966407moz-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="yiv641966407moz-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>