Skip to content

CBLS.jl

Documentation for CBLS.jl.

# CBLS.AllDifferentType.

Global constraint ensuring that all the values of a given configuration are unique.

julia
@constraint(model, X in AllDifferent())

source


# CBLS.AllEqualType.

Global constraint ensuring that all the values of X are all equal.

julia
@constraint(model, X in AllEqual())

source


# CBLS.AtLeastType.

Constraint ensuring that the number of occurrences of the values in vals in x is at least val.

julia
@constraint(model, X in AtLeast(val, vals))

source


# CBLS.AtMostType.

Constraint ensuring that the number of occurrences of the values in vals in x is at most val.

julia
@constraint(model, X in AtMost(val, vals))

source


# CBLS.ConflictsType.

Global constraint ensuring that the tuple x does not match any configuration listed within the conflict set pair_vars. This constraint, originating from the extension model, stipulates that x must avoid all configurations defined as conflicts: x ∉ pair_vars. It is useful for specifying tuples that are explicitly forbidden and should be excluded from the solution space.

julia
@constraint(model, X in Conflicts(; pair_vars))

source


# CBLS.CountType.

Global constraint ensuring that the number of occurrences of val in X is equal to count.

julia
@constraint(model, X in Count(count, val, vals))

source


# CBLS.CumulativeType.

Global constraint ensuring that the cumulative sum of the heights of the tasks is less than or equal to val.

julia
@constraint(model, X in Cumulative(; pair_vars, op, val))

source


# CBLS.DiscreteSetType.
julia
DiscreteSet(values)

Create a discrete set of values.

Arguments

  • values::Vector{T}: A vector of values to include in the set.

Returns

  • DiscreteSet{T}: A discrete set containing the specified values.

source


# CBLS.DistDifferentType.

A constraint ensuring that the distances between marks on the ruler are unique. Specifically, it checks that the distance between x[1] and x[2], and the distance between x[3] and x[4], are different. This constraint is fundamental in ensuring the validity of a Golomb ruler, where no two pairs of marks should have the same distance between them.

source


# CBLS.ElementType.

Global constraint ensuring that the value of X at index id is equal to val.

julia
@constraint(model, X in Element(; id = nothing, op = ==, val = 0))

source


# CBLS.ErrorType.
julia
Error{F <: Function} <: JuMP.AbstractVectorSet

The solver will compute a straightforward error function based on the concept. To run the solver efficiently, it is possible to provide an error function err instead of concept. err must return a nonnegative real number.

julia
@constraint(model, X in Error(err))

source


# CBLS.ExactlyType.

Constraint ensuring that the number of occurrences of the values in vals in x is exactly val.

julia
@constraint(model, X in Exactly(val, vals))

source


# CBLS.ExtensionType.

Global constraint enforcing that the tuple x matches a configuration within the supports set pair_vars[1] or does not match any configuration within the conflicts set pair_vars[2]. It embodies the logic: x ∈ pair_vars[1] || x ∉ pair_vars[2], providing a comprehensive way to define valid (supported) and invalid (conflicted) tuples for constraint satisfaction problems. This constraint is versatile, allowing for the explicit delineation of both acceptable and unacceptable configurations.

source


# CBLS.InstantiationType.

The instantiation constraint is a global constraint used in constraint programming that ensures that a list of variables takes on a specific set of values in a specific order.

source


# CBLS.IntentionType.
julia
Intention{F <: Function} <: JuMP.AbstractVectorSet

Represents an intention set in the model.

Arguments

  • f::F: A function representing the intention.

source


# CBLS.MDDConstraintType.

Multi-valued Decision Diagram (MDD) constraint.

The MDD constraint is a constraint that can be used to model a wide range of problems. It is a directed graph where each node is labeled with a value and each edge is labeled with a value. The constraint is satisfied if there is a path from the first node to the last node such that the sequence of edge labels is a valid sequence of the value labels.

julia
@constraint(model, X in MDDConstraint(; language))

source


# CBLS.MOIAllDifferentType.
julia
MOIAllDifferent <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIAllEqualType.
julia
MOIAllEqual <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIConflictsType.
julia
MOIConflicts{T <: Number, V <: Vector{Vector{T}}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOICumulativeType.
julia
MOICumulative{F <: Function, T1 <: Number, T2 <: Number} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIDistDifferentType.
julia
MOIDistDifferent <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIElementType.
julia
MOIElement{I <: Integer, F <: Function, T <: Union{Nothing, Number}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIErrorType.
julia
MOIError{F <: Function} <: MOI.AbstractVectorSet

DOCSTRING

Arguments:

  • f::F: DESCRIPTION

  • dimension::Int: DESCRIPTION

  • MOIError(f, dim = 0) = begin #= none:5 =# new{typeof(f)}(f, dim) end: DESCRIPTION

source


# CBLS.MOIExtensionType.
julia
MOIExtension{T <: Number, V <: Union{Vector{Vector{T}}, Tuple{Vector{T}, Vector{T}}}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIInstantiationType.
julia
MOIInstantiation{T <: Number, V <: Vector{T}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIIntentionType.
julia
MOIIntention{F <: Function} <: MOI.AbstractVectorSet

Represents an intention set in the model.

Arguments

  • f::F: A function representing the intention.

  • dimension::Int: The dimension of the vector set.

source


# CBLS.MOIMaximumType.
julia
MOIMaximum {F <: Function, T <: Number} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIMinimumType.
julia
MOIMinimum {F <: Function, T <: Number} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIMultivaluedDecisionDiagramType.
julia
MOIMultivaluedDecisionDiagram{L <: ConstraintCommons.AbstractMultivaluedDecisionDiagram} <: AbstractVectorSet

DOCSTRING

source


# CBLS.MOINValuesType.
julia
MOINValues{F <: Function, T1 <: Number, T2 <: Number, V <: Vector{T2}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOINoOverlapType.
julia
MOINoOverlap{I <: Integer, T <: Number, V <: Vector{T}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIOrderedType.
julia
MOIOrdered{F <: Function, T <: Number, V <: Vector{T}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOIRegularType.
julia
MOIRegular{L <: ConstraintCommons.AbstractAutomaton} <: AbstractVectorSet

DOCSTRING

source


# CBLS.MOISumType.
julia
MOISum{F <: Function, T1 <: Number, T2 <: Number, V <: Number} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MOISupportsType.
julia
MOISupports{T <: Number, V <: Vector{Vector{T}}} <: MOI.AbstractVectorSet

DOCSTRING

source


# CBLS.MaximumType.

Global constraint ensuring that the maximum value in the tuple x satisfies the condition op(x) val. This constraint is useful for specifying that the maximum value in the tuple must satisfy a certain condition.

julia
@constraint(model, X in Maximum(; op = ==, val))

source


# CBLS.MinimumType.

Global constraint ensuring that the minimum value in the tuple x satisfies the condition op(x) val. This constraint is useful for specifying that the minimum value in the tuple must satisfy a certain condition.

julia
@constraint(model, X in Minimum(; op = ==, val))

source


# CBLS.NValuesType.

Global constraint ensuring that the number of distinct values in X satisfies the given condition.

source


# CBLS.NoOverlapType.

Global constraint ensuring that the tuple x does not overlap with any configuration listed within the pair set pair_vars. This constraint, originating from the extension model, stipulates that x must avoid all configurations defined as pairs: x ∩ pair_vars = ∅. It is useful for specifying tuples that are explicitly forbidden and should be excluded from the solution space.

julia
@constraint(model, X in NoOverlap(; bool = true, dim = 1, pair_vars = nothing))

source


# CBLS.OptimizerType.
julia
Optimizer(model = Model(); options = Options())

Create an instance of the Optimizer.

Arguments

  • model: The model to be optimized.

  • options::Options: Options for configuring the solver.

Returns

  • Optimizer: An instance of the optimizer.

source


# CBLS.OptimizerType.
julia
Optimizer <: MOI.AbstractOptimizer

Defines an optimizer for CBLS.

Fields

  • solver::LS.MainSolver: The main solver used for local search.

  • int_vars::Set{Int}: Set of integer variables.

  • compare_vars::Set{Int}: Set of variables to compare.

source


# CBLS.OrderedType.

Global constraint ensuring that the variables are ordered according to op.

source


# CBLS.PredicateType.
julia
Predicate{F <: Function} <: JuMP.AbstractVectorSet

Deprecated: Use Intention instead.

Represents a predicate set in the model.

Arguments

  • f::F: A function representing the predicate.

source


# CBLS.RegularType.

Ensures that a sequence x (interpreted as a word) is accepted by the regular language represented by a given automaton. This constraint verifies the compliance of x with the language rules encoded within the automaton parameter, which must be an instance of <:AbstractAutomaton.

julia
@constraint(model, X in RegularConstraint(; language))

source


# CBLS.ScalarFunctionType.
julia
ScalarFunction{F <: Function, V <: Union{Nothing, VOV}} <: MOI.AbstractScalarFunction

A container to express any function with real value in JuMP syntax. Used with the @objective macro.

Arguments:

  • f::F: function to be applied to X

  • X::V: a subset of the variables of the model.

Given a model, and some (collection of) variables X to optimize. an objective function f can be added as follows. Note that only Min for minimization us currently defined. Max will come soon.

julia
# Applies to all variables in order of insertion.
# Recommended only when the function argument order does not matter.
@objective(model, ScalarFunction(f))

# Generic use
@objective(model, ScalarFunction(f, X))

source


# CBLS.SumType.

Global constraint ensuring that the sum of the variables in x satisfies a given condition.

source


# CBLS.SupportsType.

Global constraint ensuring that the tuple x matches a configuration listed within the support set pair_vars. This constraint is derived from the extension model, specifying that x must be one of the explicitly defined supported configurations: x ∈ pair_vars. It is utilized to directly declare the tuples that are valid and should be included in the solution space.

julia
@constraint(model, X in Supports(; pair_vars))

source


# Base.copyMethod.
julia
Base.copy(set::MOIError) = begin

DOCSTRING

source


# Base.copyMethod.
julia
Base.copy(set::MOIIntention)

Copy an intention set.

Arguments

  • set::MOIIntention: The intention set to be copied.

Returns

  • MOIIntention: A copy of the intention set.

source


# Base.copyMethod.
julia
Base.copy(set::DiscreteSet)

Copy a discrete set.

Arguments

  • set::DiscreteSet: The discrete set to be copied.

Returns

  • DiscreteSet: A copy of the discrete set.

source


# Base.copyMethod.
julia
Base.copy(op::F) where {F <: Function}

Copy a function.

Arguments

  • op::F: The function to be copied.

Returns

  • F: The copied function.

source


# Base.copyMethod.
julia
Base.copy(::Nothing)

Copy a Nothing value.

Arguments

  • ::Nothing: The Nothing value to be copied.

Returns

  • Nothing: The copied Nothing value.

source


# JuMP.build_variableMethod.
julia
JuMP.build_variable(::Function, info::JuMP.VariableInfo, set::T) where T <: MOI.AbstractScalarSet

Create a variable constrained by a scalar set.

Arguments

  • info::JuMP.VariableInfo: Information about the variable to be created.

  • set::T where T <: MOI.AbstractScalarSet: The set defining the constraints on the variable.

Returns

  • JuMP.VariableConstrainedOnCreation: A variable constrained by the specified set.

source


# JuMP.moi_setMethod.
julia
JuMP.moi_set(set::Intention, dim::Int) -> MOIIntention

Convert an Intention set to a MOIIntention set.

Arguments

  • set::Intention: The intention set to be converted.

  • dim::Int: The dimension of the vector set.

Returns

  • MOIIntention: The converted MOIIntention set.

source


# JuMP.moi_setMethod.
julia
JuMP.moi_set(set::Predicate, dim::Int) -> MOIIntention

Convert a Predicate set to a MOIIntention set.

Arguments

  • set::Predicate: The predicate set to be converted.

  • dim::Int: The dimension of the vector set.

Returns

  • MOIIntention: The converted MOIIntention set.

source


# MathOptInterface.add_constraintMethod.
julia
MOI.add_constraint(optimizer::Optimizer, vars::MOI.VectorOfVariables, set::MOIError)

DOCSTRING

Arguments:

  • optimizer: DESCRIPTION

  • vars: DESCRIPTION

  • set: DESCRIPTION

source


# MathOptInterface.add_constraintMethod.
julia
MOI.add_constraint(optimizer::Optimizer, vars::MOI.VectorOfVariables, set::MOIIntention{F}) where {F <: Function}

Add an intention constraint to the optimizer.

Arguments

  • optimizer::Optimizer: The optimizer instance.

  • vars::MOI.VectorOfVariables: The variables for the constraint.

  • set::MOIIntention{F}: The intention set defining the constraint.

Returns

  • CI{VOV, MOIIntention{F}}: The constraint index.

source


# MathOptInterface.add_constraintMethod.
julia
MOI.add_constraint(optimizer::Optimizer, v::VI, set::DiscreteSet{T}) where T <: Number

DOCSTRING

Arguments:

  • optimizer: DESCRIPTION

  • v: DESCRIPTION

  • set: DESCRIPTION

source


# MathOptInterface.add_variableMethod.
julia
MOI.add_variable(model::Optimizer) = begin

DOCSTRING

source


# MathOptInterface.copy_toMethod.
julia
MOI.copy_to(model::Optimizer, src::MOI.ModelLike)

Copy the source model to the optimizer.

Arguments

  • model::Optimizer: The optimizer instance.

  • src::MOI.ModelLike: The source model to be copied.

Returns

  • Nothing

source


# MathOptInterface.empty!Method.
julia
MOI.empty!(opt)

Empty the optimizer.

Arguments

  • opt::Optimizer: The optimizer instance.

Returns

  • Nothing

source


# MathOptInterface.getMethod.
julia
MOI.get(::Optimizer, ::MOI.SolverName)

Get the name of the solver.

Arguments

  • ::Optimizer: The optimizer instance.

Returns

  • String: The name of the solver.

source


# MathOptInterface.getMethod.
julia
Moi.get(::Optimizer, ::MOI.SolverVersion)

Get the version of the solver, here LocalSearchSolvers.jl.

source


# MathOptInterface.is_emptyMethod.
julia
MOI.is_empty(model::Optimizer)

Check if the model is empty.

Arguments

  • model::Optimizer: The optimizer instance.

Returns

  • Bool: True if the model is empty, false otherwise.

source


# MathOptInterface.is_validMethod.
julia
MOI.is_valid(optimizer::Optimizer, index::CI{VI, MOI.Integer})

Check if an index is valid for the optimizer.

Arguments

  • optimizer::Optimizer: The optimizer instance.

  • index::CI{VI, MOI.Integer}: The index to be checked.

Returns

  • Bool: True if the index is valid, false otherwise.

source


# MathOptInterface.optimize!Method.
julia
MOI.optimize!(model::Optimizer)

Optimize the model using the optimizer.

Arguments

  • model::Optimizer: The optimizer instance.

Returns

  • Nothing

source


# MathOptInterface.setFunction.
julia
MOI.set(::Optimizer, ::MOI.Silent, bool = true)

Set the verbosity of the solver.

Arguments

  • ::Optimizer: The optimizer instance.

  • ::MOI.Silent: The silent option for the solver.

  • bool::Bool: Whether to set the solver to silent mode.

Returns

  • Nothing

source


# MathOptInterface.setMethod.
julia
MOI.set(model::Optimizer, p::MOI.RawOptimizerAttribute, value)

Set a RawOptimizerAttribute to value

source


# MathOptInterface.setMethod.
julia
MOI.set(model::Optimizer, ::MOI.TimeLimitSec, value::Union{Nothing,Float64})

Set the time limit

source


# MathOptInterface.supports_constraintMethod.
julia
MOI.supports_constraint(::Optimizer, ::Type{VOV}, ::Type{MOIError}) = begin

DOCSTRING

Arguments:

  • ``: DESCRIPTION

  • ``: DESCRIPTION

  • ``: DESCRIPTION

source


# MathOptInterface.supports_constraintMethod.
julia
MOI.supports_constraint(::Optimizer, ::Type{VOV}, ::Type{MOIIntention{F}}) where {F <: Function}

Check if the optimizer supports a given intention constraint.

Arguments

  • ::Optimizer: The optimizer instance.

  • ::Type{VOV}: The type of the variable.

  • ::Type{MOIIntention{F}}: The type of the intention.

Returns

  • Bool: True if the optimizer supports the constraint, false otherwise.

source


# MathOptInterface.supports_incremental_interfaceMethod.
julia
MOI.supports_incremental_interface(::Optimizer)

Check if the optimizer supports incremental interface.

Arguments

  • ::Optimizer: The optimizer instance.

Returns

  • Bool: True if the optimizer supports incremental interface, false otherwise.

source