From 2b429bc664081424c1f2663496c52792fdc6e071 Mon Sep 17 00:00:00 2001 From: Aleksandr Kazachkov Date: Fri, 23 Jul 2021 23:29:58 -0400 Subject: [PATCH] Fix failing test due to wrong solution.jl input of reserve shortfall --- Project.toml | 2 +- src/solution/solution.jl | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index e846a41..db25ced 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "UnitCommitment" uuid = "64606440-39ea-11e9-0f29-3303a1d3d877" authors = ["Santos Xavier, Alinson "] repo = "https://github.com/ANL-CEEESA/UnitCommitment.jl" -version = "0.2.2" +version = "0.2.3" [deps] DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" diff --git a/src/solution/solution.jl b/src/solution/solution.jl index 06844ab..5fd8bbd 100644 --- a/src/solution/solution.jl +++ b/src/solution/solution.jl @@ -51,9 +51,12 @@ function solution(model::JuMP.Model)::OrderedDict sol["Switch on"] = timeseries(model[:switch_on], instance.units) sol["Switch off"] = timeseries(model[:switch_off], instance.units) sol["Reserve (MW)"] = timeseries(model[:reserve], instance.units) - sol["Reserve shortfall (MW)"] = - (model[:instance].shortfall_penalty[t] >= 0) ? - model[:reserve_shortfall] : [0 for t in 1:T] + sol["Reserve shortfall (MW)"] = OrderedDict( + t => + (instance.shortfall_penalty[t] >= 0) ? + round(value(model[:reserve_shortfall][t]), digits = 5) : 0.0 for + t in 1:instance.time + ) sol["Net injection (MW)"] = timeseries(model[:net_injection], instance.buses) sol["Load curtail (MW)"] = timeseries(model[:curtail], instance.buses)