Skip to content

Commit

Permalink
Update padds.py
Browse files Browse the repository at this point in the history
This will ensure new_value within the predefined min and max bounds
  • Loading branch information
Jinadelee authored Sep 1, 2020
1 parent 3dab429 commit b5bcce0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spotpy/algorithms/padds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b5bcce0

Please sign in to comment.