Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在matlab中生成连续函数禁忌搜索的邻域?_Matlab_Optimization_Benchmarking_Tabu Search - Fatal编程技术网

如何在matlab中生成连续函数禁忌搜索的邻域?

如何在matlab中生成连续函数禁忌搜索的邻域?,matlab,optimization,benchmarking,tabu-search,Matlab,Optimization,Benchmarking,Tabu Search,我想在matlab中实现禁忌搜索来优化Ackley基准函数,因为我不知道如何为这个连续函数生成邻域。 均匀随机数足够吗?还是我必须选择步长? thx帮助维基百科的伪代码: 1 sBest ← s0 2 bestCandidate ← s0 3 tabuList ← [] 4 tabuList.push(s0) 5 while (not stoppingCondition()) 6 sNeighborhood ← getNeighbors(bestCandidate) 7 b

我想在matlab中实现禁忌搜索来优化Ackley基准函数,因为我不知道如何为这个连续函数生成邻域。 均匀随机数足够吗?还是我必须选择步长?
thx帮助维基百科的伪代码:

1  sBest ← s0
2  bestCandidate ← s0
3  tabuList ← []
4  tabuList.push(s0)
5  while (not stoppingCondition())
6    sNeighborhood ← getNeighbors(bestCandidate)
7    bestCandidate ← sNeighborHood.firstElement
8    for (sCandidate in sNeighborHood)
9      if ( (not tabuList.contains(sCandidate)) and (fitness(sCandidate) > 
       fitness(bestCandidate)) )
10       bestCandidate ← sCandidate
11     end
12   end
13   if (fitness(bestCandidate) > fitness(sBest))
14     sBest ← bestCandidate
15   end
16   tabuList.push(bestCandidate)
17   if (tabuList.size > maxTabuSize)
18     tabuList.removeFirst()
19   end
20 end
21 return sBest
检查第9行。禁忌搜索的整个想法是有一个以前访问过的位置列表,以阻止搜索到那些以前访问过的位置

如果将当前位置的随机扰动用作其邻居,则从另一位置到达该完全相同邻居的概率实际上为0。这欺骗了禁忌列表的目的,因为第9行中的条件1几乎总是正确的

我想最好将搜索空间离散化,比如说,每个维度10或50个间隔