action_to_acceleration.m
来自「The MDP toolbox proposes functions relat」· M 代码 · 共 34 行
M
34 行
function [ax,ay]=action_to_acceleration(a)% action_to_acceleration: given an action a, this function computes the% corresponding (ax,ay) vector% Arguments --------------------------------------------------------------% a = the action taken (in 1:9) % Evaluation --------------------------------------------------------------% (ax,ay) = the corresponding acceleration vector's components.%--------------------------------------------------------------------------% In verbose mode, there is no difference to silent mode.%--------------------------------------------------------------------------% MDP Toolbox, INRA, BIA Toulouse, France%--------------------------------------------------------------------------if a==1 ax=-1;ay=-1;elseif a==2 ax=-1;ay=0;elseif a==3 ax=-1;ay=1;elseif a==4 ax=0;ay=-1;elseif a==5 ax=0;ay=0;elseif a==6 ax=0;ay=1;elseif a==7 ax=1;ay=-1;elseif a==8 ax=1;ay=0;elseif a==9 ax=1;ay=1;end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?