Changeset 787 for applications/bdmtoolbox
- Timestamp:
- 01/14/10 21:37:57 (15 years ago)
- Location:
- applications/bdmtoolbox/tutorial/mpdm
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/tutorial/mpdm/dist_ctrl_acc.m
r786 r787 50 50 %P1.merger.dbg_file = 'mp.it'; 51 51 P1.merger.ncoms = 20; 52 P1.merger.stop_niter= 5; 52 53 P1.neighbours = {};%{'P2'}; 53 54 … … 88 89 Y = [M.DS_y1 M.DS_y2 M.DS_y3]; 89 90 Yreq = ones(size(M.DS_y1))*[0 1 0]; 90 loss_ non_coop(i) = trace((Y-Yreq)'*0.01*(Y-Yreq)) + M.DS_u1'*C1.Qu*M.DS_u1 + M.DS_u2'*C1.Qu*M.DS_u2;91 loss_coop(i) = trace((Y-Yreq)'*0.01*(Y-Yreq)) + M.DS_u1'*C1.Qu*M.DS_u1 + M.DS_u2'*C1.Qu*M.DS_u2; 91 92 if loss_coop(i)>100 92 93 %keyboard -
applications/bdmtoolbox/tutorial/mpdm/dist_ctrl_example.m
r781 r787 31 31 C1.Qy = 1*eye(1); 32 32 C1.yreq = 1; 33 C1.horizon = 5;33 C1.horizon = 1; 34 34 35 35 C2=C1; … … 44 44 %P1.merger.dbg_file = 'mp.it'; 45 45 P1.merger.ncoms = 20; 46 P1.merger.stop_niter= 5; 46 47 P1.neighbours = {};%{'P2'}; 47 48 … … 60 61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MONTE CARLO %%%%%%%%%%%%%%%%%%% 61 62 62 Ntrials = 100;63 Ntrials = 3; 63 64 loss_non_coop = zeros(1,Ntrials); 64 65 for i=1:Ntrials 65 66 M= arena(DS,{P1,P2},exper); 66 67 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 loss_non_coop(i) = (M.DS_y-C1.yreq)'*C1.Qy*(M.DS_y-C1.yreq) + M.DS_u1'*C1.Qu*M.DS_u1 + M.DS_u2'*C1.Qu*M.DS_u2; 68 69 if loss_non_coop(i)>100 69 70 %keyboard … … 78 79 M= arena(DS,{P1,P2},exper); 79 80 80 loss_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;81 loss_coop(i) = (M.DS_y-C1.yreq)'*C1.Qy*(M.DS_y-C1.yreq) + M.DS_u1'*C1.Qu*M.DS_u1 + M.DS_u2'*C1.Qu*M.DS_u2; 81 82 if loss_coop(i)>100 82 83 %keyboard