Skip to content

Commit

Permalink
format check
Browse files Browse the repository at this point in the history
  • Loading branch information
zengjian-hu-rai committed Nov 2, 2023
1 parent 277a772 commit 4755114
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ mutable struct Optimizer{T} <: MOI.AbstractOptimizer
solver = Chuffed()
end
primal_solutions = Dict{MOI.VariableIndex,T}[]
options = Dict{String,Any}("model_filename" => "", "solution_limit" => 1)
options =
Dict{String,Any}("model_filename" => "", "solution_limit" => 1)
return new(
solver,
Model{T}(),
Expand Down Expand Up @@ -84,7 +85,7 @@ function _run_minizinc(dest::Optimizer)
cmd = `$cmd --time-limit $limit`
end
if dest.options["solution_limit"] > 1
cmd = `$cmd --num-solutions $(dest.options["solution_limit"])`
cmd = `$cmd --num-solutions $(dest.options["solution_limit"])`
end
@info "[MiniZinc] Cmd = $cmd"
return run(pipeline(cmd, stdout = _stdout))
Expand Down Expand Up @@ -131,7 +132,7 @@ function MOI.set(model::Optimizer, attr::MOI.SolutionLimit, value)
msg = "[MiniZinc] SolutionLimit must be an `Int` that is >= 1"
throw(MOI.SetAttributeNotAllowed(attr, msg))
end
model.options["solution_limit"] = value
return model.options["solution_limit"] = value
end

function MOI.supports(model::Optimizer, attr::MOI.RawOptimizerAttribute)
Expand Down

0 comments on commit 4755114

Please sign in to comment.