You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A modified metaheuristic can extend the capability of an implemented algorithm.
The idea is to define custom components (initialization, termination criterion, etc) without overwriting default methods.
Thank you for the suggestion. The idea is to modify a Julia method for a specific metaheuristic without overwriting the implemented methods (avoid type piracy). For example, I wanted to modify ECA in order to implement o re-use some termination criteria, but the following is a problem.
julia> algo =ECA()
julia> Metaheuristics.stop_criteria!(st, params::ECA, info, opt, args...; kargs...) =error("I modified all ECA instances")
julia>optimize(sum, [-5; 5;;], algo)
ERROR: I modified all ECA instances
...
julia>optimize(sum, [-5; 5;;], ECA)
ERROR: I modified all ECA instances
Therefore, we must find a way (simple to use for the user) to modify only one instance of the algorithm.
However, I can't figure out how to do it. The following is a utopian implementation:
eca_modified =modify(ECA(), some_method =SomeParams())
Metaheuristics.some_method(params::SomeParams) =println("I'm not ECA")
# original implementation# Metaheuristics.some_method(params::ECA) = println("I'm ECA")optimize(sum, [5;5;;], eca_modified)
# I'm not ECAoptimize(sum, [5;5;;], ECA)
# I'm ECA
A modified metaheuristic can extend the capability of an implemented algorithm.
The idea is to define custom components (initialization, termination criterion, etc) without overwriting default methods.
For instance:
optimize(f, bounds, eca_modified)
The text was updated successfully, but these errors were encountered: