mosmafs (version 0.1.2)

mutBitflipCHW: Bitflip (Approximately, in Expectation) Conserving Hamming Weight

Description

If a given bitvector has m 1s and n 0s, then a bit is flipped from 0 to 1 with probability 2p(m+1)/(m+n+2) and from 1 to 0 with probability 2p(n+1)/(m+n+2). This is equivalent with choosing bits uniformly at random with probability 2 * p and drawing them from a bernoulli-distribution with parameter (m+1)/(m+n+2).

Usage

mutBitflipCHW(ind, p = 0.1, ...)

Value

[integer] mutated binary individual.

Arguments

ind

[integer] binary individual.

p

[numeric] average flip probability, must be between 0 and 0.5.

...

further arguments passed on to the method.