-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions-to-export-data.jl
124 lines (98 loc) · 3.66 KB
/
functions-to-export-data.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
"""
save_two_stage_results_to_csv(output_folder, model)
Save the results of the model to CSV files.
# Arguments
- `output_folder`: The folder path where the CSV files will be saved.
- `model`: The model containing the results to be saved.
"""
function save_two_stage_results_to_csv(output_folder, model)
CSV.write(
joinpath(output_folder, "oGEP_Investment.csv"),
Containers.rowtable(value, model[:v_investment]; header = [:g, :instal_units]),
)
CSV.write(
joinpath(output_folder, "oGEP_Production.csv"),
Containers.rowtable(value, model[:v_production]; header = [:sc, :g, :h, :production]),
)
CSV.write(
joinpath(output_folder, "oGEP_ENS.csv"),
Containers.rowtable(value, model[:v_ens]; header = [:sc, :h, :ens]),
)
return nothing
end
"""
save_two_stage_explicit_formulation_results_to_csv(output_folder, model)
Save the results of the model to CSV files.
# Arguments
- `output_folder`: The folder path where the CSV files will be saved.
- `model`: The model containing the results to be saved.
"""
function save_two_stage_explicit_formulation_results_to_csv(output_folder, model)
CSV.write(
joinpath(output_folder, "oGEP_Investment_Explicit.csv"),
Containers.rowtable(value, model[:v_investment]; header = [:sc, :g, :instal_units]),
)
CSV.write(
joinpath(output_folder, "oGEP_Production_Explicit.csv"),
Containers.rowtable(value, model[:v_production]; header = [:sc, :g, :h, :production]),
)
CSV.write(
joinpath(output_folder, "oGEP_ENS_Explicit.csv"),
Containers.rowtable(value, model[:v_ens]; header = [:sc, :h, :ens]),
)
return nothing
end
"""
save_multi_stage_results_to_csv(output_folder, model)
Save the results of the model to CSV files.
# Arguments
- `output_folder`: The folder path where the CSV files will be saved.
- `model`: The model containing the results to be saved.
"""
function save_multi_stage_results_to_csv(output_folder, model)
CSV.write(
joinpath(output_folder, "oGEP_Investment.csv"),
Containers.rowtable(value, model[:v_investment]; header = [:st, :sc, :g, :instal_units]),
)
CSV.write(
joinpath(output_folder, "oGEP_Production.csv"),
Containers.rowtable(value, model[:v_production]; header = [:st, :sc, :g, :h, :production]),
)
CSV.write(
joinpath(output_folder, "oGEP_ENS.csv"),
Containers.rowtable(value, model[:v_ens]; header = [:st, :sc, :h, :ens]),
)
return nothing
end
"""
save_results_benders_first_stage_to_csv(output_folder, model)
Save the results of the model to CSV files.
# Arguments
- `output_folder`: The folder path where the CSV files will be saved.
- `model`: The model containing the results to be saved.
"""
function save_results_benders_first_stage_to_csv(output_folder, model)
CSV.write(
joinpath(output_folder, "oGEP_Investment.csv"),
Containers.rowtable(value, model[:v_investment]; header = [:g, :instal_units]),
)
return nothing
end
"""
save_results_benders_subproblem_to_csv(output_folder, model)
Save the results of the model to CSV files.
# Arguments
- `output_folder`: The folder path where the CSV files will be saved.
- `model`: The model containing the results to be saved.
"""
function save_results_benders_subproblem_to_csv(output_folder, model)
CSV.write(
joinpath(output_folder, "oGEP_Production.csv"),
Containers.rowtable(value, model[:v_production]; header = [:sc, :g, :h, :production]),
)
CSV.write(
joinpath(output_folder, "oGEP_ENS.csv"),
Containers.rowtable(value, model[:v_ens]; header = [:sc, :h, :ens]),
)
return nothing
end