mirror of
https://github.com/ANL-CEEESA/MIPLearn.jl.git
synced 2025-12-06 00:18:51 -06:00
Use UpperBoundRef and LowerBoundRef; relax int vars
This commit is contained in:
@@ -51,12 +51,7 @@ function runtests(optimizer_name, optimizer; large = true)
|
||||
@test round(obj, digits = 6) == 62.714777
|
||||
|
||||
# Probe (up is infeasible, down is feasible)
|
||||
BB.set_bounds!(
|
||||
mip,
|
||||
mip.binary_variables[1:3],
|
||||
[1.0, 1.0, 0.0],
|
||||
[1.0, 1.0, 1.0],
|
||||
)
|
||||
BB.set_bounds!(mip, mip.binary_variables[1:3], [1.0, 1.0, 0.0], [1.0, 1.0, 1.0])
|
||||
status, obj = BB.solve_relaxation!(mip)
|
||||
@test status == :Optimal
|
||||
probe_up, probe_down = BB.probe(mip, mip.binary_variables[3])
|
||||
|
||||
@@ -7,14 +7,25 @@ using MIPLearn
|
||||
using Cbc
|
||||
|
||||
@testset "FileInstance" begin
|
||||
@testset "Solve" begin
|
||||
@testset "Solve (knapsack)" begin
|
||||
data = KnapsackData()
|
||||
filename = tempname()
|
||||
MIPLearn.save_data(filename, data)
|
||||
instance = FileInstance(filename, build_knapsack_model)
|
||||
solver = LearningSolver(Cbc.Optimizer)
|
||||
solve!(solver, instance)
|
||||
h5 = Hdf5Sample("$filename.h5")
|
||||
@test h5.get_scalar("mip_wallclock_time") > 0
|
||||
end
|
||||
|
||||
@testset "Solve (vpm2)" begin
|
||||
data = Dict("filename" => joinpath(@__DIR__, "../fixtures/danoint.mps.gz"))
|
||||
build_model(data) = read_from_file(data["filename"])
|
||||
filename = tempname()
|
||||
MIPLearn.save_data(filename, data)
|
||||
instance = FileInstance(filename, build_model)
|
||||
solver = LearningSolver(optimizer_with_attributes(Cbc.Optimizer, "seconds" => 1.0))
|
||||
solve!(solver, instance)
|
||||
h5 = Hdf5Sample("$filename.h5")
|
||||
@test h5.get_scalar("mip_wallclock_time") > 0
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user