<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 18-02-13 13:26, Michiel Vermandel
      schreef:<br>
    </div>
    <blockquote
      cite="mid:1361190383.51652.YahooMailNeo@web161306.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><span>&gt;</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>
    </blockquote>
    The entity and value collections should also have the same order to
    enable reproducibility.<br>
    The actual hashCode is irrelevant if you replace HashSet with
    LinkedHashSet.<br>
    <br>
    The other problem fact collections can do what they like.<br>
    <br>
    <blockquote
      cite="mid:1361190383.51652.YahooMailNeo@web161306.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>
        </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>
    </blockquote>
    No idea, that should be it. All the projects I 've seen (including
    all my examples) have been able to get 100% reproducibility (if they
    don't use simulated annealing).<br>
    Bugs in your clone implementation?<br>
    Enable TRACE logging (!= TRACE environmentMode), maybe that tells
    you more.<br>
    <blockquote
      cite="mid:1361190383.51652.YahooMailNeo@web161306.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>
        </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>&nbsp;</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">&lt;ge0ffrey.spam@gmail.com&gt;</a><br>
                <b><span style="font-weight: bold;">To:</span></b> Rules
                Users List <a class="moz-txt-link-rfc2396E" href="mailto:rules-users@lists.jboss.org">&lt;rules-users@lists.jboss.org&gt;</a> <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>&nbsp;</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 moz-do-not-send="true"
                              rel="nofollow"
                              class="yiv641966407moz-txt-link-rfc2396E"
                              ymailto="mailto:ge0ffrey.spam@gmail.com"
                              target="_blank"
                              href="mailto:ge0ffrey.spam@gmail.com">&lt;ge0ffrey.spam@gmail.com&gt;</a><br>
                            <b><span style="font-weight:bold;">To:</span></b>
                            Rules Users List <a moz-do-not-send="true"
                              rel="nofollow"
                              class="yiv641966407moz-txt-link-rfc2396E"
ymailto="mailto:rules-users@lists.jboss.org" target="_blank"
                              href="mailto:rules-users@lists.jboss.org">&lt;rules-users@lists.jboss.org&gt;</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
                                  (<a class="moz-txt-link-freetext" href="http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/#d0e3120">http://docs.jboss.org/drools/release/5.5.0.Final/drools-planner-docs/html_single/#d0e3120</a>)


                                  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 moz-do-not-send="true"
                                    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
                                    moz-do-not-send="true"
                                    rel="nofollow"
                                    class="yiv641966407moz-txt-link-freetext"
                                    target="_blank"
                                    href="http://twitter.com/#%21/Codessentials">http://twitter.com/#!/Codessentials</a></div>
                              </div>
                              <br>
                              <fieldset
                                class="yiv641966407mimeAttachmentHeader"></fieldset>
                              <br>
                              <pre>_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 moz-do-not-send="true" 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 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>