你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 12:36:51 +08:00
Formatting tweaks.
这个提交包含在:
@@ -113,6 +113,7 @@ def run_main(args):
|
||||
# Process for benchmarking simulation
|
||||
elif args.benchmark:
|
||||
run_benchmark_sim(args, inputfile, usernamespace)
|
||||
print('\nSimulation completed.\n{}\n'.format('-' * get_terminal_size()[0]))
|
||||
|
||||
# Process for standard simulation
|
||||
else:
|
||||
@@ -443,8 +444,7 @@ def run_model(args, modelrun, numbermodelruns, inputfile, usernamespace):
|
||||
outputfile = inputfileparts[0] + '.out'
|
||||
else:
|
||||
outputfile = inputfileparts[0] + str(modelrun) + '.out'
|
||||
sys.stdout.write('\nOutput to file: {}\n'.format(outputfile))
|
||||
sys.stdout.flush()
|
||||
print('\nOutput to file: {}\n'.format(outputfile))
|
||||
|
||||
####################################
|
||||
# Start - Main FDTD calculations #
|
||||
|
@@ -16,10 +16,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with gprMax. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from collections import OrderedDict
|
||||
import importlib
|
||||
import os
|
||||
import pickle
|
||||
from collections import OrderedDict
|
||||
from shutil import get_terminal_size
|
||||
|
||||
import numpy as np
|
||||
|
||||
@@ -68,7 +69,7 @@ def run_opt_sim(args, numbermodelruns, inputfile, usernamespace):
|
||||
|
||||
# Select OA
|
||||
OA, N, cols, k, s, t = construct_OA(optparams)
|
||||
print('\n{}\nTaguchi optimisation...\n'.format(68 * '*'))
|
||||
print('\n{}\nTaguchi optimisation...\n'.format('-' * get_terminal_size()[0]))
|
||||
print('\tOrthogonal array: {:g} experiments per iteration, {:g} parameters ({:g} will be used), {:g} levels, and strength {:g}'.format(N, cols, k, s, t))
|
||||
tmp = [(k, v) for k, v in optparams.items()]
|
||||
print('\tParameters to optimise with ranges: {}'.format(str(tmp).strip('[]')))
|
||||
@@ -131,7 +132,7 @@ def run_opt_sim(args, numbermodelruns, inputfile, usernamespace):
|
||||
# Rename confirmation experiment output file so that it is retained for each iteraction
|
||||
os.rename(outputfile, os.path.splitext(outputfile)[0] + '_final' + str(iteration + 1) + '.out')
|
||||
|
||||
print('\nTaguchi optimisation, iteration {} completed. History of optimal parameter values {} and of fitness values {}'.format(iteration + 1, dict(optparamshist), fitnessvalueshist, 68 * '*'))
|
||||
print('\nTaguchi optimisation, iteration {} completed. History of optimal parameter values {} and of fitness values {}'.format(iteration + 1, dict(optparamshist), fitnessvalueshist, '-' * get_terminal_size()[0]))
|
||||
iteration += 1
|
||||
|
||||
# Stop optimisation if stopping criterion has been reached
|
||||
@@ -154,7 +155,7 @@ def run_opt_sim(args, numbermodelruns, inputfile, usernamespace):
|
||||
pickle.dump(fitnessvalueshist, f)
|
||||
pickle.dump(optparamsinit, f)
|
||||
|
||||
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('-' * get_terminal_size()[0], iteration, dict(optparamshist), fitnessvalueshist, '-' * get_terminal_size()[0]))
|
||||
|
||||
|
||||
def taguchi_code_blocks(inputfile, taguchinamespace):
|
||||
|
在新工单中引用
屏蔽一个用户