Skip to content

Commit

Permalink
Merge branch 'before_cut_gen_callback' into guillaume_review
Browse files Browse the repository at this point in the history
  • Loading branch information
guimarqu authored Nov 29, 2022
2 parents cd3e064 + 1dd95e5 commit 820e85f
Show file tree
Hide file tree
Showing 6 changed files with 903 additions and 8 deletions.
3 changes: 3 additions & 0 deletions test/ColunaTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ module ColunaTests

rng = MersenneTwister(1234123)

include("parser.jl")

@testset "Version" begin
coluna_ver = Coluna.version()
toml_ver = VersionNumber(
Expand All @@ -38,6 +40,7 @@ module ColunaTests
include(joinpath(dirpath, filename))
end
end
include(joinpath(@__DIR__, "unit", "parser.jl"))

########################################################################################
# Integration tests
Expand Down
10 changes: 4 additions & 6 deletions test/integration/improve_relax_callback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ struct VarData <: BD.AbstractCustomData
items::Vector{Int}
end

# struct ToyNodeInfo <: ClA.AbstractNodeUserInfo
# value::Int
# end

mutable struct ToyNodeInfoUnit <: ClB.AbstractNewStorageUnit
value::Int
end
Expand Down Expand Up @@ -142,6 +138,7 @@ function test_improve_relaxation(; do_improve::Bool)
storage = ClMP.getstorage(ClMP.getmaster(reform))
unit = storage.units[ToyNodeInfoUnit].storage_unit # TODO: to improve
info_val = unit.value

max_info_val = max(max_info_val, info_val)
if info_val == 9999
sols = [[1], [2], [3], [2, 3]]
Expand Down Expand Up @@ -177,7 +174,8 @@ function test_improve_relaxation(; do_improve::Bool)

# increment the user info value for testing
if !do_improve
unit.value += 111 # TODO: to improve
info = ClMP.get_user_info(reform)
ClMP.set_user_info!(reform, ToyNodeInfo(info.value + 111))
end
return
end
Expand Down Expand Up @@ -205,6 +203,7 @@ function test_improve_relaxation(; do_improve::Bool)
if var.custom_data.items in [[1, 2], [1, 3]]
ClMP.deactivate!(masterform, vid)
changed = true

storage = ClMP.getstorage(masterform)
unit = storage.units[ToyNodeInfoUnit].storage_unit # TODO: to improve
unit.value = 9999
Expand All @@ -231,7 +230,6 @@ function test_improve_relaxation(; do_improve::Bool)
@test BD.value(s, x[b, 2]) == BD.value(s, x[b, 3]) # x[1,2] and x[1,3] in the same set
end
end
@show max_info_val
@test do_improve || max_info_val == 888
end

Expand Down
Loading

0 comments on commit 820e85f

Please sign in to comment.