mirror of
https://github.com/ANL-CEEESA/MIPLearn.jl.git
synced 2025-12-06 08:28:52 -06:00
Make cut aggressiveness configurable
This commit is contained in:
@@ -8,6 +8,7 @@ using HDF5
|
|||||||
|
|
||||||
Base.@kwdef struct CplexBlackBoxCuts
|
Base.@kwdef struct CplexBlackBoxCuts
|
||||||
threads::Int = 1
|
threads::Int = 1
|
||||||
|
aggressive::Bool = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function _add_mip_start!(env, lp, x::Vector{Float32})
|
function _add_mip_start!(env, lp, x::Vector{Float32})
|
||||||
@@ -56,9 +57,11 @@ function collect(
|
|||||||
CPXsetintparam(env, CPX_PARAM_THREADS, method.threads)
|
CPXsetintparam(env, CPX_PARAM_THREADS, method.threads)
|
||||||
|
|
||||||
# Parameter: Make cutting plane generation more aggresive
|
# Parameter: Make cutting plane generation more aggresive
|
||||||
CPXsetintparam(env, CPX_PARAM_FRACCUTS, 2)
|
if method.aggressive
|
||||||
CPXsetintparam(env, CPX_PARAM_MIRCUTS, 2)
|
CPXsetintparam(env, CPX_PARAM_FRACCUTS, 2)
|
||||||
CPXsetintparam(env, CPX_PARAM_ZEROHALFCUTS, 2)
|
CPXsetintparam(env, CPX_PARAM_MIRCUTS, 2)
|
||||||
|
CPXsetintparam(env, CPX_PARAM_ZEROHALFCUTS, 2)
|
||||||
|
end
|
||||||
|
|
||||||
# Load problem
|
# Load problem
|
||||||
lp = CPXcreateprob(env, status_p, "problem")
|
lp = CPXcreateprob(env, status_p, "problem")
|
||||||
|
|||||||
@@ -17,5 +17,5 @@ function test_cuts_blackbox_cplex()
|
|||||||
h5 = Hdf5Sample(h5_filename)
|
h5 = Hdf5Sample(h5_filename)
|
||||||
rhs = h5.get_array("cuts_cpx_rhs")
|
rhs = h5.get_array("cuts_cpx_rhs")
|
||||||
h5.file.close()
|
h5.file.close()
|
||||||
@test length(rhs) == 22
|
@test length(rhs) > 0
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user