你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 15:10:13 +08:00
Moved plotting of results to a separate script/module.
这个提交包含在:
@@ -132,22 +132,19 @@ def run_opt_sim(args, numbermodelruns, inputfile, usernamespace):
|
|||||||
break
|
break
|
||||||
|
|
||||||
# Stop optimisation if successive fitness values are within a percentage threshold
|
# Stop optimisation if successive fitness values are within a percentage threshold
|
||||||
if iteration > 2:
|
# if iteration > 2:
|
||||||
fitnessvaluesclose = (np.abs(fitnessvalueshist[iteration - 2] - fitnessvalueshist[iteration - 1]) / fitnessvalueshist[iteration - 1]) * 100
|
# fitnessvaluesclose = (np.abs(fitnessvalueshist[iteration - 2] - fitnessvalueshist[iteration - 1]) / fitnessvalueshist[iteration - 1]) * 100
|
||||||
fitnessvaluesthres = 0.1
|
# fitnessvaluesthres = 0.1
|
||||||
if fitnessvaluesclose < fitnessvaluesthres:
|
# if fitnessvaluesclose < fitnessvaluesthres:
|
||||||
print('\nTaguchi optimisation stopped as successive fitness values within {}%'.format(fitnessvaluesthres))
|
# print('\nTaguchi optimisation stopped as successive fitness values within {}%'.format(fitnessvaluesthres))
|
||||||
break
|
# break
|
||||||
|
|
||||||
# Save optimisation parameters history and fitness values history to file
|
# Save optimisation parameters history and fitness values history to file
|
||||||
opthistfile = inputfileparts[0] + '_hist'
|
opthistfile = inputfileparts[0] + '_hist'
|
||||||
np.savez(opthistfile, dict(optparamshist), fitnessvalueshist)
|
np.savez(opthistfile, dict(optparamshist), fitnessvalueshist=fitnessvalueshist, optparamsinit=optparamsinit)
|
||||||
|
|
||||||
print('\n{}\nTaguchi optimisation completed after {} iteration(s).\nHistory of optimal parameter values {} and of fitness values {}\n{}\n'.format(68*'*', iteration, dict(optparamshist), fitnessvalueshist, 68*'*'))
|
print('\n{}\nTaguchi optimisation completed after {} iteration(s).\nHistory of optimal parameter values {} and of fitness values {}\n{}\n'.format(68*'*', iteration, dict(optparamshist), fitnessvalueshist, 68*'*'))
|
||||||
|
|
||||||
# Plot the history of fitness values and each optimised parameter values for the optimisation
|
|
||||||
plot_optimisation_history(fitnessvalueshist, optparamshist, optparamsinit)
|
|
||||||
|
|
||||||
|
|
||||||
def taguchi_code_blocks(inputfile, taguchinamespace):
|
def taguchi_code_blocks(inputfile, taguchinamespace):
|
||||||
"""Looks for and processes a Taguchi code block (containing Python code) in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines.
|
"""Looks for and processes a Taguchi code block (containing Python code) in the input file. It will ignore any lines that are comments, i.e. begin with a double hash (##), and any blank lines.
|
||||||
|
在新工单中引用
屏蔽一个用户