-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEMB_network.jl
More file actions
46 lines (39 loc) · 1.36 KB
/
EMB_network.jl
File metadata and controls
46 lines (39 loc) · 1.36 KB
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
# Generate the case and model data and run the model
case, model = generate_example_network()
optimizer = optimizer_with_attributes(HiGHS.Optimizer, MOI.Silent() => true)
m = run_model(case, model, optimizer)
# Display some results
ng_ccs_pp, coal_pp, = get_nodes(case)[[4, 5]]
@info "Capacity usage of the coal power plant"
pretty_table(
JuMP.Containers.rowtable(
value,
m[:cap_use][coal_pp, :];
header = [:t, :Value],
),
)
@info "Capacity usage of the natural gas + CCS power plant"
pretty_table(
JuMP.Containers.rowtable(
value,
m[:cap_use][ng_ccs_pp, :];
header = [:t, :Value],
),
)
## Code above identical to the example EnergyModelsBase.jl/examples/network.jl
############################################################################################
## Code below for displaying the GUI
using EnergyModelsGUI
# Set a special icon only for last node and the other icons based on type
id_to_icon_map = Dict(
EMB.Source => "Source",
EMB.NetworkNode => "Network",
EMB.Sink => "Sink",
7 => "factory_emissions",
)
# Update id_to_icon_map with full paths for the icons
id_to_icon_map = set_icons(id_to_icon_map)
# Set folder where visualization info is saved and retrieved
design_path = joinpath(@__DIR__, "design", "EMB", "network")
# Run the GUI
gui = GUI(case; design_path, id_to_icon_map, model = m)