From 099fb4e3cbcb1b4085c00da1a3ef337f0255b646 Mon Sep 17 00:00:00 2001 From: "Alinson S. Xavier" Date: Sat, 16 Apr 2022 09:52:08 -0500 Subject: [PATCH] Add case14-flex test case --- docs/format.md | 4 ++-- instances/test/case14-flex.json.gz | Bin 0 -> 1891 bytes test/model/formulations_test.jl | 36 +++++++++++++++++++++-------- 3 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 instances/test/case14-flex.json.gz diff --git a/docs/format.md b/docs/format.md index 985511e..dc02a0d 100644 --- a/docs/format.md +++ b/docs/format.md @@ -240,13 +240,13 @@ This section describes the hourly amount of reserves required. ```json { "Reserves": { - "up-flexiramp (MW)": [ + "Up-flexiramp (MW)": [ 20.31042, 23.65273, 27.41784, 25.34057 ], - "down-flexiramp (MW)": [ + "Down-flexiramp (MW)": [ 19.41546, 21.45377, 23.53402, diff --git a/instances/test/case14-flex.json.gz b/instances/test/case14-flex.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..b02c6dfa8590dfa1044a8883b0dcaad52c6b48a9 GIT binary patch literal 1891 zcmV-p2b}mHiwFo8*IHr#17l%xWid1@W^846E^2dcZUEg{OK;mo5I)zxf-rJ$0eQQ- zv(H|NwrPt3O%cQ?dI)l$W!fenkp@ZGaRdMN4kbS%awrakv?wYYGR&Qw{dRV~d93vL zD8bk9+q6oTS(8=u@wdt6^|ST!_xUnQuFER_t1Oa}>#uRt%#OY~ewWo*b()dQrd6O^`>yr+9iMbnoHc3H ztZtHvY?0pAkB0f6P-LExrmmA!^t+tWHB*E#?Mpdt^^3W#j; z8kTM0(YEHvraM#KrOTTHr!4Yi-aPFr2An|1U6gmlsN@rfQMv0?!&3MrFY@JTi71 z5_ZtL`#hK>VN#gUkAHzr2`{;nAS6jjP;w+C2*EciG-S0Z2Hb*VjN&n-C-yHh#{G90 zV}=>yrZMJFy6of1KaeWz@P@MS6ZFurV-?AzBJZ3%4$FBj~HQ`R+<<4ST0BJ2@JqscPqY0>12~Yt7F(UCSK(g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O zWk#Ybxy_1IwsWi6yM=w7Ez{!pX5H@Gy6(Vx{8ncDB)SFbkDJrWMfNGL+OP1Ccl1~d zgOa9GSZKf+S$A*XwHHQV;oNy@u{4oe_c+_%2RMFR-W6jQR7AbD`*6&6i(>!sG27-SAC4Z5{szYH6`JcR003n0qCfxu literal 0 HcmV?d00001 diff --git a/test/model/formulations_test.jl b/test/model/formulations_test.jl index 01277a2..f46717b 100644 --- a/test/model/formulations_test.jl +++ b/test/model/formulations_test.jl @@ -4,6 +4,7 @@ using UnitCommitment using JuMP +using Cbc import UnitCommitment: ArrCon2000, CarArr2006, @@ -13,23 +14,35 @@ import UnitCommitment: KnuOstWat2018, MorLatRam2013, PanGua2016, - XavQiuWanThi2019 + XavQiuWanThi2019, + WanHob2016 if ENABLE_LARGE_TESTS using Gurobi end -function _small_test(formulation::Formulation)::Nothing - instances = ["matpower/case118/2017-02-01", "test/case14"] - for instance in instances - # Should not crash - @show "$(instance)" - UnitCommitment.build_model( - instance = UnitCommitment.read_benchmark(instance), +function _small_test( + formulation::Formulation; + instances::Array{String} = ["test/case14"], + optimizer = optimizer_with_attributes( + Cbc.Optimizer, + "logLevel" => 0, + ) +)::Nothing + for instance_name in instances + instance = UnitCommitment.read_benchmark(instance_name) + model = UnitCommitment.build_model( + instance = instance, formulation = formulation, + optimizer = 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 _large_test(formulation::Formulation)::Nothing @@ -80,5 +93,8 @@ end _test(Formulation(pwl_costs = CarArr2006.PwlCosts())) @show "KnuOstWat2018 PwlCosts" _test(Formulation(pwl_costs = KnuOstWat2018.PwlCosts())) - @show "formulations completed" + _small_test( + Formulation(ramping = WanHob2016.Ramping()), + instances=["test/case14-flex"], + ) end