Implement UnitCommitment.write

This commit is contained in:
2021-05-27 18:01:05 -05:00
parent e2660f50f2
commit 99975db5cd
3 changed files with 19 additions and 9 deletions

View File

@@ -52,11 +52,11 @@ model = UnitCommitment.build_model(
# Solve model
UnitCommitment.optimize!(model)
# Extract solution and write it to a file
# Extract solution
solution = UnitCommitment.solution(model)
open("/path/to/output.json", "w") do file
JSON.print(file, solution, 2)
end
# Write solution to a file
UnitCommitment.write("/path/to/output.json", solution)
```
### Solving benchmark instances