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

ERROR: No set_candidates! method defined for BlackBoxOptim.GeneratingSetSearcher #211

Open
hiiroo opened this issue Mar 20, 2023 · 1 comment

Comments

@hiiroo
Copy link

hiiroo commented Mar 20, 2023

Hello everyone and thanks for the great library! I have a problem with starting an optimization for probabilistic_descent with initial candidates: code sample and the stack trace given below. I am using Julia 1.9 rc right now. I can give you more details if you need them. vInitial is a vector of length 24.

res = bboptimize(fitnessfunc, [vInitial];
	Method=:probabilistic_descent,
	SearchRange = (-2, 2),
	NumDimensions = 24,
	MaxSteps=100,
	TargetFitness=(0.0)
)

and, the stack trace;

ERROR: No set_candidates! method defined for BlackBoxOptim.GeneratingSetSearcher{BlackBoxOptim.ProblemEvaluator{Float64, Float64, TopListArchive{Float64, ScalarFitnessScheme{true}}, FunctionBasedProblem{var"#157#159"{Vector{∅}}, ScalarFitnessScheme{true}, ContinuousRectSearchSpace, Float64}}, BlackBoxOptim.MirroredRandomDirectionGen, RandomBound{ContinuousRectSearchSpace}}
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] set_candidates!(o::BlackBoxOptim.GeneratingSetSearcher{BlackBoxOptim.ProblemEvaluator{Float64, Float64, TopListArchive{Float64, ScalarFitnessScheme{true}}, FunctionBasedProblem{var"#157#159"{Vector{∅}}, ScalarFitnessScheme{true}, ContinuousRectSearchSpace, Float64}}, BlackBoxOptim.MirroredRandomDirectionGen, RandomBound{ContinuousRectSearchSpace}}, x0::Vector{Vector{Float64}})
    @ BlackBoxOptim ~/.julia/packages/BlackBoxOptim/I3lfp/src/optimizer.jl:102
  [3] bboptimize(optctrl::BlackBoxOptim.OptController{BlackBoxOptim.GeneratingSetSearcher{BlackBoxOptim.ProblemEvaluator{Float64, Float64, TopListArchive{Float64, ScalarFitnessScheme{true}}, FunctionBasedProblem{var"#157#159"{Vector{∅}}, ScalarFitnessScheme{true}, ContinuousRectSearchSpace, Float64}}, BlackBoxOptim.MirroredRandomDirectionGen, RandomBound{ContinuousRectSearchSpace}}, FunctionBasedProblem{var"#157#159"{Vector{∅}}, ScalarFitnessScheme{true}, ContinuousRectSearchSpace, Float64}}, x0::Vector{Vector{Float64}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ BlackBoxOptim ~/.julia/packages/BlackBoxOptim/I3lfp/src/bboptimize.jl:75
  [4] bboptimize(optctrl::BlackBoxOptim.OptController{BlackBoxOptim.GeneratingSetSearcher{BlackBoxOptim.ProblemEvaluator{Float64, Float64, TopListArchive{Float64, ScalarFitnessScheme{true}}, FunctionBasedProblem{var"#157#159"{Vector{∅}}, ScalarFitnessScheme{true}, ContinuousRectSearchSpace, Float64}}, BlackBoxOptim.MirroredRandomDirectionGen, RandomBound{ContinuousRectSearchSpace}}, FunctionBasedProblem{var"#157#159"{Vector{∅}}, ScalarFitnessScheme{true}, ContinuousRectSearchSpace, Float64}}, x0::Vector{Vector{Float64}})
    @ BlackBoxOptim ~/.julia/packages/BlackBoxOptim/I3lfp/src/bboptimize.jl:64
  [5] bboptimize(functionOrProblem::Function, x0::Vector{Vector{Float64}}, parameters::Dict{Symbol, ∅}; kwargs::Base.Pairs{Symbol, ∅, NTuple{6, Symbol}, NamedTuple{(:Method, :SearchRange, :ϵ, :NumDimensions, :MaxSteps, :TargetFitness), Tuple{Symbol, Tuple{Int64, Int64}, Float64, Int64, Int64, Float64}}})
    @ BlackBoxOptim ~/.julia/packages/BlackBoxOptim/I3lfp/src/bboptimize.jl:88
  [6] bboptimize
    @ ~/.julia/packages/BlackBoxOptim/I3lfp/src/bboptimize.jl:86 [inlined]
@hoasxyz
Copy link

hoasxyz commented Apr 6, 2023

@hiiroo In the Borg MOEA, it runs successfully with a single initial solution. But when setting multiple initial solutions, I encounter a problem similar to yours:

Success

res_his_borg = bboptimize(maximin_operator, initial_pop_sim[1]; Method = :borg_moea, FitnessScheme = ParetoFitnessScheme{3}(is_minimizing = false), 
                    SearchRange = vcat(repeat([(400.0, 24000.0)], 20), repeat([(0.01, 1.0)], 25), repeat([(-1.0, 1.0)], 25), repeat([(0.0, 1.0)], 2)),  NumDimensions = 72,
                    MaxTime = 60, # MaxFuncEvals = 20000, MaxSteps = 50000, PopulationSize = 100, 
                    ϵ = [4, 30, 0.5], TraceInterval = 1.0, TraceMode = :compact);

Fail

res_his_borg = bboptimize(maximin_operator, initial_pop_sim; Method = :borg_moea, FitnessScheme = ParetoFitnessScheme{3}(is_minimizing = false), 
                    SearchRange = vcat(repeat([(400.0, 24000.0)], 20), repeat([(0.01, 1.0)], 25), repeat([(-1.0, 1.0)], 25), repeat([(0.0, 1.0)], 2)),  NumDimensions = 72,
                    MaxTime = 60, # MaxFuncEvals = 20000, MaxSteps = 50000, PopulationSize = 100, 
                    ϵ = [4, 30, 0.5], TraceInterval = 1.0, TraceMode = :compact);

with

ERROR: No set_candidates! method defined for BlackBoxOptim.BorgMOEA{EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}, BlackBoxOptim.ProblemEvaluator{Tuple{Float64, Float64, Float64}, IndexedTupleFitness{3, Float64}, EpsBoxArchive{3, Float64, EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}}, FunctionBasedProblem{typeof(maximin_operator), ParetoFitnessScheme{3, Float64, false, typeof(sum)}, ContinuousRectSearchSpace, Nothing}}, FitPopulation{IndexedTupleFitness{3, Float64}}, FixedGeneticOperatorsMixture, RandomBound{ContinuousRectSearchSpace}}
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] set_candidates!(o::BlackBoxOptim.BorgMOEA{EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}, BlackBoxOptim.ProblemEvaluator{Tuple{Float64, Float64, Float64}, IndexedTupleFitness{3, Float64}, EpsBoxArchive{3, Float64, EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}}, FunctionBasedProblem{typeof(maximin_operator), ParetoFitnessScheme{3, Float64, false, typeof(sum)}, ContinuousRectSearchSpace, Nothing}}, FitPopulation{IndexedTupleFitness{3, Float64}}, FixedGeneticOperatorsMixture, RandomBound{ContinuousRectSearchSpace}}, x0::Vector{Vector{Float64}})
   @ BlackBoxOptim E:\.julia\packages\BlackBoxOptim\I3lfp\src\optimizer.jl:102
 [3] bboptimize(optctrl::BlackBoxOptim.OptController{BlackBoxOptim.BorgMOEA{EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}, BlackBoxOptim.ProblemEvaluator{Tuple{Float64, Float64, Float64}, IndexedTupleFitness{3, Float64}, EpsBoxArchive{3, Float64, EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}}, FunctionBasedProblem{typeof(maximin_operator), ParetoFitnessScheme{3, Float64, false, typeof(sum)}, ContinuousRectSearchSpace, Nothing}}, FitPopulation{IndexedTupleFitness{3, Float64}}, FixedGeneticOperatorsMixture, RandomBound{ContinuousRectSearchSpace}}, FunctionBasedProblem{typeof(maximin_operator), ParetoFitnessScheme{3, Float64, false, typeof(sum)}, ContinuousRectSearchSpace, Nothing}}, x0::Vector{Vector{Float64}}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ BlackBoxOptim E:\.julia\packages\BlackBoxOptim\I3lfp\src\bboptimize.jl:75
 [4] bboptimize(optctrl::BlackBoxOptim.OptController{BlackBoxOptim.BorgMOEA{EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}, BlackBoxOptim.ProblemEvaluator{Tuple{Float64, Float64, Float64}, IndexedTupleFitness{3, Float64}, EpsBoxArchive{3, Float64, EpsBoxDominanceFitnessScheme{3, Float64, false, typeof(sum)}}, FunctionBasedProblem{typeof(maximin_operator), ParetoFitnessScheme{3, Float64, false, typeof(sum)}, ContinuousRectSearchSpace, Nothing}}, FitPopulation{IndexedTupleFitness{3, Float64}}, FixedGeneticOperatorsMixture, RandomBound{ContinuousRectSearchSpace}}, FunctionBasedProblem{typeof(maximin_operator), ParetoFitnessScheme{3, Float64, false, typeof(sum)}, ContinuousRectSearchSpace, Nothing}}, x0::Vector{Vector{Float64}})
   @ BlackBoxOptim E:\.julia\packages\BlackBoxOptim\I3lfp\src\bboptimize.jl:64
 [5] bboptimize(functionOrProblem::Function, x0::Vector{Vector{Float64}}, parameters::Dict{Symbol, Any}; kwargs::Base.Pairs{Symbol, Any, NTuple{8, Symbol}, NamedTuple{(:Method, :FitnessScheme, :SearchRange, :NumDimensions, :MaxTime, :ϵ, :TraceInterval, :TraceMode), Tuple{Symbol, ParetoFitnessScheme{3, Float64, false, typeof(sum)}, Vector{Tuple{Float64, Float64}}, Int64, Int64, Vector{Float64}, Float64, Symbol}}})
   @ BlackBoxOptim E:\.julia\packages\BlackBoxOptim\I3lfp\src\bboptimize.jl:88
 [6] top-level scope
   @ e:\1WHU\item\jsj\Operation_jxsk_newvfh_newsim_parallel_borg.jl:559

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

2 participants