Make cut aggressiveness configurable

master
Alinson S. Xavier 3 years ago
parent 339b20309a
commit 64101c495c
Signed by: isoron
GPG Key ID: 0DA8E4B9E1109DCA

@ -8,6 +8,7 @@ using HDF5
Base.@kwdef struct CplexBlackBoxCuts
threads::Int = 1
aggressive::Bool = false
end
function _add_mip_start!(env, lp, x::Vector{Float32})
@ -56,9 +57,11 @@ function collect(
CPXsetintparam(env, CPX_PARAM_THREADS, method.threads)
# Parameter: Make cutting plane generation more aggresive
CPXsetintparam(env, CPX_PARAM_FRACCUTS, 2)
CPXsetintparam(env, CPX_PARAM_MIRCUTS, 2)
CPXsetintparam(env, CPX_PARAM_ZEROHALFCUTS, 2)
if method.aggressive
CPXsetintparam(env, CPX_PARAM_FRACCUTS, 2)
CPXsetintparam(env, CPX_PARAM_MIRCUTS, 2)
CPXsetintparam(env, CPX_PARAM_ZEROHALFCUTS, 2)
end
# Load problem
lp = CPXcreateprob(env, status_p, "problem")

@ -17,5 +17,5 @@ function test_cuts_blackbox_cplex()
h5 = Hdf5Sample(h5_filename)
rhs = h5.get_array("cuts_cpx_rhs")
h5.file.close()
@test length(rhs) == 22
@test length(rhs) > 0
end

Loading…
Cancel
Save