Skip to content

Commit

Permalink
fixes 3339
Browse files Browse the repository at this point in the history
The problem of reproductibility of simulations comes from the hashcode computation of the GamaPopulation (and thus of the agent's hashcode) that depended on the "host" of the population and that can be different between two simulations.
  • Loading branch information
ptaillandier committed Apr 8, 2022
1 parent 1676e41 commit 2bb1367
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -281,7 +281,13 @@ public GamaPopulation(final IMacroAgent host, final ISpecies species) {
} else {
mirrorManagement = null;
}
hashCode = Objects.hash(getSpecies(), getHost());

/*PATRICK TAILLANDIER: the problem of having the host here is that depending on the simulation the
* hashcode will be different... and this hashcode is very important for the manipultion of GamaMap
* thus, having two different hashcodes depending on the simulation makes ensure the repication of simulation
* So I remove the host for the moment.
*/
hashCode = Objects.hash(getSpecies());//, getHost());
final boolean[] result = { false, false };
species.getDescription().visitChildren(d -> {
if (d instanceof ActionDescription && !d.isBuiltIn()) {
Expand Down

0 comments on commit 2bb1367

Please sign in to comment.