⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 falloc.m

📁 其中提到遺傳學的程式碼與應用提供給次淚相向的研究者參考下載
💻 M
字号:
function PI=falloc(chro)
% Allocation process and fitness evaluation

global MIN_offset MUL_factor MTX MAX
% Get the numbers of items
x=chro;
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];
%x=[151 0 0 264 0];
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;
%PI=(0.0025*PI);
PI=PI-450;
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',x1,x2,x3,x4,x5);
else
    %fprintf('>');
end

⌨️ 快捷键说明

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