createmdp
创建马尔可夫决策过程模型
描述
例子
Create MDP Model
Create an MDP model with eight states and two possible actions.
MDP = createMDP(8,["up";“下”);
指定国家过渡及其相关的奖励。
% State 1 Transition and Rewardmdp.t(1,2,1)= 1;MDP.R(1,2,1)= 3;MDP.T(1,3,2)= 1;MDP.R(1,3,2)= 1;%状态2过渡和奖励MDP.T(2,4,1)= 1;MDP.R(2,4,1)= 2;MDP.T(2,5,2)= 1;MDP.R(2,5,2)= 1;%状态3过渡和奖励MDP.T(3,5,1)= 1;MDP.R(3,5,1)= 2;MDP.T(3,6,2)= 1;MDP.R(3,6,2)= 4;%状态4过渡和奖励MDP.T(4,7,1)= 1;MDP.R(4,7,1)= 3;MDP.T(4,8,2)= 1;MDP.R(4,8,2)= 2;% State 5 Transition and RewardMDP.T(5,7,1)= 1;MDP.R(5,7,1)= 1;MDP.T(5,8,2)= 1;MDP.R(5,8,2)= 9;%状态6过渡和奖励MDP.T(6,7,1)= 1;MDP.R(6,7,1)= 5;MDP.T(6,8,2)= 1;MDP.R(6,8,2)= 1;%状态7过渡和奖励MDP.T(7,7,1)= 1;MDP.R(7,7,1)= 0;MDP.T(7,7,2)= 1;MDP.R(7,7,2)= 0;% State 8 Transition and RewardMDP.T(8,8,1)= 1;MDP.R(8,8,1)= 0;MDP.T(8,8,2)= 1;MDP.R(8,8,2)= 0;
指定模型的终端状态。
MDP.TerminalStates = [“ S7”;“ S8”];
输入参数
状态
-模型状态
正整数|字符串向量
模型状态,指定为以下之一:
正整数 - 指定模型状态的数量。在这种情况下,每个状态都有一个默认名称,例如
“ S1”
for the first state.字符串向量 - 指定状态名称。在这种情况下,状态总数等于向量的长度。
动作
-模型动作
正整数|字符串向量
模型动作,指定为以下之一:
正整数 - 指定模型操作的数量。在这种情况下,每个操作都有一个默认名称,例如
“ A1”
对于第一个动作。str一世ng vector — Specify the action names. In this case, the total number of actions is equal to the length of the vector.
输出参数
MDP
- MDP模型
GenericMDP
目的
MDP模型,返回GenericMDP
具有以下属性的对象。
当前状态
-Name of the current state
细绳
Name of the current state, specified as a string.
状态
- 状态名称
字符串向量
国家名称,指定为字符串向量与兰gth equal to the number of states.
动作
- 动作名称
字符串向量
动作名称,指定为字符串向量,长度等于操作数量。
t
- 国家过渡矩阵
3D数组
状态过渡矩阵,指定为3-D数组,该矩阵确定了环境中代理的可能运动。状态过渡矩阵t
是一个概率矩阵,指示代理从当前状态移动的可能性s
到任何可能的下一个状态S'
byperforming action一个
。t
是一个s-经过-s-经过-一个数组,哪里s是州的数量和一个一世sthe number of actions. It is given by:
从非终端状态出来的过渡概率的总和s
遵循给定的操作必须总结一个。因此,必须同时指定从给定状态的所有随机过渡。
例如,指出状态1
遵循行动4
there is an equal probability of moving to states2
or3
,,,,use the following:
mdp.t(1,[2 3],4)= [0.5 0.5];
您还可以指定,在采取行动之后,存在某种可能保留在同一状态的可能性。例如:
MDP.T(1,[1 2 3 4],1)= [0.25 0.25 0.25 0.25];
r
-reward transition matrix
3D数组
奖励过渡矩阵,指定为3-D阵列,该矩阵确定代理在环境中执行诉讼后获得的奖励。r
具有与状态过渡矩阵相同的形状和大小t
。从国家移动的奖励s
tost一个teS'
byperforming action一个
是(谁)给的:
terminalStates
- 网格世界中的终端国家名称
字符串向量
网格世界中的终端状态名称,指定为状态名称的字符串向量。
版本历史记录
matlabコマンド
Matlabコマンドコマンドにするがクリックされまし。。
matlabコマンドコマンドに入力してしください。。。。ブラウザー
You can also select a web site from the following list:
如何获得最佳网站性能
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
美洲
- 一个mérica Latina((Español)
- 加拿大(英语)
- 美国(英语)