plotPURPOSEPlots the CS_CA_RewardModel
SYNOPSISfunction h=plot(RM)
DESCRIPTIONPlots the CS_CA_RewardModel Plot a 3d surface representing the reward function in the continous state and action spaces. It only works for one-dimensional spaces. CROSS-REFERENCE INFORMATIONThis function calls:
SOURCE CODE0001 function h=plot(RM) 0002 % Plots the CS_CA_RewardModel 0003 % 0004 % Plot a 3d surface representing the reward function in the continous state 0005 % and action spaces. 0006 % It only works for one-dimensional spaces. 0007 0008 if dim(RM.S)==1 && dim(RM.A)==1 0009 0010 s=min(RM.S):max(RM.S); 0011 a=min(RM.A):max(RM.A); 0012 ns=size(s,2); 0013 na=size(a,2); 0014 sr=zeros(ns,na); 0015 for i=1:ns 0016 for j=1:na 0017 sr(i,j)=sum(RM.w.*cellfun(@(g)(Value(g,s(i))),RM.gS).*cellfun(@(g)(Value(g,a(j))),RM.gA)); 0018 end 0019 end 0020 h=surf(s,a,sr'); 0021 else 0022 error('CS_CA_RewardModel plot only implemented for one-dimensional S/A spaces'); 0023 end |