mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 00:08:52 -06:00
updated LMP for UC scenario
This commit is contained in:
@@ -20,7 +20,7 @@ import UnitCommitment: AELMP
|
||||
# policy 1: allow offlines; consider startups
|
||||
aelmp_1 =
|
||||
UnitCommitment.compute_lmp(model, AELMP(), optimizer = HiGHS.Optimizer)
|
||||
@test aelmp_1["B1", 1] ≈ 231.7 atol = 0.1
|
||||
@test aelmp_1["s1","B1", 1] ≈ 231.7 atol = 0.1
|
||||
|
||||
# policy 2: do not allow offlines; but consider startups
|
||||
aelmp_2 = UnitCommitment.compute_lmp(
|
||||
@@ -31,5 +31,5 @@ import UnitCommitment: AELMP
|
||||
),
|
||||
optimizer = HiGHS.Optimizer,
|
||||
)
|
||||
@test aelmp_2["B1", 1] ≈ 274.3 atol = 0.1
|
||||
@test aelmp_2["s1","B1", 1] ≈ 274.3 atol = 0.1
|
||||
end
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
using UnitCommitment, Cbc, HiGHS, JuMP
|
||||
import UnitCommitment: ConventionalLMP
|
||||
|
||||
function solve_lmp_testcase(path::String)
|
||||
function solve_conventional_testcase(path::String)
|
||||
instance = UnitCommitment.read(path)
|
||||
model = UnitCommitment.build_model(
|
||||
instance = instance,
|
||||
@@ -22,30 +22,30 @@ function solve_lmp_testcase(path::String)
|
||||
return lmp
|
||||
end
|
||||
|
||||
@testset "lmp" begin
|
||||
@testset "conventional" begin
|
||||
# instance 1
|
||||
path = "$FIXTURES/lmp_simple_test_1.json.gz"
|
||||
lmp = solve_lmp_testcase(path)
|
||||
@test lmp["A", 1] == 50.0
|
||||
@test lmp["B", 1] == 50.0
|
||||
lmp = solve_conventional_testcase(path)
|
||||
@test lmp["s1", "A", 1] == 50.0
|
||||
@test lmp["s1", "B", 1] == 50.0
|
||||
|
||||
# instance 2
|
||||
path = "$FIXTURES/lmp_simple_test_2.json.gz"
|
||||
lmp = solve_lmp_testcase(path)
|
||||
@test lmp["A", 1] == 50.0
|
||||
@test lmp["B", 1] == 60.0
|
||||
lmp = solve_conventional_testcase(path)
|
||||
@test lmp["s1", "A", 1] == 50.0
|
||||
@test lmp["s1", "B", 1] == 60.0
|
||||
|
||||
# instance 3
|
||||
path = "$FIXTURES/lmp_simple_test_3.json.gz"
|
||||
lmp = solve_lmp_testcase(path)
|
||||
@test lmp["A", 1] == 50.0
|
||||
@test lmp["B", 1] == 70.0
|
||||
@test lmp["C", 1] == 100.0
|
||||
lmp = solve_conventional_testcase(path)
|
||||
@test lmp["s1","A", 1] == 50.0
|
||||
@test lmp["s1","B", 1] == 70.0
|
||||
@test lmp["s1","C", 1] == 100.0
|
||||
|
||||
# instance 4
|
||||
path = "$FIXTURES/lmp_simple_test_4.json.gz"
|
||||
lmp = solve_lmp_testcase(path)
|
||||
@test lmp["A", 1] == 50.0
|
||||
@test lmp["B", 1] == 70.0
|
||||
@test lmp["C", 1] == 90.0
|
||||
lmp = solve_conventional_testcase(path)
|
||||
@test lmp["s1","A", 1] == 50.0
|
||||
@test lmp["s1","B", 1] == 70.0
|
||||
@test lmp["s1","C", 1] == 90.0
|
||||
end
|
||||
@@ -40,7 +40,7 @@ FIXTURES = "$(@__DIR__)/fixtures"
|
||||
include("validation/repair_test.jl")
|
||||
end
|
||||
@testset "lmp" begin
|
||||
include("lmp/lmp_test.jl")
|
||||
include("lmp/conventional_test.jl")
|
||||
include("lmp/aelmp_test.jl")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user