The entity and value collections should also have the same order to enable reproducibility.>With HashSet/Map, that order changes because Object.hashCode() returns different ints, placing elements in different HashSet buckets, which results into a different order.
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?
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).
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...What more can I check?
Thanks
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
From: Geoffrey De Smet <ge0ffrey.spam@gmail.com>
To: Rules Users List <rules-users@lists.jboss.org>
Sent: Tuesday, February 12, 2013 8:16 PM
Subject: Re: [rules-users] planner environmentMode - no reproducibility
Op 12-02-13 20:04, Michiel Vermandel schreef:
no, just entities and values, no worries :)Hi Geoffrey,
Thanks for your response.
Indeed I use Simulated Annealing with maximumSecondsSpend. So that explains the randomness of the LocalSearchPhase.
Sorry for not remembering.
Can you tell me please some more on "Use of HashSet in your Solution class"?
Do you mean a planning fact as a HashSet?
That's fine.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.
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.
With HashSet/Map, that order changes because Object.hashCode() returns different ints, placing elements in different HashSet buckets, which results into a different order.
Regards,
Michiel
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
From: Geoffrey De Smet <ge0ffrey.spam@gmail.com>
To: Rules Users List <rules-users@lists.jboss.org>
Sent: Tuesday, February 12, 2013 12:29 PM
Subject: Re: [rules-users] planner environmentMode
Common causes:
- Use of HashSet in your Solution class.
- Combination of Simulated Annealing with time spend termination (clearly documented in manual)
Op 12-02-13 12:08, Michiel Vermandel schreef:
Hi,
Using Planner 5.5.0-Final, currently my environmentMode is set to DEBUG.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.
Though, even with o nly the construction phase enabled, I get different results from sequential runs on the same machine with the same code.
Of course full solution (with LocalSearch) results in different outcome too.
How is this possible?
Thanks
-----------------
http://www.codessentials.com - Your essential software, for free!
Follow us at http://twitter.com/#!/Codessentials
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users