361Appendix B
child2(1:cross_o_pos) = parent1(1:cross_o_pos);
child2(cross_o_pos+1:string) = parent2(cross_o_pos+1:string);
else
pois_ra = rand(1);
if(pois_ra<0.1353)no_of_cross_over = 0;
end
if(pois_ra>=0.1353 & pois_ra<0.4059)no_of_cross_over = 1;
end
if(pois_ra>=0.4059 & pois_ra<0.6865)no_of_cross_over = 2;
end
if(pois_ra>=0.6865 & pois_ra<0.8769)no_of_cross_over = 3;
end
if(pois_ra>=0.8769)no_of_cross_over = 3;
end
switch no_of_cross_over
case 0
child1(1:string) = parent1(1:string);
child2(1:string) = parent2(1:string);
case 1
cross_o_pos = round(random('unif',1.5,string+0.5-1));
child1(1:cross_o_pos) = parent2(1:cross_o_pos);
child1(cross_o_pos+1:string) = parent1(cross_o_pos+1:string);
child2(1:cross_o_pos) = parent1(1:cross_o_pos);
child2(cross_o_pos+1:string) ...