edwinb-ai / BioMetaheuristics.jl

Implementation for nature and bio-inspired optimization algorithms in pure Julia.
https://edwinb-ai.github.io/BioMetaheuristics.jl/dev/
MIT License
2 stars 0 forks source link

API refactor for specifying search bounds #38

Open edwinb-ai opened 4 years ago

edwinb-ai commented 4 years ago

As of right now, the API is kind of clunky. For instance, this snippet of code

dimension = 2

ground_truth = 0.0

val = GeneralSimulatedAnnealing(
            rosenbrock2d, -5.0, 5.0, dimension;
            low_temp = 30000,
            seed = RANDOM_SEED,
)

@show val

should instead take as input an array (preferably an StaticArray) in order to parse the bounds for the search space, instead of just taking two parameters, in this case -5.0 and 5.0. Also, in this same thought, every dimension should have the ability of specifying their respective bounds, instead of a single array for the bounds, which would imply that the search space is the same for every dimension, which is sometimes the case, but in other applications it is most certainly not.

These changes and refactors should happen before v1.0 as this API needs to be stable enough to be used in more diverse scenarios.

edwinb-ai commented 3 years ago

While working on #46 I wanted to work on this very issue. It turns out that to specify the search bounds, we are essentially asking for box constrained optimization This, of course, is not part of the first, final, stable version of the package. I might leave this PR open, but this shouldn't be needed for the v1.0 version.