Skip to content

Commit faa37a4

Browse files
committed
[Batch] Fix morris not conducted because of a false check on sample size (duplicate sample points)
1 parent 8ed7b0b commit faa37a4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

msi.gama.core/src/msi/gama/kernel/batch/exploration/morris/MorrisExploration.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,14 @@ public void explore(final IScope scope) {
190190
// The output of simulations
191191
Map<String, List<Double>> rebuilt_output = rebuildOutput(scope, res_outputs);
192192

193+
// TODO : verify if Morris sampling can lead to several identical points in the parameter space
194+
int outsize = 0;
195+
for (Map<String, List<Object>> m : res_outputs.values()) {
196+
outsize += m.values().stream().findFirst().get().size();
197+
}
198+
193199
// Prevent OutOfBounds when experiment ends before morris exploration is completed
194-
if (res_outputs.size() == MySamples.size()) {
200+
if (outsize == MySamples.size() && rebuilt_output.values().stream().findAny().get().size() == MySamples.size()) {
195201

196202
List<String> output_names = rebuilt_output.keySet().stream().toList();
197203

0 commit comments

Comments
 (0)