📄 int_mdp.m
字号:
function [xplus, rplus] = int_mdp(m, x, u)
% Implements the discrete-time dynamics of a simple integrator with
% bounded position, controlled in velocity.
% [XPLUS, RPLUS] = DOUBLEINT_MDP(M, X, U)
%
% This function conforms to the specifications established by SAMPLE_MDP.
%
% limit torque
u = max(-m.phys.maxu, min(m.phys.maxu, u));
% Compute and bound the next state
xplus = x + m.phys.K * u;
xplus = max(-m.phys.maxx, min(m.phys.maxx, xplus));
% Reward - QR
rplus = -x * m.goal.Q * x - u * m.goal.R * u + ...
m.goal.zeroreward * (abs(x) <= m.goal.zeroband);
% END FUNCTION int_mpd() RETURNING xplus, rplus ==================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -