Institut de Robòtica i Informàtica Industrial

DS_DO_DA_POMDP

PURPOSE ^

DS_DO_DA_POMDP constructor.

SYNOPSIS ^

function P=DS_DO_DA_POMDP(varargin)

DESCRIPTION ^

   DS_DO_DA_POMDP constructor.

   Constructor of POMDP with
     - Discrete state spaces.
     - Discrete observation spaces.
     - Discrete action spaces.
   
   Parameters
     name: POMDP name.
     S: Continuous state space.
     A: Discrete action space.
     O: Continuous observation space.
     AM: Action model.
     OM: Observation model.
     RM: Reward model.
     gamma: Discount factor.

   This corresponds to the classical POMDP used in most of the papers so
   far. This type of POMDP are implemented and solved using the Perseus
   algoritm (Spaan and Vlassis JAIR 2005).

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function P=DS_DO_DA_POMDP(varargin)
0002 %   DS_DO_DA_POMDP constructor.
0003 %
0004 %   Constructor of POMDP with
0005 %     - Discrete state spaces.
0006 %     - Discrete observation spaces.
0007 %     - Discrete action spaces.
0008 %
0009 %   Parameters
0010 %     name: POMDP name.
0011 %     S: Continuous state space.
0012 %     A: Discrete action space.
0013 %     O: Continuous observation space.
0014 %     AM: Action model.
0015 %     OM: Observation model.
0016 %     RM: Reward model.
0017 %     gamma: Discount factor.
0018 %
0019 %   This corresponds to the classical POMDP used in most of the papers so
0020 %   far. This type of POMDP are implemented and solved using the Perseus
0021 %   algoritm (Spaan and Vlassis JAIR 2005).
0022 
0023   switch nargin
0024     case 1
0025       if isa(varargin{1},'DS_DO_DA_POMDP')
0026         P=varargin{1};
0027       else
0028         if isa(varargin{1},'char')
0029           % Reading from a file in ASCII format
0030           POMDPData=ReadDiscretePOMDPData([varargin{1} '.POMDP']);
0031           
0032           S=DSpace(POMDPData.nStates);
0033           O=DSpace(POMDPData.nObs);
0034           A=DSpace(POMDPData.nActions);
0035           
0036           AM=DS_DA_ActionModel(S,A,POMDPData.T);
0037           OM=DS_DO_ObsModel(S,O,POMDPData.O);
0038           RM=DS_DA_RewardModel(S,A,POMDPData.R);
0039           
0040           P=DS_DO_DA_POMDP(varargin{1},S,A,O,AM,OM,RM,POMDPData.gamma);
0041         else
0042           error('Wrong parameter type in DS_DO_DA_POMDP');
0043         end
0044       end
0045       
0046     case 2
0047       % Reading from a file in MAT format
0048       if isa(varargin{1},'char') && isa(varargin{2},'char') && strcmp(varargin{2},'-MAT')
0049         POMDPData=load(varargin{1},'-MAT');
0050         
0051         P=DS_DO_DA_POMDP(POMDPData.S,POMDPData.A,POMDPData.O,...
0052           POMDPData.AM,POMDPData.OM,POMDPData.RM,POMDPData.start,POMDPData.gamma);
0053       end
0054       
0055     case 8
0056       
0057       if isa(varargin{2},'DSpace')
0058         P.S=varargin{2};
0059       else
0060         error('Wrong parameter type in DS_DO_DA_POMDP');
0061       end
0062 
0063       if isa(varargin{3},'DSpace')
0064         P.A=varargin{3};
0065       else
0066         error('Wrong parameter type in DS_DO_DA_POMDP');
0067       end
0068 
0069       if isa(varargin{4},'DSpace')
0070         P.O=varargin{4};
0071       else
0072         error('Wrong parameter type in DS_DO_DA_POMDP');
0073       end
0074 
0075       if isa(varargin{5},'DS_DA_ActionModel')
0076         AM=varargin{5};
0077       else
0078         error('Wrong parameter type in DS_DO_DA_POMDP');
0079       end
0080 
0081       if isa(varargin{6},'DS_DO_ObsModel')
0082         OM=varargin{6};
0083       else
0084         error('Wrong parameter type in DS_DO_DA_POMDP');
0085       end
0086       
0087       if isa(varargin{7},'DS_DA_RewardModel')
0088         RM=varargin{7};
0089       else
0090         error('Wrong parameter type in DS_DO_DA_POMDP');
0091       end
0092     
0093       PBase=DS_DO_POMDP(varargin{1},varargin{8});
0094       
0095       P=class(P,'DS_DO_DA_POMDP',PBase,AM,OM,RM);
0096       
0097     otherwise
0098       error('Wrong number of parameters in DS_DO_DA_POMDP');
0099   end


Institut de Robòtica i Informàtica Industrial

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