From 09ea814c1c257118907a98c237f2e86226cc8f83 Mon Sep 17 00:00:00 2001 From: Patrick Lauer Date: Thu, 15 Nov 2018 17:01:09 +0100 Subject: [PATCH 1/2] Update fscabc.py negativlike=True was missing in postprocessing --- spotpy/algorithms/fscabc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spotpy/algorithms/fscabc.py b/spotpy/algorithms/fscabc.py index ade4ecae..61327137 100644 --- a/spotpy/algorithms/fscabc.py +++ b/spotpy/algorithms/fscabc.py @@ -127,7 +127,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F (rep, self.parameter()['random']) for rep in range(eb)) for rep, randompar, simulations in self.repeat(param_generator): # Calculate fitness - like = self.postprocessing(rep, randompar, simulations) + like = self.postprocessing(rep, randompar, simulations, negativlike=True) c = 0 p = 0 # (fit_x,x,fit_v,v,limit,normalized fitness) @@ -163,7 +163,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F param_generator = ((rep, work[rep][3]) for rep in range(eb)) for rep, randompar, simulations in self.repeat(param_generator): # Calculate fitness - clike = self.postprocessing(icall, randompar, simulations, chains=1) + clike = self.postprocessing(icall, randompar, simulations, chains=1, negativlike=True) if clike > work[rep][0]: work[rep][1] = work[rep][3] work[rep][0] = clike @@ -209,7 +209,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F param_generator = ((rep, work[rep][3]) for rep in range(eb)) for rep, randompar, simulations in self.repeat(param_generator): # Calculate fitness - clike = self.postprocessing(icall, randompar, simulations, chains=2) + clike = self.postprocessing(icall, randompar, simulations, chains=2, negativlike=True) if clike > work[rep][0]: work[rep][1] = work[rep][3] work[rep][0] = clike @@ -229,7 +229,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F work[i][4] = 0 t, work[i][0], simulations = self.simulate( (icall, work[i][1])) - clike = self.postprocessing(icall, randompar, simulations, chains=3) + clike = self.postprocessing(icall, randompar, simulations, chains=3, negativlike=True) work[i][0] = clike icall += 1 if self.status.stop: @@ -251,4 +251,4 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F if gnrng < peps: print( 'THE POPULATION HAS CONVERGED TO A PRESPECIFIED SMALL PARAMETER SPACE') - self.final_call() \ No newline at end of file + self.final_call() From 01837ef19b71bceda87f999036d3b7c483544357 Mon Sep 17 00:00:00 2001 From: Patrick Lauer Date: Thu, 15 Nov 2018 17:03:18 +0100 Subject: [PATCH 2/2] Update abc.py --- spotpy/algorithms/abc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spotpy/algorithms/abc.py b/spotpy/algorithms/abc.py index dc7ce2a7..15065878 100644 --- a/spotpy/algorithms/abc.py +++ b/spotpy/algorithms/abc.py @@ -97,7 +97,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, ownlimit=False, li (rep, self.parameter()['random']) for rep in range(eb)) for rep, randompar, simulations in self.repeat(param_generator): # Calculate fitness - like = self.postprocessing(rep, randompar, simulations, chains = 1) + like = self.postprocessing(rep, randompar, simulations, chains = 1, negativlike=True) c = 0 p = 0 work.append([like, randompar, like, randompar, c, p]) @@ -126,7 +126,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, ownlimit=False, li param_generator = ((rep, work[rep][3]) for rep in range(eb)) for rep, randompar, simulations in self.repeat(param_generator): # Calculate fitness - clike = self.postprocessing(icall+eb, randompar, simulations, chains = 2) + clike = self.postprocessing(icall+eb, randompar, simulations, chains = 2, negativlike=True) if clike > work[rep][0]: work[rep][1] = work[rep][3] work[rep][0] = clike @@ -172,7 +172,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, ownlimit=False, li param_generator = ((rep, work[rep][3]) for rep in range(eb)) for rep, randompar, simulations in self.repeat(param_generator): # Calculate fitness - clike = self.postprocessing(icall+eb, randompar, simulations, chains = 3) + clike = self.postprocessing(icall+eb, randompar, simulations, chains = 3, negativlike=True) if clike > work[rep][0]: work[rep][1] = work[rep][3] work[rep][0] = clike @@ -190,7 +190,7 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, ownlimit=False, li work[i][4] = 0 t, work[i][0], simulations = self.simulate( (icall, work[i][1])) - clike = self.postprocessing(icall+eb, randompar, simulations, chains = 4) + clike = self.postprocessing(icall+eb, randompar, simulations, chains = 4, negativlike=True) work[i][0] = clike icall += 1 if self.status.stop: