0001 function MakeFigure7
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 fprintf('Loading/Generating the simulation results\n');
0021 fname='Results/Test1-Figure7-a.mat';
0022 GenData=@()(GenerateFigure7aData(fname));
0023 Results=GetData(fname,GenData);
0024
0025 h=clf;
0026 set(h,'name','C-POMDP Figure 7','numbertitle','off');
0027
0028 subplot(1,2,1);
0029 bar(Results.ns,Results.tp);
0030
0031 xlabel('No. States');
0032 ylabel('time (s)');
0033
0034 fprintf('Loading/Generating the simulation results with normal parameters\n');
0035 GenData=@()(TestRepWithStatistics('Test1','Figure2',1:10));
0036 ResultsNormal=GetData('Results/Test1-Figure2-results.mat',GenData);
0037
0038 [POMDP P]=GetTest1Parameters;
0039
0040 fprintf('Loading/Generating the simulation results with 20 states\n');
0041 DPOMDP=Discretize(POMDP,20);
0042 P.start=DBelief(UniformDistribution(get(DPOMDP,'StateSpace')));
0043 GenData=@()(TestRepWithStatistics(DPOMDP,P,'Figure7-b1',1:10));
0044 ResultsD20=GetData('Results/Test1-discrete-20-Figure7-b1-results.mat',GenData);
0045
0046 fprintf('Loading/Generating the simulation results with 200 states\n');
0047 DPOMDP=Discretize(POMDP,200);
0048 P.start=DBelief(UniformDistribution(get(DPOMDP,'StateSpace')));
0049 GenData=@()(TestRepWithStatistics(DPOMDP,P,'Figure7-b2',1:10));
0050 ResultsD200=GetData('Results/Test1-discrete-200-Figure7-b2-results.mat',GenData);
0051
0052
0053 subplot(1,2,2);
0054 plot(ResultsD20.tics,ResultsD20.SM.R,'linestyle',':');
0055 hold on;
0056 plot(ResultsD200.tics,ResultsD200.SM.R,'linestyle','--');
0057 plot(ResultsNormal.tics,ResultsNormal.SM.R);
0058
0059 legend('Discrete PERSEUS (20 states)','Discrete PERSEUS (200 states)','Continuous-State PERSEUS');
0060
0061 xlabel('time (s)');
0062 ylabel('Acc. Disc. Reward');