Reorganize files

master
Alinson S. Xavier 4 years ago
parent 62974e2438
commit 6784b2153d

@ -16,9 +16,9 @@ miplearn = pyimport("miplearn")
include("utils/log.jl")
include("utils/exceptions.jl")
include("modeling/jump_instance.jl")
include("modeling/jump_solver.jl")
include("modeling/learning_solver.jl")
include("modeling/macros.jl")
include("instance/jump.jl")
include("solvers/jump.jl")
include("solvers/learning.jl")
include("solvers/macros.jl")
end # module

@ -0,0 +1,31 @@
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
struct FileInstance
filename::AbstractString
loaded::Union{Nothing,JuMPInstance}
end
function FileInstance(filename::AbstractString)::FileInstance
return FileInstance(
filename,
nothing,
)
end
function load!(instance::FileInstance)
instance.loaded = load_jump_instance(instance.filename)
end
function free!(instance::FileInstance)
instance.loaded = nothing
end
function flush!(instance::FileInstance)
save(instance.filename, instance.loaded)
end

@ -140,33 +140,4 @@ function load_jump_instance(filename::AbstractString)::JuMPInstance
end
struct FileInstance
filename::AbstractString
loaded::Union{Nothing,JuMPInstance}
end
function FileInstance(filename::AbstractString)::FileInstance
return FileInstance(
filename,
nothing,
)
end
function load!(instance::FileInstance)
instance.loaded = load_jump_instance(instance.filename)
end
function free!(instance::FileInstance)
instance.loaded = nothing
end
function flush!(instance::FileInstance)
save(instance.filename, instance.loaded)
end
export JuMPInstance, save, load_jump_instance

@ -8,6 +8,6 @@ using MIPLearn
MIPLearn.setup_logger()
@testset "MIPLearn" begin
include("modeling/jump_solver_test.jl")
include("modeling/learning_solver_test.jl")
include("solvers/jump.jl")
include("solvers/learning.jl")
end

Loading…
Cancel
Save