Reference
Contents
Index
SolverParameters.AbstractDomainSolverParameters.AbstractParameterSolverParameters.AbstractParameterSetSolverParameters.BinaryRangeSolverParameters.CategoricalDomainSolverParameters.CategoricalSetSolverParameters.DefaultParameterSolverParameters.IntegerDomainSolverParameters.IntegerRangeSolverParameters.IntegerSetSolverParameters.ParameterSolverParameters.RealDomainSolverParameters.RealIntervalBase.convertBase.lengthBase.namesBase.valuesSolverParameters.check_valueSolverParameters.domainSolverParameters.enumSolverParameters.enumSolverParameters.enumSolverParameters.length_numSolverParameters.lower_boundsSolverParameters.lower_bounds!SolverParameters.nameSolverParameters.names!SolverParameters.set_names!SolverParameters.set_value!SolverParameters.set_values!SolverParameters.set_values_num!SolverParameters.upper_boundsSolverParameters.upper_bounds!SolverParameters.valueSolverParameters.values!SolverParameters.values_numSolverParameters.values_num!
SolverParameters.AbstractDomain — TypeAbstractDomain{T}
An abstract domain type that superseeds any specific domain implementation.
lower(d::AbstractDomain{T}): return the lower bound of the domain;upper(d::AbstractDomain{T}): return the upper bound of the domain;∈(x::T, D::AbstractDomain{T}): returntrueif a valuexis in the domain andfalseotherwise.
See RealInterval, IntegerRange, IntegerSet, BinaryRange, CategoricalSet for concrete implementations.
lower and upper are not implemented for categorical domains.
SolverParameters.AbstractParameter — TypeAbstractParameter{T}An abstract type for parameters of value type T.
SolverParameters.AbstractParameterSet — TypeAbstractParameterSetAn abstract type that represents a set of parameters.
Example:
struct MySolverParameterSet <: AbstractParameterSet
η₁::Parameter(1.0e-5, RealInterval(0, 1; lower_open=true, upper_open=false))
endSolverParameters.BinaryRange — TypeBinaryRange{T <: Bool} <: IntegerDomain{T}
BinaryRange()Binary range for boolean parameters. Note: This concrete type is not mutable as it would break the purpose of a binary range.
Examples:
BinaryRange()SolverParameters.CategoricalDomain — TypeCategorical domain for categorical variables.
SolverParameters.CategoricalSet — TypeCategoricalSet{T} <: CategoricalDomain{T}
CategoricalSet(Vector{T})
CategoricalSet()Set of possible values for a categorical variable.
Examples:
CategoricalSet()CategoricalSet("A", "B")CategoricalSet(:A, :B)SolverParameters.DefaultParameter — TypeDefaultParameter{Dflt}Structure used to simplify declaring default parameters in solvers and docstrings.
default::Dflt: is the default value, it can be a Number, a Symbol or even a function.str::String: message to be printed or used in docstrings.
Constructors
DefaultParameter(default) DefaultParameter(default, str)
SolverParameters.IntegerDomain — TypeInteger domain for discrete variables:
- Integer range;
- Integer set;
- Binary range.
SolverParameters.IntegerRange — TypeIntegerRange{T <: Integer} <: IntegerDomain{T}
IntegerRange(lower::T, upper::T)Interval of possible values for an integer variable.
Examples:
IntegerRange(1, 4)SolverParameters.IntegerSet — TypeIntegerSet{T} <: IntegerDomain{T}
IntegerSet(values::Vector{T <: Integer})Set of possible values for an integer variable.
Examples:
IntegerSet(1, 3, 4)SolverParameters.Parameter — TypeParameter{T, AbstractDomain{T}} <: AbstractParameter{T}
Parameter(value::T; name::String = "")
Parameter(value::T, domain::AbstractDomain{T}; name::String = "")
Parameter(value::T, domain::AbstractDomain{T}, name::String)A Parameter structure handles the following attributes describing one parameter:
value::T: default value of the parameter;domain::AbstractDomain{T}: domain of the possible values of the parameter;name::String: name of the parameter.
If no domain is specified, the constructor uses (-typemin(x), typemax(x)) as domain.
Examples:
Parameter(Float64(42)) Parameter("A", CategoricalSet(["A", "B", "C", "D"])) Parameter(Int32(5), IntegerRange(Int32(5), Int32(20)))SolverParameters.RealDomain — TypeReal domain for continuous variables
SolverParameters.RealInterval — TypeRealInterval{T <: Real} <: RealDomain{T}
RealInterval(lower::T, upper::T; lower_open::Bool = false, upper_open::Bool = false)Interval of possible values for a real variable.
Examples:
RealInterval(1.3, 4.9)Base.convert — Methodconvert(::Parameter{T}, value)Converts a value to the corresponding type of a giver parameter. If T is an integer, this function will first round the value.
Examples:
real_param = Parameter(1.5, RealInterval(0.0, 2.0), "real_param");
a = 1;
convert(real_param, a)
# output
1.0int_param = Parameter(1, IntegerRange(1, 4), "int_param");
a = 1.6;
convert(int_param, a)
# output
2Base.length — Methodlength(::AbstractParameterSet)Return the number of parameters in an AbstractParameterSet.
Base.names — Methodnames(parameter_set::AbstractParameterSet)Return the name of the parameters in an AbstractParameterSet.
Base.values — Methodvalues(parameter_set::AbstractParameterSet)
values(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet)Return a vector with the current values of each parameter in an AbstractParameterSet. Only a subset is returned if an NTuple is given.
SolverParameters.check_value — Methodcheck_value(domain::AbstractDomain{T}, new_value::T)Throw a DomainError if new_value is not in the domain.
SolverParameters.domain — Methoddomain(parameter::Parameter{T})Returns the domain of a parameter.
SolverParameters.enum — Functionenum(::AbstractDomain{T}; step, kwargs...)Return an iterable object of values in the domain d with step step.
SolverParameters.enum — Methodenum(::AbstractParameterSet; step, kwargs...)
enum(subset::NTuple{N, Symbol}, ::AbstractParameterSet; step, kwargs...)Return an iterable object of values in the AbstractParameterSet with step step.
SolverParameters.enum — Methodenum(::Parameter{T}; step, kwargs...)Return an iterable object of values in the domain d with step step.
SolverParameters.length_num — Methodlength_num(parameter_set::AbstractParameterSet)Return the number of numerical parameters in an AbstractParameterSet.
SolverParameters.lower_bounds! — Methodlower_bounds!(parameter_set::AbstractParameterSet, vals::AbstractVector)
lower_bounds!(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet, vals::AbstractVector)Return the lower bounds of each numerical parameter in an AbstractParameterSet in place.
SolverParameters.lower_bounds — Methodlower_bounds(parameter_set::AbstractParameterSet)
lower_bounds(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet)Return a vector with the lower bounds of each numerical parameter in an AbstractParameterSet.
SolverParameters.name — Methodname(parameter::Parameter{T})Returns the name of a parameter.
SolverParameters.names! — Methodnames!(parameter_set::AbstractParameterSet, vals::Vector{String})Return the name of the parameters in an AbstractParameterSet in place.
SolverParameters.set_names! — Methodset_names!(parameter_set::AbstractParameterSet)Set the names of parameters in the AbstractParameterSet to their fieldnames.
SolverParameters.set_value! — Methodset_value!(parameter::Parameter{T}, new_value::T)Set value of a parameter. It throws a DomainError if new_value is not in the domain of the parameter.
SolverParameters.set_values! — Methodset_values!(parameter_set::AbstractParameterSet, new_values::AbstractVector)
set_values!(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet, new_values::AbstractVector)Update the values of an AbstractParameterSet with the values given in the vector new_values. Only a subset is updated if an NTuple is given.
SolverParameters.set_values_num! — Methodset_values_num!(parameter_set::AbstractParameterSet, new_values::AbstractVector)
set_values_num!(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet, new_values::AbstractVector)Update the numerical values of an AbstractParameterSet with the values given in the vector new_values. Only a subset is updated if an NTuple is given.
SolverParameters.upper_bounds! — Methodupper_bounds!(parameter_set::T, vals::AbstractVector)
upper_bounds!(subset::NTuple{N, Symbol}, parameter_set::T, vals::AbstractVector)Return the lower bounds of each numerical parameter in an AbstractParameterSet in place.
SolverParameters.upper_bounds — Methodupper_bounds(parameter_set::AbstractParameterSet)
upper_bounds(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet)Return a vector with the upper bounds of each numerical parameter in an AbstractParameterSet.
SolverParameters.value — Methodvalue(parameter::Parameter{T})Returns the current value of a parameter.
SolverParameters.values! — Methodvalues!(parameter_set::AbstractParameterSet, vals::AbstractVector)
values!(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet, vals::AbstractVector)Return the current values of each parameter in an AbstractParameterSet in place. Only a subset is returned if an NTuple is given.
SolverParameters.values_num! — Methodvalues_num!(parameter_set::AbstractParameterSet, vals::AbstractVector)
values_num!(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet, vals::AbstractVector)Return the current values of each numerical parameter in an AbstractParameterSet in place. Only a subset is returned if an NTuple is given.
SolverParameters.values_num — Methodvalues_num(parameter_set::AbstractParameterSet)
values_num(subset::NTuple{N, Symbol}, parameter_set::AbstractParameterSet)Return a vector with the current values of each numerical parameter in an AbstractParameterSet. Only a subset is returned if an NTuple is given.