📄 falloc1.m
字号:
function PI=falloc1(x)
% Allocation process and fitness evaluation
global MIN_offset MUL_factor MTX MAX MAXV OFFSET
% Get the numbers of items
x=10.^x;
x=fix(x);
I=find(x<10 & x>0);
if ~isempty(I)
x(I)=10*ones(size(I));
end
% Get the constraint matrix
%x=[151 0 0 264 0];
temp=x*MTX;
PI=temp(4);
if temp(1)>MAXV(1), PI=PI-1000*(temp(1)-MAXV(1)); end;
if temp(2)>MAXV(2), PI=PI-1000*(temp(2)-MAXV(2)); end;
if temp(3)>MAXV(3), PI=PI-1000*(temp(3)-MAXV(3)); end;
%PI=(0.0025*PI);
PI=PI-OFFSET;
if PI>0
PI=PI^2;
else
PI=0.5;
end
attached_part;
% Save data
if PI>MAX
MAX=PI; save tempx x
fprintf('x=[%3i %3i %3i %3i %3i]\n',x(1),x(2),x(3),x(4),x(5));
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -