DS_DA_RewardModelPURPOSEDS_DA_RewardModel constructor.
SYNOPSISfunction RM=DS_DA_RewardModel(varargin)
DESCRIPTIONDS_DA_RewardModel constructor. Defines a reward function on discrete state and action spaces, r(s,a). This is the type of reward functions used in the usual POMDPs. Parameters S: Discrete state space. A: Discrete action space. r: A cell array iwth one column vector (of the dimension of the state space) for each action. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function RM=DS_DA_RewardModel(varargin) 0002 % DS_DA_RewardModel constructor. 0003 % 0004 % Defines a reward function on discrete state and 0005 % action spaces, r(s,a). 0006 % This is the type of reward functions used in the usual POMDPs. 0007 % 0008 % Parameters 0009 % S: Discrete state space. 0010 % A: Discrete action space. 0011 % r: A cell array iwth one column vector (of the dimension of the 0012 % state space) for each action. 0013 0014 0015 switch nargin 0016 case 1 0017 if isa(varargin{1},'DS_DA_RewardModel') 0018 RM=varargin{1}; 0019 else 0020 error('Wrong parameter type in DS_DA_RewardModel constructor'); 0021 end 0022 case 3 0023 if isa(varargin{1},'DSpace') 0024 RM.S=varargin{1}; 0025 else 0026 error('Wrong parameter type in DS_DA_RewardModel constructor'); 0027 end 0028 if isa(varargin{2},'DSpace') 0029 RM.A=varargin{2}; 0030 else 0031 error('Wrong parameter type in DS_DA_RewardModel constructor'); 0032 end 0033 if isa(varargin{3},'cell') 0034 RM.r=varargin{3}; 0035 end 0036 0037 if dim(RM.S)~=size(RM.r{1},1) 0038 error('Size missmatch in DS_DA_RewardModel constructor'); 0039 end 0040 0041 if dim(RM.A)~=size(RM.r,2) 0042 error('Size missmatch in DS_DA_RewardModel constructor'); 0043 end 0044 0045 RM=class(RM,'DS_DA_RewardModel'); 0046 otherwise 0047 error('Wrong number of parameters in DS_DA_RewardModel constructor'); 0048 end |