Skip to content

Commit

Permalink
Update_to_JuMP_Style
Browse files Browse the repository at this point in the history
  • Loading branch information
cfe316 committed Oct 3, 2023
1 parent bea9f3f commit 56259fb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/model/resources/maintenance.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const MAINTENANCEDOWNVARS = "MaintenanceDownVariables"
const MAINTENANCESHUTVARS = "MaintenanceShutVariables"
const HASMAINT = "HAS_MAINTENANCE"
const MAINTENANCE_DOWN_VARS = "MaintenanceDownVariables"
const MAINTENANCE_SHUT_VARS = "MaintenanceShutVariables"
const HAS_MAINT = "HAS_MAINTENANCE"

function get_maintenance(df::DataFrame)::Vector{Int}
if "MAINT" in names(df)
Expand Down Expand Up @@ -143,8 +143,8 @@ function maintenance_constraints!(EP::Model,
end

function ensure_maintenance_variable_records!(inputs::Dict)
inputs[HASMAINT] = true
for var in (MAINTENANCEDOWNVARS, MAINTENANCESHUTVARS)
inputs[HAS_MAINT] = true
for var in (MAINTENANCE_DOWN_VARS, MAINTENANCE_SHUT_VARS)
if var keys(inputs)
inputs[var] = Set{Symbol}()
end
Expand All @@ -153,9 +153,9 @@ end

function has_maintenance(inputs::Dict)::Bool
rep_periods = inputs["REP_PERIOD"]
HASMAINT in keys(inputs) && rep_periods == 1
HAS_MAINT in keys(inputs) && rep_periods == 1
end

function get_maintenance_down_variables(inputs::Dict)::Set{Symbol}
inputs[MAINTENANCEDOWNVARS]
inputs[MAINTENANCE_DOWN_VARS]
end

0 comments on commit 56259fb

Please sign in to comment.