|
|
|
@ -17,11 +17,7 @@ import UnitCommitment:
|
|
|
|
|
XavQiuWanThi2019,
|
|
|
|
|
WanHob2016
|
|
|
|
|
|
|
|
|
|
if ENABLE_LARGE_TESTS
|
|
|
|
|
using Gurobi
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function _small_test(
|
|
|
|
|
function _test(
|
|
|
|
|
formulation::Formulation;
|
|
|
|
|
instances::Array{String} = ["test/case14"],
|
|
|
|
|
optimizer = optimizer_with_attributes(Cbc.Optimizer, "logLevel" => 0),
|
|
|
|
@ -42,32 +38,6 @@ function _small_test(
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function _large_test(formulation::Formulation)::Nothing
|
|
|
|
|
instances = ["pglib-uc/ca/Scenario400_reserves_1"]
|
|
|
|
|
for instance in instances
|
|
|
|
|
instance = UnitCommitment.read_benchmark(instance)
|
|
|
|
|
model = UnitCommitment.build_model(
|
|
|
|
|
instance = instance,
|
|
|
|
|
formulation = formulation,
|
|
|
|
|
optimizer = Gurobi.Optimizer,
|
|
|
|
|
)
|
|
|
|
|
UnitCommitment.optimize!(
|
|
|
|
|
model,
|
|
|
|
|
XavQiuWanThi2019.Method(two_phase_gap = false, gap_limit = 0.1),
|
|
|
|
|
)
|
|
|
|
|
solution = UnitCommitment.solution(model)
|
|
|
|
|
@test UnitCommitment.validate(instance, solution)
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function _test(formulation::Formulation)::Nothing
|
|
|
|
|
_small_test(formulation)
|
|
|
|
|
if ENABLE_LARGE_TESTS
|
|
|
|
|
_large_test(formulation)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@testset "formulations" begin
|
|
|
|
|
_test(Formulation())
|
|
|
|
|
_test(Formulation(ramping = ArrCon2000.Ramping()))
|
|
|
|
@ -83,7 +53,7 @@ end
|
|
|
|
|
_test(Formulation(pwl_costs = Gar1962.PwlCosts()))
|
|
|
|
|
_test(Formulation(pwl_costs = CarArr2006.PwlCosts()))
|
|
|
|
|
_test(Formulation(pwl_costs = KnuOstWat2018.PwlCosts()))
|
|
|
|
|
_small_test(
|
|
|
|
|
_test(
|
|
|
|
|
Formulation(ramping = WanHob2016.Ramping()),
|
|
|
|
|
instances = ["test/case14-flex"],
|
|
|
|
|
)
|
|
|
|
|