Reinstated success fitness values stop criterion.

这个提交包含在:
Craig Warren
2016-05-03 15:18:25 +01:00
父节点 4828653b4e
当前提交 5a18bcab19

查看文件

@@ -132,12 +132,12 @@ def run_opt_sim(args, numbermodelruns, inputfile, usernamespace):
break
# Stop optimisation if successive fitness values are within a percentage threshold
# if iteration > 2:
# fitnessvaluesclose = (np.abs(fitnessvalueshist[iteration - 2] - fitnessvalueshist[iteration - 1]) / fitnessvalueshist[iteration - 1]) * 100
# fitnessvaluesthres = 0.1
# if fitnessvaluesclose < fitnessvaluesthres:
# print('\nTaguchi optimisation stopped as successive fitness values within {}%'.format(fitnessvaluesthres))
# break
if iteration > 2:
fitnessvaluesclose = (np.abs(fitnessvalueshist[iteration - 2] - fitnessvalueshist[iteration - 1]) / fitnessvalueshist[iteration - 1]) * 100
fitnessvaluesthres = 0.1
if fitnessvaluesclose < fitnessvaluesthres:
print('\nTaguchi optimisation stopped as successive fitness values within {}%'.format(fitnessvaluesthres))
break
# Save optimisation parameters history and fitness values history to file
opthistfile = inputfileparts[0] + '_hist.pickle'