SampleBeliefs
PURPOSE 
Samples a set of beliefs from a POMDP.
SYNOPSIS 
function SB=SampleBeliefs(P,start,nBeliefs,minBeliefDist,stepsXtrial,minR,maxR)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
- Distance Distance between beliefs.
- rand Random state from a discrete belief.
- get Get for GBeliefs.
- Distance Distance between beliefs.
- rand Random state from a belief.
- Crop Limits all means to be inside the given space.
- Distance Approximated Kullback-Leibler distance between Gaussian mixture.
- get Get function for the GMixture object.
- rand Generates random points on a GMixture.
- Crop Forces the Gaussian mean to be in a given space.
- get Gaussian object get function.
- rand Generates random ponts on a Gaussian.
- get Get function for CS_CO_CA_POMDPs.
- get Get function for CS_CO_DA_POMDPs.
- get Get function for CS_CO_POMDPs.
- get Get function for CS_DO_CA_POMDPs.
- get Get function for CS_DO_DA_POMDPs.
- get Get function for CS_POMDPs.
- get Get function for DS_CO_CA_POMDPs.
- get Get function for DS_CO_DA_POMDPs.
- get Get function for DS_DO_CA_POMDPs.
- get Get function for DS_DO_DA_POMDPs.
- SimulationStep Executes one step of a POMDP simulation.
- get Get functio for POMDPs.
- Crop Forces a state to be in a given continuous sub-space.
- min Lower bound of a CSpace
- rand Random state from a continuous space.
- Crop Forces a state to be in a given discrete space.
- rand Random state from a discrete space.
This function is called by:
SOURCE CODE 
0001 function SB=SampleBeliefs(P,start,nBeliefs,minBeliefDist,stepsXtrial,minR,maxR)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 rand('state',sum(100*clock));
0027
0028 A=get(P,'ActionSpace');
0029 S=get(P,'StateSpace');
0030
0031 md=minBeliefDist+1;
0032 SB=cell(1,nBeliefs);
0033 k=0;
0034 r=maxR-1;
0035 while k<nBeliefs
0036 if (mod(k,stepsXtrial)==0) || (r>maxR) || (r<minR)
0037 b=start;
0038 s=Crop(S,rand(b));
0039
0040 fprintf('*\n');
0041 end
0042 a=rand(A);
0043 [s b o r]=SimulationStep(P,b,s,a);
0044
0045 if (k>1) && (minBeliefDist>0)
0046 md=min(cellfun(@(b1)(Distance(b,b1)),SB(1,k)));
0047 end
0048 if md>minBeliefDist
0049 k=k+1;
0050 SB{k}=b;
0051
0052 fprintf('.');
0053 if mod(k,80)==0
0054 fprintf('\n');
0055 end
0056 end
0057 end
0058 fprintf('\n');
0059
|