📄 uniformm.m
字号:
function [parent] = uniformMutate(parent,bounds,Ops)
% Uniform mutation changes one of the parameters of the parent
% based on a uniform probability distribution.
% function [newSol] = multiNonUnifMutate(parent,bounds,Ops)
% parent - the first parent ( [solution string function value] )
% bounds - the bounds matrix for the solution space
% Ops - Options for uniformMutation [gen #UnifMutations]
% Binary and Real-Valued Simulation Evolution for Matlab
df = bounds(:,2) - bounds(:,1); % Range of the variables
numVar = size(parent,2)-1; % Get the number of variables
% Pick a variable to mutate randomly from 1-number of vars
mPoint = round(rand * (numVar-1)) + 1;
newValue = bounds(mPoint,1)+rand * df(mPoint); % Now mutate that point
parent(mPoint) = newValue; % Make the child
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -