clc;clear;%各份订单基本数据phen=[1 2 3 4 5 6 7 8 9 10 11 12 13 14 41,52,-23,-46,-143,-74,-56,101,73,74,95,86,-35,32 65,23,-76,104,34,38,4,-23,55,-49,39,89,-86,52 7716,9887,12188,8819,4002,6119,3284,4607,5600,4587,9821,13024,6547,2684 500,400,1000,120,0,235,654,241,0,361,120,254,300,150 1,4,2,2,4,4,3,3,3,1,4,5,1,3 2
4,8]; hromlength=14; popsize=30; maxgen=500; pc=0
8; pm=0
04; for kem=1:popsizepopulation(kem,:)=randperm(hromlength); endpopulation;%评价目标函数值for uim=1:popsize vector=population(uim,:); obj(uim)=hanshu(hromlength,vector,phen);end%obj%min(obj)clear uim;objmin=min(obj);for sequ=1:popsize if obj(sequ)==objmin opti=population(sequ,:); endendclear sequ;fmax=22000;%==for gen=1:maxgen%选择操作%将求最小值的函数转化为适应度函数for indivi=1:popsize obj1(indivi)=1/obj(indivi);