API Reference
This reference presents the docstrings of the types and functions shared by the benchmark problems, including their signatures, arguments, and behavior. For workflows that connect these APIs, see Evaluation and Derivatives and Catalog and Metadata.
Evaluation
General constraints use the representation $l_c \leq c(x) \leq u_c$, stored in prob.lcon and prob.ucon. Rows with equal lower and upper bounds are equalities; all other rows are inequalities. Objective and constraint derivatives have separate evaluation functions.
Derivative metadata records whether an analytical evaluator is registered; it does not assert differentiability at every boundary point of a benchmark's domain. Family pages document problem-specific restrictions, and registered evaluators may throw a DomainError where an analytical derivative is undefined.
MOProblems.eval_f — Function
eval_f(prob::MOProblem, x::AbstractVector{T})Evaluate all objective functions of prob at x.
x must have length prob.nvar. The returned vector has length prob.nobj and element type T.
eval_f(prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the i-th objective function of prob at x.
x must have length prob.nvar, and i must be between 1 and prob.nobj. The returned scalar has type T.
MOProblems.eval_f! — Function
eval_f!(y, prob::MOProblem, x::AbstractVector{T})Evaluate all objective functions of prob at x and write the result to y.
x must have length prob.nvar, and y must have length prob.nobj. Values are stored using the numeric type T of x.
Returns y.
MOProblems.eval_c — Function
eval_c(prob::MOProblem, x::AbstractVector{T})Evaluate the constraint mapping c(x).
The returned vector has length prob.ncon and element type T. An unconstrained problem returns an empty vector.
eval_c(prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the i-th constraint function at x.
MOProblems.eval_c! — Function
eval_c!(values, prob::MOProblem, x::AbstractVector{T})Evaluate the constraint mapping c(x) and write it to values.
x must have length prob.nvar, and values must have length prob.ncon. Each constraint is interpreted together with prob.lcon and prob.ucon as prob.lcon[i] <= c_i(x) <= prob.ucon[i].
Returns values.
MOProblems.eval_jacobian — Function
eval_jacobian(prob::MOProblem, x::AbstractVector{T})Evaluate the Jacobian matrix of the objective functions at x.
x must have length prob.nvar. The returned matrix has size (prob.nobj, prob.nvar) and element type T; each row is the gradient of one objective.
Throws an error if prob has no registered analytical Jacobian.
MOProblems.eval_jacobian! — Function
eval_jacobian!(J, prob::MOProblem, x::AbstractVector{T})Evaluate the registered Jacobian matrix of the objective functions at x and write the result to J.
x must have length prob.nvar, and J must have size (prob.nobj, prob.nvar). Each row of J is the gradient of one objective.
Returns J. Throws an error if prob has no registered analytical Jacobian.
MOProblems.eval_jacobian_row — Function
eval_jacobian_row(prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the i-th row of the Jacobian matrix at x.
x must have length prob.nvar, and i must be between 1 and prob.nobj. The returned vector has length prob.nvar and element type T.
Throws an error if prob has no registered analytical Jacobian.
MOProblems.eval_jacobian_row! — Function
eval_jacobian_row!(row, prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the i-th row of the Jacobian matrix at x and write the result to row.
x and row must both have length prob.nvar, and i must be between 1 and prob.nobj.
Returns row. Throws an error if prob has no registered analytical Jacobian.
MOProblems.eval_constraint_jacobian — Function
eval_constraint_jacobian(prob::MOProblem, x::AbstractVector{T})Evaluate the registered Jacobian of c(x).
The returned matrix has size (prob.ncon, prob.nvar) and element type T.
MOProblems.eval_constraint_jacobian! — Function
eval_constraint_jacobian!(J, prob::MOProblem, x::AbstractVector{T})Evaluate the registered Jacobian of c(x) and write it to J.
J must have size (prob.ncon, prob.nvar). Each row contains the gradient of one scalar constraint. Throws an error when an analytical constraint Jacobian is not registered.
MOProblems.eval_constraint_jacobian_row — Function
eval_constraint_jacobian_row(prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the gradient of the i-th constraint.
MOProblems.eval_constraint_jacobian_row! — Function
eval_constraint_jacobian_row!(row, prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the gradient of the i-th constraint and write it to row.
MOProblems.eval_hessian — Function
eval_hessian(prob::MOProblem, x::AbstractVector{T})Evaluate the Hessian matrices of all objectives at x.
x must have length prob.nvar. The returned vector has length prob.nobj; each entry is a (prob.nvar, prob.nvar) matrix with element type T.
Throws an error if prob has no registered analytical Hessian.
MOProblems.eval_hessian! — Function
eval_hessian!(Hs, prob::MOProblem, x::AbstractVector{T})Evaluate the Hessian matrices of all objectives at x.
x must have length prob.nvar, Hs must have length prob.nobj, and each entry of Hs must have size (prob.nvar, prob.nvar).
Returns Hs. Throws an error if prob has no registered analytical Hessian.
MOProblems.eval_hessian_row — Function
eval_hessian_row(prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the Hessian matrix of the i-th objective at x.
x must have length prob.nvar, and i must be between 1 and prob.nobj. The returned matrix has size (prob.nvar, prob.nvar) and element type T.
Throws an error if prob has no registered analytical Hessian.
MOProblems.eval_hessian_row! — Function
eval_hessian_row!(H, prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the Hessian matrix of the i-th objective at x and write the result to H.
x must have length prob.nvar, H must have size (prob.nvar, prob.nvar), and i must be between 1 and prob.nobj.
Returns H. Throws an error if prob has no registered analytical Hessian.
MOProblems.eval_constraint_hessian — Function
eval_constraint_hessian(prob::MOProblem, x::AbstractVector{T})Evaluate all registered constraint Hessians.
The returned vector has length prob.ncon; each matrix has size (prob.nvar, prob.nvar) and element type T.
MOProblems.eval_constraint_hessian! — Function
eval_constraint_hessian!(Hs, prob::MOProblem, x::AbstractVector{T})Evaluate all registered constraint Hessians and write them to Hs.
MOProblems.eval_constraint_hessian_row — Function
eval_constraint_hessian_row(prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the registered Hessian of the i-th constraint.
MOProblems.eval_constraint_hessian_row! — Function
eval_constraint_hessian_row!(H, prob::MOProblem, x::AbstractVector{T}, i::Int)Evaluate the registered Hessian of the i-th constraint and write it to H.
Catalog
For a worked example of selecting candidates, interpreting catalog defaults, and constructing an instance, see Catalog and Metadata.
MOProblems.META — Constant
METADictionary mapping each registered problem name to its static ProblemMeta. Treat the dictionary and its entries as read-only; use get_problem_names and filter_problems to query the catalog.
MOProblems.get_problem_names — Function
get_problem_names() -> Vector{String}Return the names of all problems registered in the catalog.
Read static metadata without constructing problem instances. The returned vector is newly allocated, and its order is unspecified.
Examples
using MOProblems
names = get_problem_names()
sort!(names)See also filter_problems.
MOProblems.filter_problems — Function
filter_problems(; <keyword arguments>) -> Vector{String}Return the names of catalog problems satisfying all supplied criteria.
Read static metadata without constructing or evaluating problem instances. The returned vector is newly allocated and sorted lexicographically. With no criteria, return all catalog names; with no matches, return an empty vector.
For filters accepting nothing, this value disables the criterion. Boolean filters set to false require the corresponding property to be false. All numeric limits are inclusive; an interval with its minimum above its maximum has no matches.
Keyword arguments
name_pattern::Union{Nothing, AbstractString, Regex} = nothing: match names usingoccursin. Strings specify literal, case-sensitive substrings; regular expressions follow their own flags. Use anchors for a full-name regular-expression match.min_nvar::Int = 0,max_nvar::Int = typemax(Int): limits on the number of variables in the default instance.min_nobj::Int = 0,max_nobj::Int = typemax(Int): limits on the number of objectives in the default instance. Dimension limits do not search other configurations supported by the constructors.dimension_type::Union{Nothing, Type{<:AbstractDimensionSpec}} = nothing: requiremeta.dimension isa dimension_type.has_bounds::Union{Nothing, Bool} = nothing: whether variable bounds are registered.has_jacobian::Union{Nothing, Bool} = nothing: whether an analytical objective Jacobian evaluator is registered.has_hessian::Union{Nothing, Bool} = nothing: whether an analytical objective Hessian evaluator is registered.min_con_eq::Int = 0,max_con_eq::Int = typemax(Int): limits on the number of general equality constraints, excluding variable bounds.min_con_ineq::Int = 0,max_con_ineq::Int = typemax(Int): limits on the number of general inequality constraints, excluding variable bounds.has_constraint_jacobian::Union{Nothing, Bool} = nothing: whether analytical first derivatives of the constraints are registered.has_constraint_hessian::Union{Nothing, Bool} = nothing: whether analytical second derivatives of the constraints are registered.any_strictly_convex::Union{Nothing, Bool} = nothing: whether at least one objective is marked strictly convex. Withfalse, require none to be marked strictly convex.all_strictly_convex::Union{Nothing, Bool} = nothing: whether all objectives are marked strictly convex. Withfalse, require at least one to be marked not strictly convex.
Derivative registration does not guarantee differentiability at every point of a problem's domain. Consult the family documentation for restrictions.
Problems with unavailable strict-convexity metadata are excluded whenever either strict-convexity filter is requested, including with false. An objective marked not strictly convex may still be convex.
Examples
using MOProblems
filter_problems(name_pattern = r"^ZDT", max_nvar = 10)
filter_problems(has_bounds = true, has_jacobian = true)
filter_problems(any_strictly_convex = true, all_strictly_convex = false)See also get_problem_names, ProblemMeta, default_nvar, default_nobj.
MOProblems.recommended_bounds — Function
recommended_bounds(name::AbstractString) -> (lower, upper)
recommended_bounds(prob::MOProblem) -> (lower, upper)Return a finite box (lower, upper) as two independent vectors.
For problems with registered variable bounds, return those bounds. Otherwise, return a working box recommended by the package developers, when available. A recommended box is not part of the problem definition and does not guarantee feasibility, well-defined evaluations throughout the box, or proximity to the Pareto set.
The name method uses the default problem dimensions. The prob method returns vectors compatible with prob.nvar. An ArgumentError is thrown when no compatible box is available.
Examples
using MOProblems
lower, upper = recommended_bounds("Hil1")
lower, upper = recommended_bounds(ZDT1(nvar = 10))See also filter_problems, MOProblem.
Core Types
MOProblems.MOProblem — Type
MOProblemConcrete evaluable instance of a benchmark problem.
Benchmark constructors such as ZDT1() and AP1() return MOProblem instances. The fields nvar, nobj, and ncon give the numbers of variables, objectives, and general constraints. bounds is either (lower, upper) or nothing. Objective and constraint evaluators are stored in f and c, and derivative fields are nothing when no analytical evaluator is registered.
General constraints follow lcon <= c(x) <= ucon; equalities are the rows for which the corresponding lower and upper bounds are equal. Static catalog information belongs to ProblemMeta.
MOProblems.ProblemMeta — Type
ProblemMetaStatic metadata for a benchmark problem in the package catalog. dimension records the default dimensions and how they can vary. ncon_eq and ncon_ineq count general constraints, excluding variable bounds. Derivative flags record registered analytical evaluators separately for objectives and constraints. strict_convexity contains :strictly_convex or :not_strictly_convex for each objective of the default instance, or nothing when unavailable.
MOProblems.AbstractDimensionSpec — Type
AbstractDimensionSpecAbstract supertype for catalog dimension specifications.
MOProblems.FixedDimension — Type
FixedDimension(nvar, nobj)Dimension specification with fixed numbers of variables and objectives.
MOProblems.VariableNvar — Type
VariableNvar(default_nvar, nobj)Dimension specification with configurable nvar, defaulting to default_nvar, and fixed nobj.
MOProblems.VariableNobj — Type
VariableNobj(nvar, default_nobj)Dimension specification with fixed nvar and configurable nobj, defaulting to default_nobj.
MOProblems.IndependentDimension — Type
IndependentDimension(default_nvar, default_nobj)Dimension specification with independently configurable nvar and nobj, using the supplied defaults.
MOProblems.ParametricDimension — Type
ParametricDimension(default_k, default_nobj)Dimension specification with configurable k and nobj, using the supplied defaults and satisfying nvar = k + nobj - 1.
MOProblems.CoupledDimension — Type
CoupledDimension(default_nvar, default_nobj)Dimension specification with configurable nvar and coupled nobj, using the supplied defaults. Configurations preserve nvar - nobj = default_nvar - default_nobj.
MOProblems.default_nvar — Function
default_nvar(meta::ProblemMeta) -> IntReturn the number of variables in the metadata's default instance.
MOProblems.default_nobj — Function
default_nobj(meta::ProblemMeta) -> IntReturn the number of objectives in the metadata's default instance.