Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ margin = 200
remove_extra_newlines = true
trailing_zero = false
join_lines_based_on_source = true
whitespace_in_kwargs = false
whitespace_in_kwargs = false
annotate_untyped_fields_with_any = false
align_assignment = true
align_struct_field = true
align_conditional = true
align_pair_arrow = true
align_matrix = true
15 changes: 2 additions & 13 deletions docs/src/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,11 @@ with ``a = 20``, ``b = 0.2``, ``c = 2π``, and global minimum at ``x=0``.

```@example
using MetaheuristicsAlgorithms
using Statistics: mean

function Ackley(x::Vector{Float64})::Float64
a = 20.0
b = 0.2
c = 2π

term1 = -a * exp(-b * sqrt(mean(x.^2)))
term2 = -exp(mean(cos.(c * x)))

return term1 + term2 + a + exp(1)
end
import MetaheuristicsAlgorithms as MA

lb = [-32.768 for _ = 1:5]
ub = [ 32.768 for _ = 1:5]
result = AEO(Ackley, lb, ub, 100, 1000)
result = AEO(MA.Ackley, lb, ub, 100, 1000)
convergence_curve(result)
```

Expand Down
3 changes: 2 additions & 1 deletion src/MetaheuristicsAlgorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using Random,
# abstract type OptimizationResult end

struct OptimizationResult
bestX::Vector
bestX::Vector{Float64}
bestF::Float64
his_best_fit::Vector{Float64}
end
Expand Down Expand Up @@ -142,6 +142,7 @@ include("algo/SSA.jl")
include("algo/STOA.jl")
include("algo/SuperbFOA.jl")
include("algo/SupplyDO.jl")
include("algo/THRO.jl")
include("algo/TLBO.jl")
include("algo/TLCO.jl")
include("algo/TOC.jl")
Expand Down
Loading
Loading