Institut de Robòtica i Informàtica Industrial

DBelief

PURPOSE ^

Discrete belief constructor.

SYNOPSIS ^

function db=DBelief(varargin)

DESCRIPTION ^

   Discrete belief constructor.

   Generates a belief on a discrete state space.
   The belief is basically a column vector with the probabilities for each
   state.

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 db=DBelief(varargin)
0002 %   Discrete belief constructor.
0003 %
0004 %   Generates a belief on a discrete state space.
0005 %   The belief is basically a column vector with the probabilities for each
0006 %   state.
0007 
0008   switch nargin  
0009     case 1
0010       if isa(varargin{1},'DBelief')
0011         db=varargin{1};
0012       else
0013         if isa(varargin{1},'double')
0014           db.v=varargin{1};
0015           [s1 s2]=size(db.v);
0016           if s2>1
0017             error('Vectors are column arrays');
0018           end
0019           db.v=db.v/sum(db.v);
0020           
0021           b=Belief();
0022           db=class(db,'DBelief',b);
0023         else
0024           error('Wrong parameter type in DBelief constructor');
0025         end
0026       end
0027     otherwise
0028       error('Wrong number of parameters in DBelief constructor');
0029   end


Institut de Robòtica i Informàtica Industrial

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