int_problem.m
来自「approximate reinforcement learning」· M 代码 · 共 44 行
M
44 行
function out = int_problem(what)% Integrator problem setup.% OUT = DOUBLEINT_PROBLEM(WHAT)% This function conforms to the specifications established by SAMPLE_PROBLEM.maxx = 5;maxu = 2;gridstep = .5;xgrids = {-maxx:gridstep:maxx};ugrids = {-maxu:gridstep:maxu};x0 = (2*rand) * maxx - maxx;gamma = 0.98;switch what case 'model' phys.maxx = maxx; phys.maxu = maxu; phys.K = 2; % command gain % reward specification % config 1: LQR goal.Q = .1; goal.R = .05; goal.zeroband = 0; goal.zeroreward = 0; % config 2: min-time% goal.Q = 0; goal.R = 0;% goal.zeroband = 0.1;% goal.zeroreward = 10; Ts = 1; fun = @int_mdp; out = varstostruct('Ts', 'fun', 'phys', 'goal'); case 'fuzzy' cfg.xgrids = xgrids; cfg.ugrids = ugrids; cfg.gamma = gamma; cfg.x0 = x0; out = cfg; end;% END doubleint_problem(), RETURNING out ====================================
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?