Institut de Robòtica i Informàtica Industrial

Discretize

PURPOSE ^

Converts a continuous space into a discrete one.

SYNOPSIS ^

function DS=Discretize(CS,n,varargin)

DESCRIPTION ^

   Converts a continuous space into a discrete one.

   Generates a discrete space from a continuous one.
   The discrete state is generated via sampling (each sample becomes one
   of the states in the discrete version of the space).

   Parameters:
     CS: The continuous space
     n: The number of samples to generate. The number of states of the
        output discrete space.
     samples: [optional] some samples to use in the discretization

   Outputs:
     DS: The resulting discrete space.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Returns the size of a policy.
  • rand Random state from a discrete belief.
  • rand Random state from a belief.
  • rand Generates random points on a GMixture.
  • rand Generates random ponts on a Gaussian.
  • rand Random state from a continuous space.
  • DSpace DSpace constructor.
  • rand Random state from a discrete space.
This function is called by:

SOURCE CODE ^

0001 function DS=Discretize(CS,n,varargin)
0002 %   Converts a continuous space into a discrete one.
0003 %
0004 %   Generates a discrete space from a continuous one.
0005 %   The discrete state is generated via sampling (each sample becomes one
0006 %   of the states in the discrete version of the space).
0007 %
0008 %   Parameters:
0009 %     CS: The continuous space
0010 %     n: The number of samples to generate. The number of states of the
0011 %        output discrete space.
0012 %     samples: [optional] some samples to use in the discretization
0013 %
0014 %   Outputs:
0015 %     DS: The resulting discrete space.
0016 %
0017 
0018   if nargin>2
0019     k=size(varargin{1},2);
0020     samples=cell(1,k+n);
0021     samples(1:k)=varargin{1};
0022   else
0023     k=0;
0024     samples=cell(1,n);
0025   end
0026 
0027   for i=1:n
0028     samples{k+i}=rand(CS);
0029   end
0030   
0031   DS=DSpace(n+k,samples);


Institut de Robòtica i Informàtica Industrial

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