This preview shows page 1. Sign up to view the full content.
Unformatted text preview: gen = 0; % Generational Loop while gen < MAXGEN, % Assign Fitness values to entire population FitnV = ObjV; % Select individuals from population SelCh = select(‘rws’, Chrom, FitnV, GGAP); % Recombine selected individuals (crossover) SelCh= xovsp(SelCh, 0.9); % Mutate offspring SelCh = mut(SelCh,0.01); % Evaluate the objective values of offspring ObjVSel = obj1(bs2rv(SelCh, FieldD)); % Insert offspring in population replacing parents. % Rein is designed for minimization problem in the toolbox [Chrom ObjV] = reins(Chrom, SelCh, 1, 1, -ObjV, -ObjVSel); ObjV = -ObjV; % counter increment gen=gen+1; end; Appendix 2: obj1.m % % OBJ1.M (Objective function for CASE 1) % function ObjVal = obj1(Pheno); ObjVal = Pheno .* sin(10*pi*Pheno)+2.0;...
View Full Document
This note was uploaded on 05/01/2011 for the course ELECTRICAL EE5602 taught by Professor Xuequan during the Spring '11 term at City University of Hong Kong.
- Spring '11