Skip to content

Commit

Permalink
add params_min/max into break point pickle
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-kas committed Sep 22, 2020
1 parent 99a8f9c commit dae6c69
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions spotpy/algorithms/_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,19 @@ def read_breakdata(self, dbname):
Reason: In case of incomplete optimizations, old data can be restored. '''
import pickle
with open(dbname+'.break', 'rb') as breakfile:
work,backuptime,repos,obmin,obmax=pickle.load(breakfile)
work,backuptime,repos,obmin,obmax,pmin,pmax=pickle.load(breakfile)
self.status.starttime=self.status.starttime-backuptime
self.status.rep=repos
self.status.objectivefunction_min=obmin
self.status.objectivefunction_max=obmax
self.status.params_min=pmin
self.status.params_max=pmax
return work

def write_breakdata(self, dbname, work):
''' Write data to a pickle file if a breakpoint has been set.'''
import pickle
work=(work,self.status.last_print-self.status.starttime,self.status.rep,self.status.objectivefunction_min,self.status.objectivefunction_max)
work=(work,self.status.last_print-self.status.starttime,self.status.rep,self.status.objectivefunction_min,self.status.objectivefunction_max,self.status.params_min,self.status.params_max)
with open(str(dbname)+'.break', 'wb') as breakfile:
pickle.dump(work, breakfile)

Expand Down

0 comments on commit dae6c69

Please sign in to comment.