Internal

    LocalSearchSolvers.MainSolverType
    MainSolver <: AbstractSolver

    Main solver. Handle the solving of a model, and optional multithreaded and/or distributed subsolvers.

    Arguments:

    • model::Model: A formal description of the targeted problem
    • state::_State: An internal state to store the info necessary to a solving run
    • options::Options: User options for this solver
    • subs::Vector{_SubSolver}: Optional subsolvers
    source
    LocalSearchSolvers.ObjectiveMethod
    Objective(F, o::Objective{F2}) where {F2 <: Function}

    Constructor used in specializing a solver. Should never be called externally.

    source
    LocalSearchSolvers.VariableType
    Variable{D <: AbstractDomain}

    A structure containing the necessary information for a solver's variables: name, domain, and constraints it belongs.

    struct Variable{D <: AbstractDomain}
        domain::D
        constraints::Indices{Int}
    end
    source
    LocalSearchSolvers._ModelType
    _Model{V <: Variable{<:AbstractDomain},C <: Constraint{<:Function},O <: Objective{<:Function}}

    A struct to model a problem as a set of variables, domains, constraints, and objectives.

    struct _Model{V <: Variable{<:AbstractDomain},C <: Constraint{<:Function},O <: Objective{<:Function}}
        variables::Dictionary{Int,V}
        constraints::Dictionary{Int,C}
        objectives::Dictionary{Int,O}
    
        # counter to add new variables: vars, cons, objs
        max_vars::Ref{Int}
        max_cons::Ref{Int}
        max_objs::Ref{Int}
    
        # Bool to indicate if the _Model instance has been specialized (relatively to types)
        specialized::Ref{Bool}
    
        # Symbol to indicate the kind of model for specialized methods such as pretty printing
        kind::Symbol
    end
    source
    LocalSearchSolvers._StateType
    GeneralState{T <: Number}

    A mutable structure to store the general state of a solver. All methods applied to GeneralState are forwarded to S <: AbstractSolver.

    mutable struct GeneralState{T <: Number} <: AbstractState
        configuration::Configuration{T}
        cons_costs::Dictionary{Int, Float64}
        last_improvement::Int
        tabu::Dictionary{Int, Int}
        vars_costs::Dictionary{Int, Float64}
    end
    source
    LocalSearchSolvers._SubSolverType
    _SubSolver <: AbstractSolver

    An internal solver type called by MetaSolver when multithreading is enabled.

    Arguments:

    • id::Int: subsolver id for debugging
    • model::Model: a ref to the model of the main solver
    • state::_State: a deepcopy of the main solver that evolves independently
    • options::Options: a ref to the options of the main solver
    source
    Base.inMethod
    x::Variable ∈ constraint
    value ∈ x::Variable

    Check if a variable x is restricted by a constraint::Int, or if a value belongs to the domain of x.

    source
    LocalSearchSolvers._check_subsMethod
    _check_subs(s)

    Check if any subsolver of a main solver s, for

    • Satisfaction, has a solution, then return it, resume the run otherwise
    • Optimization, has a better solution, then assign it to its internal state
    source
    LocalSearchSolvers._compute!Method
    _compute!(s; o::Int = 1, cons_lst = Indices{Int}())

    Compute the objective o's value if s is satisfied and return the current error.

    Arguments:

    • s: a solver
    • o: targeted objective
    • cons_lst: list of targeted constraints, if empty compute for the whole set
    source
    LocalSearchSolvers._compute_costs!Method
    _compute_costs!(s; cons_lst::Indices{Int} = Indices{Int}())

    Compute the cost of constraints c in cons_lst. If cons_lst is empty, compute the cost for all the constraints in s.

    source
    LocalSearchSolvers._move!Function
    _move!(s, x::Int, dim::Int = 0)

    Perform an improving move in x neighbourhood if possible.

    Arguments:

    • s: a solver of type S <: AbstractSolver
    • x: selected variable id
    • dim: describe the dimension of the considered neighbourhood
    source
    LocalSearchSolvers.get_time_stampMethod
    get_time_stamp(m::M) where M <: Union{Model, AbstractSolver}

    Access the time (since epoch) when the model was created. This time stamp is for internal performance measurement.

    source
    LocalSearchSolvers.solve_for_loop!Method
    solve_for_loop!(solver, stop, sat, iter)

    First loop in the solving process that starts LeadSolvers from the MainSolver, and _SubSolvers from each MetaSolver.

    source