MakeFigure7PURPOSEGenerates Figure 7.
SYNOPSISfunction MakeFigure7
DESCRIPTIONGenerates Figure 7. Figure 7-left shows the execution time for the first iteration of Perseus in a discretized version of the problem in Figure 1 with an increasing number of states. Figure 7-right show the average accumulated discounted reward when solving the discrete version of the problem in Figure 1 with 20 and 200 states, comparing it with the average accumulated discounted reward obtained when solving the continuous version of the problem. NOTE: There is a large difference between the results you will obtain in this experiment and those in the paper. As mentioned in page 29, the discrete version of Perseus can be sped up vectorizing its operations and exploiting the sparsity of the matrices defining the models. In the old version we did not use those enhancements but we do in the current implementation. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function MakeFigure7 0002 % Generates Figure 7. 0003 % 0004 % Figure 7-left shows the execution time for the first iteration of 0005 % Perseus in a discretized version of the problem in Figure 1 with an 0006 % increasing number of states. 0007 % 0008 % Figure 7-right show the average accumulated discounted reward when 0009 % solving the discrete version of the problem in Figure 1 with 20 and 200 0010 % states, comparing it with the average accumulated discounted reward 0011 % obtained when solving the continuous version of the problem. 0012 % 0013 % NOTE: There is a large difference between the results you will obtain 0014 % in this experiment and those in the paper. 0015 % As mentioned in page 29, the discrete version of Perseus can be 0016 % sped up vectorizing its operations and exploiting the sparsity of 0017 % the matrices defining the models. In the old version we did not 0018 % use those enhancements but we do in the current implementation. 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'); |