From b2fc452c2f563614b18282ea91bf8a37219c987f Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 9 May 2016 14:09:04 +0100 Subject: [PATCH] Corrected check for 2 experiments that produce the same fitness value. --- gprMax/optimisation_taguchi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gprMax/optimisation_taguchi.py b/gprMax/optimisation_taguchi.py index d1f60741..646ac103 100644 --- a/gprMax/optimisation_taguchi.py +++ b/gprMax/optimisation_taguchi.py @@ -391,8 +391,8 @@ def calculate_optimal_levels(optparams, levels, levelsopt, fitnessvalues, OA, N, # Calculate optimal level from table of responses optlevel = np.where(responses == np.amax(responses))[0] - # If 2 experiments produce the same fitness value (this shouldn't happen if the fitness function is designed correctly) - if len(optlevel): + # If 2 experiments produce the same fitness value (this shouldn't happen if the fitness function is designed correctly) pick first level + if len(optlevel) > 1: optlevel = optlevel[0] levelsopt[p] = optlevel