SAparameter

SAparameter - % if (cost(snew) < COSTbest) % COSTbest=...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
AP= 20; P1= .7; P2= .05; G= 1000; % % sinitial= randi([0 127],[1,2]); % COSTbest= cost(sinitial); % sbest= sinitial; % snew= zeros(1,2); % APvalues= zeros(AP,2); % k= 0; % totalDcost= 0; % % while (k== 0) % for j= 1:AP % snew(1)= randi([max(sinitial(1)-25,0) min(sinitial(1)+25,127)]); % snew(2)= randi([max(sinitial(2)-25,0) min(sinitial(2)+25,127)]); % while (snew == sinitial) % snew(1)= randi([max(sinitial(1)-25,0) min(sinitial(1)+25,127)]); % snew(2)= randi([max(sinitial(2)-25,0) min(sinitial(2)+25,127)]); % end % APvalues(j,1)= snew(1); % APvalues(j,2)= snew(2);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % if (cost(snew) < COSTbest) % COSTbest= cost(snew); % sbest= snew; % end % end % % for j= 1:AP % if ( max(sbest(1)-25,0)<=APvalues(j,1) && APvalues(j,1)<=min(sbest(1)+25,127) && max(sbest(2)-25,0)<=APvalues(j,2) && APvalues(j,2)<=min(sbest(2)+25,127) ) % if (cost(APvalues(j,:)) > cost(sbest)) % k= k+1; % totalDcost= totalDcost + (cost(APvalues(j,:))-cost(sbest)); % end % end % end % end % AVGdeltaCost= totalDcost/k; A Tinitial= -1*AVGdeltaCost/log(P1); Tfinal= -1*AVGdeltaCost/log(P2); alpha= (Tfinal/Tinitial)^(1/G);...
View Full Document

This note was uploaded on 10/02/2011 for the course ORIE 5430 taught by Professor Shoemaker during the Fall '11 term at Cornell.

Ask a homework question - tutors are online