Skip to content

Commit

Permalink
Merge pull request #229 from bees4ever/PADDS-fix-status
Browse files Browse the repository at this point in the history
update PADDS status
  • Loading branch information
thouska authored Aug 30, 2019
2 parents b622b57 + f774baf commit 6f880ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions spotpy/algorithms/padds.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ def sample(self, repetitions, trials=1, initial_objs=np.array([]), initial_param
if self.dominance_flag != -1: # means, that new parameter set is a new non-dominated solution
self.metric = self.calc_metric(metric)
self.parameter_current = x_curr
# update the new status structure
self.status.params_max, self.status.params_min = self.parameter_current, self.parameter_current

print('Best solution found has obj function value of ' + str(self.best_value.best_obj_val) + ' at '
+ str(repitionno_best) + '\n\n')
Expand Down
4 changes: 2 additions & 2 deletions spotpy/examples/spot_setup_hymod_python_pareto.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ def evaluation(self):
return self.trueObs[366:]

def objectivefunction(self,simulation,evaluation, params=None):
return [
return np.array([
spotpy.likelihoods.gaussianLikelihoodMeasErrorOut(evaluation, simulation),
-spotpy.objectivefunctions.rmse(evaluation, simulation),
-spotpy.objectivefunctions.mse(evaluation, simulation),
-spotpy.objectivefunctions.pbias(evaluation, simulation),
spotpy.likelihoods.NashSutcliffeEfficiencyShapingFactor(evaluation, simulation),
spotpy.likelihoods.ABCBoxcarLikelihood(evaluation, simulation),
spotpy.likelihoods.LikelihoodAR1NoC(evaluation, simulation)
]
])
4 changes: 2 additions & 2 deletions spotpy/examples/tutorial_padds.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ def objectivefunction(self, simulation, evaluation, params):

spot_setup = padds_spot_setup()

#sampler = spotpy.algorithms.padds(spot_setup, dbname='padds_hymod', dbformat='csv', alt_objfun=None)
#res = sampler.sample(10000,trials=1)
sampler = spotpy.algorithms.padds(spot_setup, dbname='padds_hymod', dbformat='csv')
res = sampler.sample(10000,trials=1)
2 changes: 1 addition & 1 deletion spotpy/examples/tutorial_padds_hymod.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# Create the SCE-UA sampler of spotpy, alt_objfun is set to None to force SPOTPY
# to jump into the def objectivefunction in the spot_setup class (default is
# spotpy.objectivefunctions.rmse)
sampler=spotpy.algorithms.padds(spot_setup, dbname='padds_hymod', dbformat='csv', alt_objfun=None)
sampler=spotpy.algorithms.padds(spot_setup, dbname='padds_hymod', dbformat='csv')

#Start the sampler, one can specify ngs, kstop, peps and pcento id desired
print(sampler.sample(rep, metric="crowd_distance"))
Expand Down

0 comments on commit 6f880ad

Please sign in to comment.