Skip to content

Commit

Permalink
Merge pull request #219 from p-lauer/patch-7
Browse files Browse the repository at this point in the history
Updated FSCABC
  • Loading branch information
thouska authored May 28, 2019
2 parents 42007e4 + 1a70729 commit 6ca3801
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions spotpy/algorithms/fscabc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -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...')
Expand All @@ -101,10 +95,10 @@ 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
if limit == None:
self.limit = int(eb/2)
else:
self.limit = eb
self.limit = int(limit)
# Generate chaos
r = 0.25
while r == 0.25 or r == 0.5 or r == 0.75:
Expand Down

0 comments on commit 6ca3801

Please sign in to comment.