1- export AbstractSolver
1+ export AbstractSolver, solve!, parameters
22
33"""
44 AbstractSolver
@@ -17,14 +17,51 @@ function solve!(::AbstractSolver, ::AbstractNLPModel) end
1717
1818"""
1919 named_tuple = parameters(solver)
20+ named_tuple = parameters(SolverType)
21+ named_tuple = parameters(SolverType{T})
2022
21- Return the parameters of `solver`.
23+ Return the parameters of a `solver`, or of the type `SolverType`.
24+ You can specify the type `T` of the `SolverType`.
25+ The returned structure is a nested NamedTuple.
26+ Each key of `named_tuple` is the name of a parameter, and its value is a NamedTuple containing
27+ - `default`: The default value of the parameter.
28+ - `type`: The type of the parameter, which can any of:
29+ - `:real`: A continuous value within a range
30+ - `:log`: A continuous value that should be explorer logarithmically around it's lower value (usually 0) to avoid the bound itself.
31+ - `:int`: Integer value.
32+ - `:bool`: Boolean value.
33+ - `min`: Minimum value (may not be included for some parameter types).
34+ - `max`: Maximum value.
2235"""
23- function parameters (:: AbstractSolver ) end
36+ function parameters (:: Type{AbstractSolver{T}} ) where T end
37+
38+ parameters (:: Type{S} ) where S <: AbstractSolver = parameters (S{Float64})
39+ parameters (solver :: AbstractSolver ) = parameters (typeof (solver))
2440
2541"""
2642 nlp = parameter_problem(solver)
2743
2844Return the problem associated with the tuning of the parameters of `solver`.
2945"""
30- function parameter_problem (:: AbstractSolver ) end
46+ function parameter_problem (:: AbstractSolver ) end
47+
48+ # parameter_problem(
49+ # solver::DummySolver,
50+ # problems,
51+ # cost,
52+ # cost_bad
53+ # ) = ADNLPModel(
54+ # x -> begin
55+ # total_cost = 0.0
56+ # for nlp in problems
57+ # try
58+ # output = with_logger(NullLogger()) do
59+ # output, _ = DummySolver(nlp)
60+ # end
61+ # total_cost += cost(output)
62+ # catch
63+ # total_cost +=
64+ # end
65+ # end
66+ # end
67+ # )
0 commit comments