damp_gaussianhills.m

来自「approximate reinforcement learning」· M 代码 · 共 22 行

M
22
字号
function b = damp_gaussianhills(gh, x)% Damping variation as a function of the position.%   B = DAMP_GAUSSIANHILLS(GH, X)% `Gaussian hills': the damping is a sum of gaussians in the 2-dimensional area with given% centers, spreads, and amplitudes.%% Parameters:%   GH  - the parameters of the gaussian hills, a structure with fields%       n       - the number of gaussians in the friction landscape%       a       - the amplitude (height) of the gaussians, an array with n elements%       c       - the centers of the gaussians, 2xn matrix, each column a center point%       sigma   - the spread of the gaussians, 2xn matrix, each column coordinate-wise spread%   X   - the current state, position should be on the first two elements% Returns:%   B   - the friction (damping) coefficient in Xpos = repmat(x([1;2]), 1, gh.n);b = gh.b0 + sum( gh.a .* exp(-sum( ((pos - gh.c) ./ gh.sigma) .^ 2 )) ); % END damp_gaussianhills, RETURNING b ===================================================

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?