Switch to CPLEX solver
This commit is contained in:
parent
fd5cffac9e
commit
3527a0ad0b
2 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@ authors = ["Dimitri Lozeve <dimitri@lozeve.com>"]
|
|||
version = "0.1.0"
|
||||
|
||||
[deps]
|
||||
CPLEX = "a076750e-1247-5638-91d2-ce28b192dca0"
|
||||
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
|
||||
|
@ -11,7 +12,6 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
|||
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
|
||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
|
||||
MosekTools = "1ec41992-ff65-5c91-ac43-2df89e9693a4"
|
||||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
|
||||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
||||
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using JuMP
|
||||
using MosekTools
|
||||
using CPLEX
|
||||
|
||||
function neighbourindices(mask::Matrix, idx::Int)::Vector{Int}
|
||||
if mask[idx] == 0
|
||||
|
@ -33,8 +33,9 @@ function definemodel(plantcounts::Vector, garden::Matrix, mask::Matrix, costs::M
|
|||
N = length(mask)
|
||||
Q = size(costs, 1)
|
||||
|
||||
optimizer = Mosek.Optimizer
|
||||
model = Model(optimizer_with_attributes(optimizer, "QUIET" => false))
|
||||
optimizer = optimizer_with_attributes(
|
||||
CPLEX.Optimizer, "CPX_PARAM_OPTIMALITYTARGET" => 2, "CPX_PARAM_EPINT" => 1e-8)
|
||||
model = Model(optimizer)
|
||||
|
||||
@variable(model, x[1:N, 1:Q], Bin)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue