diff --git a/docs/src/crossover.md b/docs/src/crossover.md index d0524dc..0bb445d 100644 --- a/docs/src/crossover.md +++ b/docs/src/crossover.md @@ -76,4 +76,4 @@ Evolutionary.crosstree [^5]: K. Deep, K. P. Singh, M. L. Kansal, and C. Mohan, "A real coded genetic algorithm for solving integer and mixed integer optimization problems.", Appl. Math. Comput. 212, 505-518, 2009 -[^6] K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995 +[^6]: K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995 diff --git a/docs/src/mutation.md b/docs/src/mutation.md index 6124796..9825770 100644 --- a/docs/src/mutation.md +++ b/docs/src/mutation.md @@ -92,4 +92,4 @@ shrink [^8]: P. J. Angeline, "An investigation into the sensitivity of genetic programming to the frequency of leaf selection during subtree crossover", Genetic Programming 1996: Proceedings of the First Annual Conference, 21–29, 1996. -[^9] K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995 \ No newline at end of file +[^9]: K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995 \ No newline at end of file diff --git a/src/mutations.jl b/src/mutations.jl index 911c8d2..b9ce105 100644 --- a/src/mutations.jl +++ b/src/mutations.jl @@ -250,7 +250,7 @@ function PLM(Δ::Vector, η=2; pm::Real=NaN) # index of distribution p end return mutation end -PLM(lower::Vector, upper::Vector, η::Real = 2; pm::Real=NaN) = PLM(upper-lower, η; pm) +PLM(lower::Vector, upper::Vector, η::Real = 2; pm::Real=NaN) = PLM(upper-lower, η; pm=pm) # Combinatorial mutations (applicable to binary vectors) diff --git a/src/recombinations.jl b/src/recombinations.jl index 4050b09..60e1bf8 100644 --- a/src/recombinations.jl +++ b/src/recombinations.jl @@ -288,11 +288,12 @@ function MILX(μ::Real = 0.0, b_real::Real = 0.15, b_int::Real = 0.35) # locatio end """ - LX(μ::Real = 0.0, b::Real = 0.2) + SBX(pm::Real = 0.5, η::Integer = 2) -Returns a Simulated Binary Crossover (SBX) recombination operation[^6], see [Recombination Interface](@ref). +Returns a Simulated Binary Crossover (SBX) recombination operation, see [Recombination Interface](@ref), +with the mutation probability `pm` of the recombinant component, and is the crossover distribution index `η`[^6]. """ -function SBX(p::Real = 0.5, η::Integer = 2) +function SBX(pm::Real = 0.5, η::Integer = 2) function sbxv(v1::T, v2::T; rng::AbstractRNG=Random.GLOBAL_RNG) where {T <: AbstractVector} n = length(v1) u = rand(rng, n) @@ -304,7 +305,7 @@ function SBX(p::Real = 0.5, η::Integer = 2) μ = (v1 + v2)./2 diff = v1 - v2 c = β.*diff./2 - mask_set = n == 1 ? [1] : rand(rng, n) .<= p + mask_set = n == 1 ? [1] : rand(rng, n) .<= pm c1 = copy(μ) # c2 = μ - c c1[mask_set] .-= c[mask_set] c2 = copy(μ) # c2 = μ + c