Two commits ago, some structs were changed to have prefix Abstract, though I do not remember making that change. Changed back here. Also fixed typo Modle to Model in base/unit.jl.

pull/13/head
Aleksandr Kazachkov 4 years ago
parent b53902d559
commit 77f2f625fd

@ -2,10 +2,10 @@
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved. # Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details. # Released under the modified BSD license. See COPYING.md for more details.
abstract type AbstractTransmissionFormulation end abstract type TransmissionFormulation end
abstract type AbstractRampingFormulation end abstract type RampingFormulation end
abstract type PiecewiseLinearCostsFormulation end abstract type PiecewiseLinearCostsFormulation end
abstract type AbstractStartupCostsFormulation end abstract type StartupCostsFormulation end
abstract type StatusVarsFormulation end abstract type StatusVarsFormulation end
abstract type ProductionVarsFormulation end abstract type ProductionVarsFormulation end
@ -21,18 +21,18 @@ Some of these components are allowed to be empty, as long as overall validity of
struct Formulation struct Formulation
prod_vars::ProductionVarsFormulation prod_vars::ProductionVarsFormulation
pwl_costs::PiecewiseLinearCostsFormulation pwl_costs::PiecewiseLinearCostsFormulation
ramping::AbstractRampingFormulation ramping::RampingFormulation
startup_costs::AbstractStartupCostsFormulation startup_costs::StartupCostsFormulation
status_vars::StatusVarsFormulation status_vars::StatusVarsFormulation
transmission::AbstractTransmissionFormulation transmission::TransmissionFormulation
function Formulation(; function Formulation(;
prod_vars::ProductionVarsFormulation = Gar1962.ProdVars(), prod_vars::ProductionVarsFormulation = Gar1962.ProdVars(),
pwl_costs::PiecewiseLinearCostsFormulation = KnuOstWat2018.PwlCosts(), pwl_costs::PiecewiseLinearCostsFormulation = KnuOstWat2018.PwlCosts(),
ramping::AbstractRampingFormulation = MorLatRam2013.Ramping(), ramping::RampingFormulation = MorLatRam2013.Ramping(),
startup_costs::AbstractStartupCostsFormulation = MorLatRam2013.StartupCosts(), startup_costs::StartupCostsFormulation = MorLatRam2013.StartupCosts(),
status_vars::StatusVarsFormulation = Gar1962.StatusVars(), status_vars::StatusVarsFormulation = Gar1962.StatusVars(),
transmission::AbstractTransmissionFormulation = ShiftFactorsFormulation(), transmission::TransmissionFormulation = ShiftFactorsFormulation(),
) )
return new( return new(
prod_vars, prod_vars,
@ -70,7 +70,7 @@ Arguments
the cutoff that should be applied to the LODF matrix. Entries with magnitude the cutoff that should be applied to the LODF matrix. Entries with magnitude
smaller than this value will be set to zero. smaller than this value will be set to zero.
""" """
struct ShiftFactorsFormulation <: AbstractTransmissionFormulation struct ShiftFactorsFormulation <: TransmissionFormulation
isf_cutoff::Float64 isf_cutoff::Float64
lodf_cutoff::Float64 lodf_cutoff::Float64
precomputed_isf::Union{Nothing,Matrix{Float64}} precomputed_isf::Union{Nothing,Matrix{Float64}}

@ -165,7 +165,7 @@ Variables
--- ---
* :switch_off * :switch_off
""" """
function _add_shutdown_cost_eqs!(model::JuMP.Modle, g::Unit)::Nothing function _add_shutdown_cost_eqs!(model::JuMP.Model, g::Unit)::Nothing
T = model[:instance].time T = model[:instance].time
gi = g.name gi = g.name
for t in 1:T for t in 1:T
@ -187,7 +187,7 @@ end # _add_shutdown_cost_eqs!
function _add_ramp_eqs!( function _add_ramp_eqs!(
model::JuMP.Model, model::JuMP.Model,
g::Unit, g::Unit,
formulation::AbstractRampingFormulation, formulation::RampingFormulation,
)::Nothing )::Nothing
prod_above = model[:prod_above] prod_above = model[:prod_above]
reserve = model[:reserve] reserve = model[:reserve]

Loading…
Cancel
Save