Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function
A function which performs binary mutation
[Mut_Indiv, pos] = mutation_ga_binary(Indiv,param)
The individual on which we will perform the mutation.
a list of parameters.
"binary_length": an integer scalar, the size of the binary code.
"multi_mut": a boolean. If %T, several random bits will be flipped.
"multi_mut_nb": an integer scalar, the number of bits to be flipped. Only used when multi_mut is set to %T (default 2).
The mutated individual.
A vector of integers.
The positions of the mutated bits.
This function performs a classical multi-bits binary mutation.
This generates the individual
Mut_Indiv by inverting bits on random positions.
mutation_ga_binary(Indiv) selects randomly
i between 1 and
It then modifies the i-th character of Indiv to 1 if it was 0, or 0 if it was 1.
"multi_mut" is set to
%T multiple mutations may occur.
The maximal number of mutation is given by
Random number generator
mutation_ga_binary is based
for generating the random samples.
grand("setsd", seed) to change the seed
Indiv="00010000" [Mut_Indiv, pos] = mutation_ga_binary(Indiv) // With multiple mutation param=init_param("multi_mut",%t,"multi_mut_nb",3); Indiv="00010000" [Mut_Indiv, pos] = mutation_ga_binary(Indiv,param)