-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathEMG_network.jl
More file actions
26 lines (20 loc) · 918 Bytes
/
EMG_network.jl
File metadata and controls
26 lines (20 loc) · 918 Bytes
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
# Generate the case and model data and run the model
case, model = generate_example_geo()
optimizer = optimizer_with_attributes(HiGHS.Optimizer, MOI.Silent() => true)
m = create_model(case, model)
set_optimizer(m, optimizer)
optimize!(m)
solution_summary(m)
## Code above identical to the example EnergyModelsGeography.jl/examples/network.jl
############################################################################################
## Code below for displaying the GUI
using EnergyModelsGUI
# Colors can be taylored as in the following example
products = get_products(case)
NG = products[1] # Extract NG object
Power = products[3] # Extract Power object
id_to_color_map = Dict(Power.id => :cyan, NG.id => "#FF9876")
# Set folder where visualization info is saved and retrieved
design_path = joinpath(@__DIR__, "design", "EMG", "network")
# Run the GUI
gui = GUI(case; design_path, id_to_color_map, model = m)