📄 ps_falloc.m
字号:
function PIs=PS_falloc(chro)
% Allocation process and fitness evaluation
% Use with PS_alloc.m file
% PenChen Chou. 2005-4-18.
global MTX MAX
% Get the numbers of items
[M,N]=size(chro);PIs=[];
for i=1:M
x=chro(i,:);
x=10.^x;
x1=fix(x(1));
x2=fix(x(2));
x3=fix(x(3));
x4=fix(x(4));
x5=fix(x(5));
if x1<10 & x1>0, x1=10; end;
if x2<10 & x2>0, x2=10; end;
if x3<10 & x3>0, x3=10; end;
if x4<10 & x4>0, x4=10; end;
if x5<10 & x5>0, x5=10; end;
% Get the constraint matrix
x=[x1 x2 x3 x4 x5];
temp=x*MTX;
PI=temp(4);
if temp(1)>70000, PI=PI-1000*(temp(1)-70000); end;
if temp(2)>200000, PI=PI-1000*(temp(2)-200000); end;
if temp(3)> 3000, PI=PI-1000*(temp(3)-3000); end;
% Save data
if PI>MAX
MAX=PI; save tempx x
%fprintf('x=[%3i %3i %3i %3i %3i], PI=%.6f\n',x1,x2,x3,x4,x5,PI);
else
%fprintf('>');
end
PIs=[PIs;PI];
end % i=
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -