Changeset 774 for applications/bdmtoolbox/tutorial/mpdm/dist_ctrl_example.m
- Timestamp:
- 01/12/10 20:26:09 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/tutorial/mpdm/dist_ctrl_example.m
r765 r774 31 31 C1.Qy = 1*eye(1); 32 32 C1.yreq = 1; 33 C1.horizon = 100;33 C1.horizon = 5; 34 34 35 35 C2=C1; … … 42 42 P1.merger.class = 'merger_mix'; 43 43 P1.merger.method = 'geometric'; 44 P1.neighbours = {'P2'}; 44 %P1.merger.dbg_file = 'mp.it'; 45 P1.merger.ncoms = 20; 46 P1.neighbours = {};%{'P2'}; 45 47 46 48 P2=P1; … … 49 51 P2.neighbours = {}; 50 52 51 exper. ndat = 100;52 exper.burnin = 10;53 exper.Ndat = 10; 54 exper.burnin = 3; 53 55 exper.burn_pdf.class = 'enorm<ldmat>'; 54 56 exper.burn_pdf.mu = [0;0]; … … 56 58 57 59 58 M= arena(DS,{P1,P2},exper); 60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MONTE CARLO %%%%%%%%%%%%%%%%%%% 59 61 62 Ntrials = 100; 63 loss_non_coop = zeros(1,Ntrials); 64 for i=1:Ntrials 65 M= arena(DS,{P1,P2},exper); 60 66 61 %%%%%%%%%%%%%%%%%%%%%%%%%%%% 62 % PLOTS 63 64 figure(1); 65 hold off 66 subplot(1,2,1); 67 plot(M.DS_y); 68 subplot(1,2,2); 69 plot(M.DS_u1); hold on; 70 plot(M.DS_u2); 71 72 figure(2); 73 hold off 74 plot(M.Ctrl0_apost_mean_theta); 75 hold on 76 plot(M.Ctrl0_apost_ub_theta,':'); 77 plot(M.Ctrl0_apost_lb_theta,':'); 78 set(gca,'YLim',[-4,2]); 79 80 figure(3); 81 hold off 82 plot(M.Ctrl1_apost_mean_theta); 83 hold on 84 plot(M.Ctrl1_apost_ub_theta,':'); 85 plot(M.Ctrl1_apost_lb_theta,':'); 86 set(gca,'YLim',[-2,3]); 67 loss_non_coop(i) = M.DS_y'*C1.Qy*M.DS_y + M.DS_u1'*C1.Qu*M.DS_u1 + M.DS_u2'*C1.Qu*M.DS_u2; 68 end 69 mean(loss_non_coop)