![]() |
DiscretizeActionModelPURPOSE
Produces a new action model discretizing the state space.
SYNOPSIS
function DAM=DiscretizeActionModel(AM,DS)
DESCRIPTION
Produces a new action model discretizing the state space. Produces an action model defined on a discrete state space from an action model defined on continuous state spaces. In both the input and output action models, the action space is discrete. Parameters: AM: The continuous state, discrete action action model to be discretized. DS: The discrete space with the samples to be used as discrete states in the discretization. See also DS_DA_ActionModel. CROSS-REFERENCE INFORMATION
This function calls:
SOURCE CODE
0001 function DAM=DiscretizeActionModel(AM,DS) 0002 % Produces a new action model discretizing the state space. 0003 % 0004 % Produces an action model defined on a discrete state space from an 0005 % action model defined on continuous state spaces. 0006 % In both the input and output action models, the action space is 0007 % discrete. 0008 % Parameters: 0009 % AM: The continuous state, discrete action action model to be discretized. 0010 % DS: The discrete space with the samples to be used as discrete states 0011 % in the discretization. 0012 % 0013 % See also DS_DA_ActionModel. 0014 0015 ns=dim(DS); 0016 0017 na=dim(AM.A); 0018 T=cell(1,na); 0019 for i=1:na 0020 m=get(AM.gA{i},'mean'); 0021 S=get(AM.gA{i},'covariance'); 0022 T{i}=zeros(ns,ns); 0023 for j=1:ns 0024 % Gaussian on next state form current state 'j' when 0025 % action 'i' is executed. 0026 g=Gaussian(Crop(AM.S,DS(j)+m),S); 0027 for k=1:ns 0028 T{i}(k,j)=Value(g,DS(k)); 0029 end 0030 T{i}(:,j)=T{i}(:,j)/sum(T{i}(:,j)); 0031 end 0032 end 0033 0034 DAM=DS_DA_ActionModel(DS,AM.A,T); 0035 |