Reference

​

Contents

​

​

Index

​

​

SolverParameters.AbstractDomain — Type

AbstractDomain{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}): return true if a value x is in the domain and false otherwise.

See RealInterval, IntegerRange, IntegerSet, BinaryRange, CategoricalSet for concrete implementations.

lower and upper are not implemented for categorical domains.

source
SolverParameters.AbstractParameterSet — Type
AbstractParameterSet

An 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))
  end
source
SolverParameters.BinaryRange — Type
BinaryRange{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()
source
SolverParameters.CategoricalSet — Type
CategoricalSet{T} <: CategoricalDomain{T}

CategoricalSet(Vector{T})
CategoricalSet()

Set of possible values for a categorical variable.

Examples:

CategoricalSet()
CategoricalSet("A", "B")
CategoricalSet(:A, :B)
source
SolverParameters.DefaultParameter — Type
DefaultParameter{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)

source
SolverParameters.IntegerRange — Type
IntegerRange{T <: Integer} <: IntegerDomain{T}

IntegerRange(lower::T, upper::T)

Interval of possible values for an integer variable.

Examples:

IntegerRange(1, 4)
source
SolverParameters.IntegerSet — Type
IntegerSet{T} <: IntegerDomain{T}

IntegerSet(values::Vector{T <: Integer})

Set of possible values for an integer variable.

Examples:

IntegerSet(1, 3, 4)
source
SolverParameters.Parameter — Type
Parameter{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)))
source
SolverParameters.RealInterval — Type
RealInterval{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)
source
Base.convert — Method
convert(::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.0
int_param = Parameter(1, IntegerRange(1, 4), "int_param");
a = 1.6;
convert(int_param, a)

# output

2
source
Base.length — Method
length(::AbstractParameterSet)

Return the number of parameters in an AbstractParameterSet.

source
Base.names — Method
names(parameter_set::AbstractParameterSet)

Return the name of the parameters in an AbstractParameterSet.

source
Base.values — Method
values(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.

source
SolverParameters.enum — Function
enum(::AbstractDomain{T}; step, kwargs...)

Return an iterable object of values in the domain d with step step.

source
SolverParameters.enum — Method
enum(::AbstractParameterSet; step, kwargs...)
enum(subset::NTuple{N, Symbol}, ::AbstractParameterSet; step, kwargs...)

Return an iterable object of values in the AbstractParameterSet with step step.

source
SolverParameters.enum — Method
enum(::Parameter{T}; step, kwargs...)

Return an iterable object of values in the domain d with step step.

source
SolverParameters.lower_bounds! — Method
lower_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.

source
SolverParameters.lower_bounds — Method
lower_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.

source
SolverParameters.names! — Method
names!(parameter_set::AbstractParameterSet, vals::Vector{String})

Return the name of the parameters in an AbstractParameterSet in place.

source
SolverParameters.set_names! — Method
set_names!(parameter_set::AbstractParameterSet)

Set the names of parameters in the AbstractParameterSet to their fieldnames.

source
SolverParameters.set_value! — Method
set_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.

source
SolverParameters.set_values! — Method
set_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.

source
SolverParameters.set_values_num! — Method
set_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.

source
SolverParameters.upper_bounds! — Method
upper_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.

source
SolverParameters.upper_bounds — Method
upper_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.

source
SolverParameters.values! — Method
values!(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.

source
SolverParameters.values_num! — Method
values_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.

source
SolverParameters.values_num — Method
values_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.

source