From 77f2f625fd098a3539f7abdd2b0e471df9acc5d7 Mon Sep 17 00:00:00 2001 From: Aleksandr Kazachkov Date: Thu, 22 Jul 2021 10:32:04 -0400 Subject: [PATCH] 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. --- src/model/formulations/base/structs.jl | 20 ++++++++++---------- src/model/formulations/base/unit.jl | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/model/formulations/base/structs.jl b/src/model/formulations/base/structs.jl index 2887512..32149d8 100644 --- a/src/model/formulations/base/structs.jl +++ b/src/model/formulations/base/structs.jl @@ -2,10 +2,10 @@ # Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved. # Released under the modified BSD license. See COPYING.md for more details. -abstract type AbstractTransmissionFormulation end -abstract type AbstractRampingFormulation end +abstract type TransmissionFormulation end +abstract type RampingFormulation end abstract type PiecewiseLinearCostsFormulation end -abstract type AbstractStartupCostsFormulation end +abstract type StartupCostsFormulation end abstract type StatusVarsFormulation 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 prod_vars::ProductionVarsFormulation pwl_costs::PiecewiseLinearCostsFormulation - ramping::AbstractRampingFormulation - startup_costs::AbstractStartupCostsFormulation + ramping::RampingFormulation + startup_costs::StartupCostsFormulation status_vars::StatusVarsFormulation - transmission::AbstractTransmissionFormulation + transmission::TransmissionFormulation function Formulation(; prod_vars::ProductionVarsFormulation = Gar1962.ProdVars(), pwl_costs::PiecewiseLinearCostsFormulation = KnuOstWat2018.PwlCosts(), - ramping::AbstractRampingFormulation = MorLatRam2013.Ramping(), - startup_costs::AbstractStartupCostsFormulation = MorLatRam2013.StartupCosts(), + ramping::RampingFormulation = MorLatRam2013.Ramping(), + startup_costs::StartupCostsFormulation = MorLatRam2013.StartupCosts(), status_vars::StatusVarsFormulation = Gar1962.StatusVars(), - transmission::AbstractTransmissionFormulation = ShiftFactorsFormulation(), + transmission::TransmissionFormulation = ShiftFactorsFormulation(), ) return new( prod_vars, @@ -70,7 +70,7 @@ Arguments the cutoff that should be applied to the LODF matrix. Entries with magnitude smaller than this value will be set to zero. """ -struct ShiftFactorsFormulation <: AbstractTransmissionFormulation +struct ShiftFactorsFormulation <: TransmissionFormulation isf_cutoff::Float64 lodf_cutoff::Float64 precomputed_isf::Union{Nothing,Matrix{Float64}} diff --git a/src/model/formulations/base/unit.jl b/src/model/formulations/base/unit.jl index f0661c9..6f0169b 100644 --- a/src/model/formulations/base/unit.jl +++ b/src/model/formulations/base/unit.jl @@ -165,7 +165,7 @@ Variables --- * :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 gi = g.name for t in 1:T @@ -187,7 +187,7 @@ end # _add_shutdown_cost_eqs! function _add_ramp_eqs!( model::JuMP.Model, g::Unit, - formulation::AbstractRampingFormulation, + formulation::RampingFormulation, )::Nothing prod_above = model[:prod_above] reserve = model[:reserve]