Datasets:
Download src/solution/write.jl from EridanusQ/UnitCommitment_Trajectory: direct link, hf CLI and curl.
- Browser
- Download file 637 Bytes
-
https://huggingface.co/datasets/EridanusQ/UnitCommitment_Trajectory/resolve/main/src/solution/write.jl
- Command line
-
hf download hf://datasets/EridanusQ/UnitCommitment_Trajectory/src/solution/write.jl
-
curl -L -o write.jl https://huggingface.co/datasets/EridanusQ/UnitCommitment_Trajectory/resolve/main/src/solution/write.jl
637 Bytes
| # 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 | |