mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 16:28:51 -06:00
Reorganize files; document some methods
This commit is contained in:
24
src/solution/warmstart.jl
Normal file
24
src/solution/warmstart.jl
Normal file
@@ -0,0 +1,24 @@
|
||||
# UnitCommitment.jl: Optimization Package for Security-Constrained Unit Commitment
|
||||
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
||||
# Released under the modified BSD license. See COPYING.md for more details.
|
||||
|
||||
function set_warm_start!(model::JuMP.Model, solution::AbstractDict)::Nothing
|
||||
instance, T = model[:instance], model[:instance].time
|
||||
is_on = model[:is_on]
|
||||
prod_above = model[:prod_above]
|
||||
reserve = model[:reserve]
|
||||
for g in instance.units
|
||||
for t in 1:T
|
||||
JuMP.set_start_value(is_on[g.name, t], solution["Is on"][g.name][t])
|
||||
JuMP.set_start_value(
|
||||
switch_on[g.name, t],
|
||||
solution["Switch on"][g.name][t],
|
||||
)
|
||||
JuMP.set_start_value(
|
||||
switch_off[g.name, t],
|
||||
solution["Switch off"][g.name][t],
|
||||
)
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
Reference in New Issue
Block a user