GenerateFigure7aDataPURPOSEGenerates the data for Figure 7-left.
SYNOPSISfunction GenerateFigure7aData(fname)
DESCRIPTIONGenerates the data for Figure 7-left. In this experiment we compute the time (in seconds) for the first iteration of Perseus for a discretized version of the problem described in Figure 1 with increasing number of states. This gives allow to compare the computational complexity of the discrete and the continuous versions of Perseus (compare the execution times here with those in Figure 5). Parameters: fname: file where to store the results. See also MakeFigure1, MakeFigure7. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function GenerateFigure7aData(fname) 0002 % Generates the data for Figure 7-left. 0003 % 0004 % In this experiment we compute the time (in seconds) for the first 0005 % iteration of Perseus for a discretized version of the problem 0006 % described in Figure 1 with increasing number of states. 0007 % This gives allow to compare the computational complexity of the discrete 0008 % and the continuous versions of Perseus (compare the execution times 0009 % here with those in Figure 5). 0010 % 0011 % Parameters: 0012 % fname: file where to store the results. 0013 % 0014 % See also MakeFigure1, MakeFigure7. 0015 0016 ns=100:100:1000; 0017 0018 % Nothing to be modified beyond this point 0019 0020 nns=size(ns,2); 0021 0022 [POMDP P]=GetTest1Parameters; 0023 0024 stopCriteria=@(n,t,vc)(n>1); 0025 0026 nRep=5; 0027 0028 tp=zeros(1,nns); 0029 k=1; 0030 for n=ns 0031 0032 fprintf('Discretizing the POMDP with %u states\n',n); 0033 DPOMDP=Discretize(POMDP,n); 0034 0035 start=DBelief(UniformDistribution(get(DPOMDP,'StateSpace'))); 0036 0037 fprintf('Sampling Beliefs\n'); 0038 B=SampleBeliefs(DPOMDP,start,P.nBeliefs,P.dBelief,P.stepsXtrial,P.rMin,P.rMax); 0039 r=0; 0040 for s=1:nRep 0041 [V Val Alpha t]=Perseus(DPOMDP,B,stopCriteria); 0042 r=r+t(2); 0043 end 0044 tp(k)=r/nRep; 0045 k=k+1; 0046 0047 end 0048 0049 save(fname,'ns','tp'); 0050 |