%clear all;
%load('regret1_repeat.mat');
%X_2 = [2:2:20]*1000;
%X = [1,X_2];
X_2 = [1:1:T/50]*50;
X = [1, X_2];
%X = 1:40:T;

% 
load('regret_test_original.mat');
wgp_total = mean(gp_regrets_track,2);
err_wgp_total = std(gp_regrets_track,0,2);
errorbar(X,wgp_total(X),err_wgp_total(X),'color','k','linewidth',4,'Marker','o','MarkerSize',20,'linestyle','-')
hold on

% load('regret1_backup.mat');
wgp_total = mean(w_gp_regrets_track,2);
err_wgp_total = std(w_gp_regrets_track,0,2);
errorbar(X,wgp_total(X),err_wgp_total(X),'color',[0.13,0.54,0.13],'linewidth',4,'Marker','v','MarkerSize',20,'linestyle','-')

rgp_total = mean(r_gp_regrets_track,2);
err_rgp_total = std(r_gp_regrets_track,0,2);
errorbar(X,rgp_total(X),err_rgp_total(X),'r','linewidth',4,'Marker','x','MarkerSize',20,'linestyle','-.')

load('regret_test_original.mat');
% load('regret1_repeat.mat');
gp_total = mean(gp_regrets_track,2);
err_gp_total = std(gp_regrets_track,0,2);
hold on
errorbar(X,gp_total(X),err_gp_total(X),'color','k','linewidth',4,'Marker','o','MarkerSize',20,'linestyle','-')
hold on

et_gp_total = mean(et_gp_regrets_track,2);
err_et_wgp_total = std(et_gp_regrets_track,0,2);
hold on
errorbar(X,et_gp_total(X),err_et_wgp_total(X),'color','b','linewidth',4,'Marker','x','MarkerSize',20,'linestyle','-')
hold on


% load('regret1_backup.mat');
wgp_total = mean(w_gp_regrets_track,2);
err_wgp_total = std(w_gp_regrets_track,0,2);
errorbar(X,wgp_total(X),err_wgp_total(X),'color',[0.13,0.54,0.13],'linewidth',4,'Marker','v','MarkerSize',20,'linestyle','-')

rgp_total = mean(r_gp_regrets_track,2);
err_rgp_total = std(r_gp_regrets_track,0,2);
errorbar(X,rgp_total(X),err_rgp_total(X),'r','linewidth',4,'Marker','x','MarkerSize',20,'linestyle','-.')

%axis([0,20000,0,4e4])
% axis([-10,T*1.1,0,max(rgp_total)*1.5]) 
set(gcf,'unit','normalized','position',[0.05,0.05,0.85,0.85]);  %position within the whole screen 
set(gca,'fontweight','bold','FontSize',28)
xlabel('Iteration','FontSize',40) 
ylabel('Cumulative Regret','FontSize',40)
legend({'GP-UCB prev','W-GP-UCB prev','R-GP-UCB prev','GP-UCB new','ET-GP-UCB new','W-GP-UCB new','R-GP-UCB new'},'FontSize',46, 'Location','northwest','FontWeight','Normal')
 