Institut de Robòtica i Informàtica Industrial

plot

PURPOSE ^

Plots the CS_CO_ObsModel

SYNOPSIS ^

function h=plot(OM)

DESCRIPTION ^

 Plots the CS_CO_ObsModel

 Plot a 3d surface representing the obs model p(o|s) in continuous
 observation and state spaces
 It only works for one-dimensional spaces.

CROSS-REFERENCE INFORMATION ^

This function calls:
  • size Returns the size of a policy.
  • Value Evaluates a GMixture.
  • Value Evaluation of a Gaussian.
  • dim Dimensionality of a continuous space.
  • max Upper bound of a CSpace
  • min Lower bound of a CSpace
  • dim Dimensionality of a discrete space.
This function is called by:

SOURCE CODE ^

0001 function h=plot(OM)
0002 % Plots the CS_CO_ObsModel
0003 %
0004 % Plot a 3d surface representing the obs model p(o|s) in continuous
0005 % observation and state spaces
0006 % It only works for one-dimensional spaces.
0007    
0008    if dim(OM.S)==1 && dim(OM.O)==1
0009      
0010      s=min(OM.S):0.25:max(OM.S);
0011      o=min(OM.O):0.25:max(OM.O);
0012      ns=size(s,2);
0013      no=size(o,2);
0014      sp=zeros(ns,no);
0015      for i=1:ns
0016        for j=1:no
0017          sp(i,j)=sum(OM.w.*cellfun(@(g)(Value(g,s(i))),OM.gS).*cellfun(@(g)(Value(g,o(j))),OM.gO));
0018        end
0019      end
0020      h=surf(s,o,sp');
0021    else
0022      error('CS_CO_ObsModel plot only implemented for one-dimensional S/O spaces');
0023    end


Institut de Robòtica i Informàtica Industrial

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