mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-06 08:18:51 -06:00
23 lines
637 B
Julia
23 lines
637 B
Julia
# 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.
|
|
|
|
"""
|
|
write(filename::AbstractString, solution::AbstractDict)::Nothing
|
|
|
|
Write the given solution to a JSON file.
|
|
|
|
# Example
|
|
|
|
```julia
|
|
solution = UnitCommitment.solution(model)
|
|
UnitCommitment.write("/tmp/output.json", solution)
|
|
```
|
|
"""
|
|
function write(filename::AbstractString, solution::AbstractDict)::Nothing
|
|
open(filename, "w") do file
|
|
return JSON.print(file, solution, 2)
|
|
end
|
|
return
|
|
end
|