if ((chromsize >= 16) && (randO < (RANDMAX/3))) // Two point?
*crosspt = -*crosspt
pa = p1 ;
pb = p2 ;
} // If first child
else {
pa = p2 ;
pb = p1 ;
}
// flag this for second child
// Second child
// so parents reverse roles
Γ
Ί
Prepare for reproduction
if
('split)
{
right = 1 ;
i = *split ;
while (-i)
right = (right « 1) | 1
left = 255
Λ
right ;
}
if fcrosspt > 0) {
n1 = chromsize / 2 ;
n2 = chromsize - n1 ;
n3 = n4 = 0 ;
i = *crosspt -1 ;
}
// Create left, right splitting masks
// Use one point crossove ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.