Institut de Robòtica i Informàtica Industrial

GBelief

PURPOSE ^

Gaussian-based belief constructor.

SYNOPSIS ^

function gb=GBelief(varargin)

DESCRIPTION ^

   Gaussian-based belief constructor.
 
   Generates a belief on a continuous state space using a gaussian
   mixture.
   Parameters:
      GM: The Gaussian mixture.
      maxC: The maximum number of components in the mixtures representing
            beliefs. Beliefs with larger mixtures are compressed to fit in
            this threshold.

   Note that GBelief inherits from Belief but also from GMixture. Thus,
   all GMixture functions are directly appliable to GBeliefs.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function gb=GBelief(varargin)
0002 %   Gaussian-based belief constructor.
0003 %
0004 %   Generates a belief on a continuous state space using a gaussian
0005 %   mixture.
0006 %   Parameters:
0007 %      GM: The Gaussian mixture.
0008 %      maxC: The maximum number of components in the mixtures representing
0009 %            beliefs. Beliefs with larger mixtures are compressed to fit in
0010 %            this threshold.
0011 %
0012 %   Note that GBelief inherits from Belief but also from GMixture. Thus,
0013 %   all GMixture functions are directly appliable to GBeliefs.
0014  
0015   switch nargin
0016     
0017     case 1
0018       if isa(varargin{1},'GBelief')
0019         gb=varargin{1};
0020       else
0021         if isa(varargin{1},'GMixture')
0022           gb=GBelief(varargin{1},0);
0023         else
0024           error('Wrong parameter type in GBelief constructor');
0025         end
0026       end
0027       
0028     case 2
0029       if isa(varargin{1},'GMixture') && isa(varargin{2},'double')
0030         
0031         gb.maxC=floor(varargin{2});
0032         gm=Normalize(Compress(varargin{1},gb.maxC));
0033         
0034         b=Belief();
0035         
0036         gb=class(gb,'GBelief',b,gm);
0037       else
0038         error('Wrong parameter type in GBelief constructor');
0039       end
0040       
0041     otherwise
0042       error('Wrong number of parameters in GBelief constructor');
0043   end
0044


Institut de Robòtica i Informàtica Industrial

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