• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GenXProject / GenX / #380

09 Dec 2023 03:57AM UTC coverage: 0.102%. First build
#380

Pull #600

travis-ci

Pull Request #600: Gen x retrofit mit

0 of 793 new or added lines in 67 files covered. (0.0%)

4 of 3904 relevant lines covered (0.1%)

0.05 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/write_outputs/write_reliability.jl
1
@doc raw"""
2
        write_reliability(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
3

4
Function for reporting dual variable of maximum non-served energy constraint (shadow price of reliability constraint) for each model zone and time step.
5
"""
6
function write_reliability(path::AbstractString, inputs::Dict, setup::Dict, EP::Model)
7
    T = inputs["T"]     # Number of time steps (hours)
8
    Z = inputs["Z"]     # Number of zones
9

10
    # reliability: Dual variable of maximum NSE constraint = shadow value of reliability constraint
11
    dfReliability = DataFrame(Zone = 1:Z)
12
    # Dividing dual variable for each hour with corresponding hourly weight to retrieve marginal cost of generation
13
    scale_factor = setup["ParameterScale"] == 1 ? ModelScalingFactor : 1
14
    dfReliability = hcat(dfReliability,
15
        DataFrame(transpose(dual.(EP[:cMaxNSE]) ./ inputs["omega"] * scale_factor), :auto))
16

17
    auxNew_Names = [Symbol("Zone"); [Symbol("t$t") for t in 1:T]]
18
    rename!(dfReliability, auxNew_Names)
19

20
    CSV.write(joinpath(path, "reliability.csv"),
21
        dftranspose(dfReliability, false),
22
        header = false)
×
23

×
24
    if setup["OutputFullTimeSeries"] == 1 && setup["TimeDomainReduction"] == 1
×
25
        write_full_time_series_reconstruction(path, setup, dfReliability, "reliability")
26
        @info("Writing Full Time Series for Reliability")
27
    end
×
28
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc