GA . . , , ( ) , , . , . , , (, , ). , . .
, , , , Osama ALASSIRY, : UUUULLLLLLLLDDDRRRDLLLLLLLLLLUUULUUU.
:
- 1 ,
- x1, y1, x1, y1 = < lenght1 x1!= y1 ( 1),
- 2, (x1, y1) (x2, y2),
- 1, x1 y1, 2 x2 y2. Individual 2 , x1y1 x2y2 , ,
- , 2 x2y2, 1 x1y1 ( ),
:
parent A: UUUULLLLLLLLDDDRRRLLLLLLLLLLLLUUULUUU
B: DRRRRLULUDDDR
pairA (4,18), pairB (0,5)
, 0, :
UUUU LLLLLLLLDDDRRRD LLLLLLLLLLUUUULUUU
DRRRRL ULUDDDR
,
UUUU DRRRRL LLLLLLLLLLUUUULUUU
LLLLLLLLDDDRRRD ULUDDDR
. .
:
- 0 ,
- generate a number between 1-4 and update this gene. (if 1 was generated, change it to U, 2-D, 3-L, 4-R)
you just made a mutation. You can also mutate more than one gene.
But, as I said, there are other possibilities.
source
share