Skip to content

Commit

Permalink
--
Browse files Browse the repository at this point in the history
  • Loading branch information
GillesBareilles committed Jun 7, 2018
1 parent 310b08f commit 293b597
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions src_test/sos_example6_matpower_rankrel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,33 @@ include(joinpath("..", "src_SOShierarchy", "SOShierarchy.jl"))
## Beware, rank relaxation value is for problem without objective constant term

@testset "WB2 real formulation - order 1" begin
sols = OrderedDict("WB2" => (2, 885.71, 905.73, true),
# "WB3" => (1, 417.25, 417.25, false),
"LMBM3" => (1, 386.42, 386.42, false),
"WB5" => (2, 954.82, 1146.4, true),
"case6ww" => (1, 2986, 2986, false),
"case9" => (2, 373.8, 1458.8, true),
"case9mod" => (2, 234.6, 1320.4, true),
"case14" => (2, 721.5, 5371.5, true),
# "case22loop" => (1, 4538.8, 4538.8, false), ## Absent in data repo...
"case30" => (2, 268.915, 316.49, true))
sols = OrderedDict( "WB2" => (2, 885.71, 905.73, true),
# "WB3" => (1, 417.25, 417.25, false),
"LMBM3" => (1, 386.42, 386.42, false),
"WB5" => (2, 954.82, 1146.4, true),
"case6ww" => (1, 2986, 2986, false),
"case9" => (2, 373.8, 1458.8, true),
"case9mod" => (2, 234.6, 1320.4, true),
"case14" => (2, 721.5, 5371.5, true),
# "case22loop" => (1, 4538.8, 4538.8, false), ## Absent in data repo...
"case30" => (2, 268.915, 316.49, true),
"case39" => (1, 1887.2, 1887.2, false),
"case39mod1" => (2, 773.36, 942.34, true),
"case39mod2" => (1, 940.34, 940.34, false),
"case57" => (1, 25338, 25338, false),
"case89pegase" => (1, 5817.6, 5817.6, false)) #,
# "case118" => (1, 86298, 86298, false),
# "case118mod" => (1, 86079, 86079, false),
# "case300" => (2, 254840.4, 475430, true),
# "case300mod" => (1, 287950, 287950, false),
# "case1354pegase" => (2, 74053, 74053, true))

testfolder = joinpath("Mosek_runs", "tests", "sos_example6")

@testset "instance $instance, (rmeqs=$rmeqs)" for (instance, (dcv, obj_rankrel, obj_opt, lackconstant)) in sols, rmeqs in Set([false])

mosek_optgap = 1e-4

info("--> Working on $instance")
# OPFpbs = load_OPFproblems(MatpowerInput, joinpath("..", "data", "data_Matpower", "matpower", instance*".m"))
# problem_c = build_globalpb!(OPFpbs)
Expand All @@ -40,7 +52,7 @@ include(joinpath("..", "src_SOShierarchy", "SOShierarchy.jl"))
primobj, dualobj = run_hierarchy(problem, relax_ctx, logpath, save_pbs=true);
@show (primobj, dualobj, obj_rankrel, obj_opt, cstobj)

@test primobj obj_rankrel + cstobj atol=1e-1
@test primobj obj_rankrel + cstobj atol=1e-4*abs(obj_rankrel + cstobj)
@test dualobj primobj atol=mosek_optgap*min(abs(primobj), abs(dualobj))
end
end

0 comments on commit 293b597

Please sign in to comment.