Institut de Robòtica i Informàtica Industrial

CS_DA_RewardModel

PURPOSE ^

CS_DA_RewardModel constructor.

SYNOPSIS ^

function RM=CS_DA_RewardModel(varargin)

DESCRIPTION ^

   CS_DA_RewardModel constructor.

   Defines a reward function on continuous state and discrete
   action spaces, r(s,a).
   This is the type of reward functions defined at the end of section 5.1
   in the paper.

   Note that the mixture defining this type of reward model is not
   normalized.

   Parameters
      S: Continuous state space.
      A: Discrete action space.
      r: A cell array of Gaussian mixture in 's' (one for each action).

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Returns the size of a policy.
  • dim Dimensionality of a continuous space.
  • dim Dimensionality of a discrete space.
This function is called by:

SOURCE CODE ^

0001 function RM=CS_DA_RewardModel(varargin)
0002 %   CS_DA_RewardModel constructor.
0003 %
0004 %   Defines a reward function on continuous state and discrete
0005 %   action spaces, r(s,a).
0006 %   This is the type of reward functions defined at the end of section 5.1
0007 %   in the paper.
0008 %
0009 %   Note that the mixture defining this type of reward model is not
0010 %   normalized.
0011 %
0012 %   Parameters
0013 %      S: Continuous state space.
0014 %      A: Discrete action space.
0015 %      r: A cell array of Gaussian mixture in 's' (one for each action).
0016 
0017   switch nargin
0018     case 1
0019       if isa(varargin{1},'CS_DA_RewardModel')
0020         RM=varargin{1};
0021       else
0022         error('Wrong parameter type in CS_DA_RewardModel constructor');
0023       end
0024     case 3
0025       if isa(varargin{1},'CSpace')
0026         RM.S=varargin{1};
0027       else
0028         error('Wrong parameter type in CS_DA_RewardModel constructor');
0029       end
0030       if isa(varargin{2},'DSpace')
0031         RM.A=varargin{2};
0032       else
0033         error('Wrong parameter type in CS_DA_RewardModel constructor');
0034       end
0035       if isa(varargin{3},'cell')
0036         RM.r=varargin{3}; 
0037       end
0038       
0039       if size(RM.r,2)~=dim(RM.A)
0040         error('Size missmatch in  CS_DA_RewardModel constructor');
0041       end
0042       
0043       RM=class(RM,'CS_DA_RewardModel');   
0044     otherwise
0045       error('Wrong number of parameters in CS_DA_RewardModel constructor');
0046   end
0047


Institut de Robòtica i Informàtica Industrial

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