normal.m
来自「多智能体工具包」· M 代码 · 共 22 行
M
22 行
function NewChrom=normal(TheChrom)
% NORMAL Normalize the chromosome after the mutation.
% Copyright (c) 1998-2000 Jiming Liu and Jianbing Wu
global RobotNum PopulationSize;
NewValue=[];
for loops=1:PopulationSize
RealValue=getreal(TheChrom(loops,:));
ForSort=RealValue(1:RobotNum)';
[SortedValue,Sequence]=sort(ForSort);
CurrentValue=SortedValue';
for loop1=1:RobotNum
CurrentValue=[CurrentValue RealValue(RobotNum+Sequence(loop1))];
end;
NewValue=[NewValue;CurrentValue];
end;
NewChrom=getchrom(NewValue);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?