Skip to content

Commit b925a2c

Browse files
committed
fixed docs refs and kw parameter for older Julia versions
1 parent 32df361 commit b925a2c

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

docs/src/crossover.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,4 @@ Evolutionary.crosstree
7676

7777
[^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
7878

79-
[^6] K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995
79+
[^6]: K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995

docs/src/mutation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ shrink
9292

9393
[^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.
9494

95-
[^9] K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995
95+
[^9]: K. Deb, R. B. Agrawal, "Simulated Binary Crossover for Continuous Search Space", Complex Syst., 9., 1995

src/mutations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function PLM(Δ::Vector, η=2; pm::Real=NaN) # index of distribution p
250250
end
251251
return mutation
252252
end
253-
PLM(lower::Vector, upper::Vector, η::Real = 2; pm::Real=NaN) = PLM(upper-lower, η; pm)
253+
PLM(lower::Vector, upper::Vector, η::Real = 2; pm::Real=NaN) = PLM(upper-lower, η; pm=pm)
254254

255255

256256
# Combinatorial mutations (applicable to binary vectors)

src/recombinations.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,12 @@ function MILX(μ::Real = 0.0, b_real::Real = 0.15, b_int::Real = 0.35) # locatio
288288
end
289289

290290
"""
291-
LX(μ::Real = 0.0, b::Real = 0.2)
291+
SBX(pm::Real = 0.5, η::Integer = 2)
292292
293-
Returns a Simulated Binary Crossover (SBX) recombination operation[^6], see [Recombination Interface](@ref).
293+
Returns a Simulated Binary Crossover (SBX) recombination operation, see [Recombination Interface](@ref),
294+
with the mutation probability `pm` of the recombinant component, and is the crossover distribution index `η`[^6].
294295
"""
295-
function SBX(p::Real = 0.5, η::Integer = 2)
296+
function SBX(pm::Real = 0.5, η::Integer = 2)
296297
function sbxv(v1::T, v2::T; rng::AbstractRNG=Random.GLOBAL_RNG) where {T <: AbstractVector}
297298
n = length(v1)
298299
u = rand(rng, n)
@@ -304,7 +305,7 @@ function SBX(p::Real = 0.5, η::Integer = 2)
304305
μ = (v1 + v2)./2
305306
diff = v1 - v2
306307
c = β.*diff./2
307-
mask_set = n == 1 ? [1] : rand(rng, n) .<= p
308+
mask_set = n == 1 ? [1] : rand(rng, n) .<= pm
308309
c1 = copy(μ) # c2 = μ - c
309310
c1[mask_set] .-= c[mask_set]
310311
c2 = copy(μ) # c2 = μ + c

0 commit comments

Comments
 (0)