Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated FSCABC #219

Merged
merged 2 commits into from
May 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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