1 | function ztrata=srovnej(system,apriori)
|
---|
2 | kresli=0;
|
---|
3 | p=0;
|
---|
4 | seed=randn(6,system.horizont_rizeni);
|
---|
5 | [ztrata1 omega1 rizeni1]=jednoduche_rizeni(system,apriori,seed);
|
---|
6 | [ztrata2 omega2 rizeni2]=dualni_rizeni(system,apriori,seed);
|
---|
7 | ztrata=[ztrata1 ztrata2];
|
---|
8 | if (kresli)
|
---|
9 | figure
|
---|
10 | plot(omega1(1,:),'r-'); hold on
|
---|
11 | plot(omega1(2,:),'r.-.');
|
---|
12 | plot(omega2(1,:),'b-');
|
---|
13 | plot(omega2(2,:),'b.-.');
|
---|
14 | legend('SKUTECNE_simple','ODHAD_simle','SKUTECNE_dual','ODHAD_dual');
|
---|
15 | TITLE([ztrata1;ztrata2]);
|
---|
16 | figure
|
---|
17 | if (p)
|
---|
18 | plot(rizeni1(1,:),'r-'); hold on
|
---|
19 | plot(rizeni1(2,:),'r.-.');
|
---|
20 | plot(rizeni2(1,:),'b-');
|
---|
21 | plot(rizeni2(2,:),'b.-.');
|
---|
22 | legend('simple_1','simple_1','dual_1','dual_1');
|
---|
23 | else
|
---|
24 | plot(rizeni1(1,:).^2+rizeni1(2,:).^2,'r-'); hold on
|
---|
25 | plot(rizeni2(1,:).^2+rizeni2(2,:).^2,'b-');
|
---|
26 | end
|
---|
27 | end
|
---|
28 | end |
---|