From 84adddcfb8c4b4f712ec87e52c982e3e34de2489 Mon Sep 17 00:00:00 2001 From: Patrick Lauer Date: Mon, 27 May 2019 17:32:02 +0200 Subject: [PATCH 1/2] Updated fscabc cleanup, changed default values --- spotpy/algorithms/fscabc.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/spotpy/algorithms/fscabc.py b/spotpy/algorithms/fscabc.py index daaa2f7f..996af722 100644 --- a/spotpy/algorithms/fscabc.py +++ b/spotpy/algorithms/fscabc.py @@ -69,7 +69,7 @@ def mutate(self, r): return x - def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=False, limit=24): + def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=4, limit=None): """ Parameters ---------- @@ -83,14 +83,8 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F convergence criterion kpow: float exponent for power scaling method - ownlimit: boolean - determines if an userdefined limit is set or not limit: int sets the limit for scout bee phase - breakpoint: None, 'write', 'read' or 'readandwrite' - None does nothing, 'write' writes a breakpoint for restart as specified in backup_every_rep, 'read' reads a breakpoint file with dbname + '.break', 'readandwrite' does both - backup_every_rep: int - writes a breakpoint after every generation, if more at least the specified number of samples are carried out after writing the last breakpoint """ self.set_repetiton(repetitions) print('Starting the FSCABC algotrithm with '+str(repetitions)+ ' repetitions...') @@ -101,10 +95,8 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=5, ownlimit=F self.nopt = randompar.size random.seed() lastbackup=0 - if ownlimit == True: - self.limit = limit - else: - self.limit = eb + if limit == None: + self.limit = int(eb/2) # Generate chaos r = 0.25 while r == 0.25 or r == 0.5 or r == 0.75: From 1a70729172f18b7a62dc88a797b116438fd4a113 Mon Sep 17 00:00:00 2001 From: Patrick Lauer Date: Mon, 27 May 2019 17:34:39 +0200 Subject: [PATCH 2/2] Updated fscabc --- spotpy/algorithms/fscabc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spotpy/algorithms/fscabc.py b/spotpy/algorithms/fscabc.py index 996af722..1538f760 100644 --- a/spotpy/algorithms/fscabc.py +++ b/spotpy/algorithms/fscabc.py @@ -97,6 +97,8 @@ def sample(self, repetitions, eb=48, a=(1 / 10), peps=0.0001, kpow=4, limit=None lastbackup=0 if limit == None: self.limit = int(eb/2) + else: + self.limit = int(limit) # Generate chaos r = 0.25 while r == 0.25 or r == 0.5 or r == 0.75: