Institut de Robòtica i Informàtica Industrial

TestOne

PURPOSE ^

Samples beliefs and executes Perseus on a given problem.

SYNOPSIS ^

function [POMDP P B V Val Alpha t]=TestOne(varargin)

DESCRIPTION ^

   Samples beliefs and executes Perseus on a given problem.   

   Executes one iteration of Perseus as described a Table 1 of page 12 of
   the paper. It first samples a set of belief by randomly simulating the
   POMDP.
   Possible parameters
     - POMDP,P: The POMDP to solve and the set of parameters to use
     - 'name': A function called 'Get'+name+'Parametres' is used to obtain
       both the POMDP and the set of parameters, P.
   Outputs:
     - POMDP: The POMDP.
     - P: The set of parameters.
     - B: The set of beliefs.
     - V: The set of Policies (one per iteration) out of Perseus.
     - Val: Set of values for each iteration/belief.
     - Alpha: Alpha element maximizing the value for each belief in each
              iteration.
     - t: Time at which each iteration was compleated.

  Example of use
     [POMDP P B V Val Alpha t]=TestOne('Test1');

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [POMDP P B V Val Alpha t]=TestOne(varargin)
0002 %   Samples beliefs and executes Perseus on a given problem.
0003 %
0004 %   Executes one iteration of Perseus as described a Table 1 of page 12 of
0005 %   the paper. It first samples a set of belief by randomly simulating the
0006 %   POMDP.
0007 %   Possible parameters
0008 %     - POMDP,P: The POMDP to solve and the set of parameters to use
0009 %     - 'name': A function called 'Get'+name+'Parametres' is used to obtain
0010 %       both the POMDP and the set of parameters, P.
0011 %   Outputs:
0012 %     - POMDP: The POMDP.
0013 %     - P: The set of parameters.
0014 %     - B: The set of beliefs.
0015 %     - V: The set of Policies (one per iteration) out of Perseus.
0016 %     - Val: Set of values for each iteration/belief.
0017 %     - Alpha: Alpha element maximizing the value for each belief in each
0018 %              iteration.
0019 %     - t: Time at which each iteration was compleated.
0020 %
0021 %  Example of use
0022 %     [POMDP P B V Val Alpha t]=TestOne('Test1');
0023 
0024   switch nargin
0025     case 1
0026       if isa(varargin{1},'char')
0027         [POMDP P]=eval(['Get' varargin{1} 'Parameters']);
0028       else
0029         error('Wrong type of parameters in TestOne');
0030       end
0031       
0032     case 2
0033       POMDP=varargin{1};
0034       P=varargin{2};
0035       
0036     otherwise
0037       error('Wrong number of parameters in TestOne');
0038   end
0039   
0040   % Simulate and get some beliefs
0041   fprintf('Sampling Beliefs\n');
0042   B=SampleBeliefs(POMDP,P.start,P.nBeliefs,P.dBelief,P.stepsXtrial,P.rMin,P.rMax);
0043       
0044   % Solve
0045   fprintf('Solving\n');
0046   [V Val Alpha t]=iPerseus(POMDP,B,P.stopCriteria);
0047


Institut de Robòtica i Informàtica Industrial

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