Skip to content

Commit

Permalink
WIP: obj
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudocubic committed Oct 10, 2023
1 parent bec1681 commit c5bcb68
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/mld.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
prepare_data!(orig_args)
set_setting!(orig_args, ("options", "outputs", "log-level"), "error")
set_setting!(orig_args, ("solvers", "HiGHS", "mip_feasibility_tolerance"), 1e-6)
set_setting!(orig_args, ("options", "objective", "enable-switch-state-open-cost"), false)
set_setting!(orig_args, ("options", "objective", "enable-switch-state-open-cost"), true)

# DEBUGGING
# set_settings!(orig_args, Dict(("options", "outputs", "log-level")=>"info", ("solvers", "HiGHS", "output_flag")=>true))
Expand Down Expand Up @@ -101,7 +101,7 @@
r = optimize_switches!(args)

@test first(r).second["termination_status"] == OPTIMAL
@test isapprox(r["1"]["objective"], 66.30; atol=1)
@test isapprox(r["1"]["objective"], 82.06; atol=1)
end

@testset "test full-lookahead optimal switching - lindistflow - traditional" begin
Expand All @@ -116,7 +116,7 @@
r = optimize_switches!(args)

@test first(r).second["termination_status"] == OPTIMAL
@test isapprox(r["1"]["objective"], 66.30; atol=1)
@test isapprox(r["1"]["objective"], 82.06; atol=1)
end

@testset "test full-lookahead optimal switching - lindistflow - block - radial-disabled - inverter-disabled" begin
Expand All @@ -133,7 +133,7 @@
r = optimize_switches!(args)

@test first(r).second["termination_status"] == OPTIMAL
@test isapprox(r["1"]["objective"], 66.29; atol=1)
@test isapprox(r["1"]["objective"], 80.65; atol=1)
end

@testset "test full-lookahead optimal switching - lindistflow - traditional - radial-disabled - inverter-disabled" begin
Expand All @@ -150,7 +150,7 @@
r = optimize_switches!(args)

@test first(r).second["termination_status"] == OPTIMAL
@test isapprox(r["1"]["objective"], 66.29; atol=1)
@test isapprox(r["1"]["objective"], 80.65; atol=1)
end

@testset "test full-lookahead optimal switching - nfa - block" begin
Expand All @@ -165,7 +165,7 @@
r = optimize_switches!(args)

@test first(r).second["termination_status"] == OPTIMAL
@test isapprox(r["1"]["objective"], 56.12; atol=1)
@test isapprox(r["1"]["objective"], 72.52; atol=1)
end

@testset "test full-lookahead optimal switching - nfa - traditional" begin
Expand All @@ -180,7 +180,7 @@
r = optimize_switches!(args)

@test first(r).second["termination_status"] == OPTIMAL
@test isapprox(r["1"]["objective"], 56.12; atol=1)
@test isapprox(r["1"]["objective"], 72.52; atol=1)
end

@testset "test robust switching - lindistflow - block" begin
Expand Down

0 comments on commit c5bcb68

Please sign in to comment.