% UBA=32.728;
% LBA=-32.728;
% A_x=[-32.728:0.1:32.728];
% A_z=-20*exp(-0.2*sqrt((1/1)*(A_x.^2)))-exp((1/1)*(cos(2*pi.*A_x)))+exp(1)+20; %原函数
% A_x=sort(A_x);
% hold on;
% plot(A_x,A_z,'r-','linewidth',2);
%Sphere函数
UBS=100;
LBS=-100;
S_x=[-100:100];
S_z=S_x.^2; %原函数
S_x=sort(S_x);
hold on;
plot(S_x,S_z,'r-','linewidth',1.5);
% %Rosenbrock
% UBS=10;
% LBS=-5;
% r_x=-5:0.1:10;
% r_z=100*r_x.^4+(r_x-1).^2; %原函数
% r_x=sort(r_x);
% hold on;
% plot(r_x,r_z,'r-','linewidth',1.5);
UBR=5.12;
LBR=-5.12;
% R_x=[-5.12:0.05:5.12];
% R_z=10+(R_x)'.^2-10*cos(2*pi.*(R_x)')+(R_x)'.^2; %原函数
x=rand(205,1);
x=sort(x);
R_x=LBR+x*(UBR-LBR);
R_z=10+(R_x)'.^2-10*cos(2*pi.*(R_x)')+(R_x)'.^2; %原函数
% x=sort(x);
figure
plot(x,R_z,'b-','linewidth',1.5,'MarkerIndices',1:5:length(R_z));
xlabel('x');
ylabel('y');
axis([0 1 0 70]);
result1_SAMTO(1,:)=85*44-mean(SAMTO_new(1).Toall_BestFitss(2:4:20,2:21));
result1_SAMTO(2,:)=85*145-mean(SAMTO_new(1).Toall_BestFitss(4:4:20,2:21));
result2_SAMTO(1,:)=85*44-SAMTO_new(2).Toall_BestFitss(1,:);
result2_SAMTO(2,:)=85*97-SAMTO_new(2).Toall_BestFitss(2,:);
result3_SAMTO(1,:)=85*97-SAMTO_new(3).Toall_BestFitss(1,:);
result3_SAMTO(2,:)=85*145-SAMTO_new(3).Toall_BestFitss(2,:);
% ST2T1_2=[global_precent,local_precent(:,1801:3000)];
% save 'ST2T1_2.mat' 'ST2T1_2';
st1t1=mean(ST1T1_2); %Rastrigin function positive transfer to Griewank
ST1T1=[];
for i=1:150:3000
ST1T1=[ST1T1,mean(st1t1(i:i+149))];
end
plot(ST1T1,'o-','color',[0.8547,0.33,0.10],...
'linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST1T1));
hold on
st1t2=mean(ST1T2_2); %Greiwank function positive transfer to Griewank
ST1T2=[];
for i=1:150:3000
ST1T2=[ST1T2,mean(st1t2(i:i+149))];
end
plot(ST1T2,'*-g','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST1T2));
hold on
st2t1=mean(ST2T1_2);
ST2T1=[];
for i=1:150:3000
ST2T1=[ST2T1,mean(st2t1(i:i+149))];
end
plot(ST2T1,'c->','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST2T1));
hold on
st2t2=mean(ST2T2_2);
ST2T2=[];
for i=1:150:3000
ST2T2=[ST2T2,mean(st2t2(i:i+149))];
end
plot(ST2T2,'m-<','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST2T2));
hold on
t1t2=mean(T1T2_2);
T1T2=[];
for i=1:150:3000
T1T2=[T1T2,mean(t1t2(i:i+149))];
end
plot(T1T2,'b-s','linewidth',2,'MarkerSize',6,'MarkerIndices',1:2:length(ST2T2));
hold on
title('Ankang Reservoir 2003 & 2000');
xlabel('Number of Function Evaluations');
ylabel('Average Positive transfer probability');
legend('The surrogate of T1 positive transfer to T1',...
'The surrogate of T1 positive transfer to T2',...
'The surrogate of T2 positive transfer to T1',...
'The surrogate of T2 positive transfer to T2',...
'T1 positive transfer to T2');
% set(gca,'xticklabel',{'0','4500','9000','13500','18000','22500','27000',...
% '31500','36000','40500','45000','49500','54000','58500','63000',...
% '67500','72000','76500','81000','85500','90000'});
set(gca,'xticklabel',{'0','9000','18000','27000','36000','45000','54000','63000','72000','81000','90000'});