main.m

来自「优化问题中的直接搜索法」· M 代码 · 共 34 行

M
34
字号
% Program to create a table with the number of function evaluations% needed to find a function value within DIRperc of the global optimal% function value. The table created shows these numbers for the original% DIRECT algorithm and our modified algorithm, DIRECT-l.%% Joerg Gablonsky, 10/31/00% Last Changed     04/16/01numproblems = 12;startprob = 0;setdirect;DIRnumf = 20000;DIRperc = 0.01;result = zeros(numproblems,7);problem = 0;for problem = startprob:numproblems+startprob  setproblem;  disp(sprintf('Problem : %s ',problemname))  for DIRJones = 0:1    writeDIRECT(DIReps,DIRnumf,numberT,DIRJones, DIRperc);    writemain(problem,0);    ! \rm ../result.out    ! cd ..; TestDIRect > nul ; \rm nul; cd matlab    helpi = counting;    i1 = 2+DIRJones*3;    i2 = i1 + 2;    result(problem+1-startprob,i1:i2) = helpi(2:4);    result(problem+1-startprob,1) = helpi(1);  endendfileoutputdisp(sprintf('The results of the optimizations can be found in the file results.txt'))

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?