Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial guess of type Vector{Any} #210

Open
Jonas-a-Zimmermann opened this issue Feb 13, 2023 · 0 comments
Open

Initial guess of type Vector{Any} #210

Jonas-a-Zimmermann opened this issue Feb 13, 2023 · 0 comments

Comments

@Jonas-a-Zimmermann
Copy link

When giving and Initialguess Vector and an Searchspace,
if the initial guess is of type Vector{Any} the execution errors with:

MethodError: no method matching iterate(::ContinuousRectSearchSpace)
Closest candidates are:
iterate(::Union{LinRange, StepRangeLen}) at range.jl:872
iterate(::Union{LinRange, StepRangeLen}, ::Integer) at range.jl:872
iterate(::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}} at dict.jl:712

What I would expect is something like:

Assertion Error: Initial guess must be of type Vector{Float}

or it to just run. (create a Vector of type Vector{Float})

Minimal Reproducing Example

using BlackBoxOptim

function f(x)
    #dummy function to fit
    return sum(x)
end

#e.g. Read data From file 
x0 = []
push!(x0, 1.2)

bboptimize(f, x0; SearchRange = [(0., 1.5)])

This could be fixed by e.g. calling BlackBoxOptim.Individual on the input x0, or an assertion to inform the user to make the call themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant