From b5bcce0e70585c929f7d600afd972a9a1f0e81a8 Mon Sep 17 00:00:00 2001 From: Jinadelee <58844036+Jinadelee@users.noreply.github.com> Date: Tue, 1 Sep 2020 15:22:58 +1000 Subject: [PATCH] Update padds.py This will ensure new_value within the predefined min and max bounds --- spotpy/algorithms/padds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotpy/algorithms/padds.py b/spotpy/algorithms/padds.py index 2d9e7fdf..90105f33 100644 --- a/spotpy/algorithms/padds.py +++ b/spotpy/algorithms/padds.py @@ -307,7 +307,7 @@ def calculate_next_s_test(self, previous_x_curr, rep, rep_limit, r): if dvn_count == 0: # no DVs selected at random, so select ONE dec_var = np.int(np.ceil(amount_params * self.np_random.rand())) - new_value = self.dds_generator.neigh_value_mixed(previous_x_curr, r, dec_var - 1, self.min_bound[j],self.max_bound[j]) + new_value = self.dds_generator.neigh_value_mixed(previous_x_curr, r, dec_var - 1, self.min_bound[dec_var - 1],self.max_bound[dec_var - 1]) new_x_curr[dec_var - 1] = new_value # change relevant decision variable value in s_test