Institut de Robòtica i Informàtica Industrial

PBelief

PURPOSE ^

Particle-based belief constructor.

SYNOPSIS ^

function pb=PBelief(varargin)

DESCRIPTION ^

   Particle-based belief constructor.

   Generates a belief on a continuous state space using a particles.

   Parameters:
      w: Weights for the particles
      samples: Value for the particle in the state space.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Returns the size of a policy.
  • Belief Belief constructor.
This function is called by:

SOURCE CODE ^

0001 function pb=PBelief(varargin)
0002 %   Particle-based belief constructor.
0003 %
0004 %   Generates a belief on a continuous state space using a particles.
0005 %
0006 %   Parameters:
0007 %      w: Weights for the particles
0008 %      samples: Value for the particle in the state space.
0009 %
0010 
0011   switch nargin
0012     case 1
0013       if isa(varargin{1},'PBelief')
0014         pb=varargin{1};
0015       else
0016         error('Wrong parameter type in PBelief constructor');
0017       end
0018     case 2
0019       if isa(varargin{1},'double') && isa(varargin{2},'double')
0020         pb.w=varargin{1};
0021         [s1 pb.np]=size(pb.w);
0022         if s1>1
0023           error('Weights are row arrays');
0024         end
0025         pb.w=pb.w/sum(pb.w);
0026         
0027         pb.samples=varargin{2};
0028         [pb.ss t2]=size(pb.samples);
0029         if t2~=pb.np
0030           error('Mismatch sizes in PBelief creation');
0031         end
0032 
0033         pb.noiselessMovedSamples=pb.samples;
0034         pb.noise=zeros(pb.ss);
0035         
0036         b=Belief();
0037         pb=class(pb,'PBelief',b);
0038       else
0039         
0040       end
0041     otherwise
0042       error('Wrong number of parameters in PBelief constructor');
0043   end
0044


Institut de Robòtica i Informàtica Industrial

Generated on Wed 05-Aug-2009 15:05:21 by m2html © 2003