From 2bb1367b51bf55c63d38a5d153a6829b97d01335 Mon Sep 17 00:00:00 2001 From: ptaillandier Date: Fri, 8 Apr 2022 17:49:04 +0700 Subject: [PATCH] fixes 3339 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. --- .../src/msi/gama/metamodel/population/GamaPopulation.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/msi.gama.core/src/msi/gama/metamodel/population/GamaPopulation.java b/msi.gama.core/src/msi/gama/metamodel/population/GamaPopulation.java index 30d709837b..01e6a6e755 100644 --- a/msi.gama.core/src/msi/gama/metamodel/population/GamaPopulation.java +++ b/msi.gama.core/src/msi/gama/metamodel/population/GamaPopulation.java @@ -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()) {