powered by
SM is the reciprocal exchange of the values of two randomly selected genes on the chromosome (Banzhaf, 1990).
This operator is used in problems with permutation or binary encoding.
swapmut(y, ...)
A vector. Chromosome of the offspring
Further arguments passed to or from other methods.
A vector. The numbers of the mutated genes.
Banzhaf, W. (1990). The "molecular" traveling salesman. Biological Cybernetics, 64(1), 7-14.
mutate, bitmut, randmut, randmut2, randmut3, randmut4, unimut, boundmut, nunimut, nunimut2, powmut, powmut2, gaussmut, gaussmut2, gaussmut3, bsearchmut1, bsearchmut2, invmut, shufmut, insmut, dismut, invswapmut, insswapmut, invdismut
mutate
bitmut
randmut
randmut2
randmut3
randmut4
unimut
boundmut
nunimut
nunimut2
powmut
powmut2
gaussmut
gaussmut2
gaussmut3
bsearchmut1
bsearchmut2
invmut
shufmut
insmut
dismut
invswapmut
insswapmut
invdismut
# NOT RUN { offspring = c(1, 2, 3, 4, 5, 6, 7, 8, 9) swapmut(offspring) # }
Run the code above in your browser using DataLab