我要做到以下几点:1)尝试各种输入组合来搜索最佳效果2)重置所有阵列,因为他们的代码的每个循环之前
每个变量我正在与工作是在一个阵列,例如F [0,1,2,3,...]
这个问题可能会在各个通部分后复位变量,第一遍工作正常,但第一遍的残留物会导致以下迭代早破..
这里是我的方法伪。 所以很简单,有可能与Python如何处理数据的问题(面向对象)..
index_save = index
for input1 in [0.1,0.2,0.3,...]
for input2 in [10,20,30,...]
for input3 in [-0.1,-0.2,-0.3,...]
index = index_save #To reset the index and thus all arrays
while True:
index = index + 1
f[index] = *Function of inputs*
result = *Function of f and inputs*
if condition_met = true
break
if result > result_best
result_best = result
inputs_best = [input1,input2,input3]