Public interface
GUI constructor
EnergyModelsGUI.GUI
— MethodGUI(case::Case; kwargs...)
Initialize the EnergyModelsGUI window and visualize the topology of a system case
(and optionally visualize its results in a JuMP object model). The input argument can either be a Case
object from the EnergyModelsBase package or a dictionary containing system-related data stored as key-value pairs. This dictionary is corresponding to the the old EnergyModelsX case
dictionary.
Keyword arguments:
design_path::String=""
is a file path or identifier related to the design.id_to_color_map::Dict=Dict()
is a dict that mapsResource
sid
to colors.id_to_icon_map::Dict=Dict()
is a dict that mapsNode/Area
id
to .png files for icons.model::JuMP.Model=JuMP.Model()
is the solved JuMP model with results for thecase
.hide_topo_ax_decorations::Bool=true
is a visibility toggle of ticks, ticklabels and grids for the topology axis.expand_all::Bool=false
is the default option for toggling visibility of all nodes in all areas.periods_labels::Vector=[]
are descriptive labels for strategic periods.representative_periods_labels::Vector=[]
are descriptive labels for the representative periods.scenarios_labels::Vector=[]
are descriptive labels for scenarios.path_to_results::String=""
is the path to where exported files are stored.path_to_descriptive_names::String=""
is the Path to a .yml file where variables are described.descriptive_names_dict::Dict=Dict()
is a dictionary where variables are described.coarse_coast_lines::Bool=true
is a toggle for coarse or fine resolution coastlines.backgroundcolor=GLMakie.RGBf(0.99, 0.99, 0.99)
is the background color of the main window.fontsize::Int64=12
is the general fontsize.plot_widths::Tuple{Int64,Int64}=(1920, 1080)
is the resolution of the window.scale_tot_opex::Bool=false
multiplies total OPEX quantities with the duration of the strategic period.scale_tot_capex::Bool=false
divides total CAPEX quantities with the duration of the strategic period.colormap::Vector=Makie.wong_colors()
is the colormap used for plotting results.tol::Float64=1e-12
the tolerance for numbers close to machine epsilon precision.
EnergySystemDesign constructor
EnergyModelsGUI.EnergySystemDesign
— MethodEnergySystemDesign(system::AbstractSystem)
Create and initialize an instance of the EnergySystemDesign
struct, representing energy system designs. If the argument is a Case
instance, the function converts the case to a dictionary, and initializes the EnergySystemDesign
. If the argument is a AbstractSystem
, the function initializes the EnergySystemDesign
.
Keyword arguments:
design_path::String=""
is a file path or identifier related to the design.id_to_color_map::Dict
is a dictionary of resources and their assigned colors.id_to_icon_map::Dict
is a dictionary of nodes and their assigned icons.x::Real=0.0
is the initial x-coordinate of the system.y::Real=0.0
is the initial y-coordinate of the system.icon::String=""
is the optional (path to) icons associated with the system, stored as a string.parent::Union{Symbol, Nothing}=nothing
is a parent reference or indicator.
The function reads system configuration data from a TOML file specified by design_path
(if it exists), initializes various internal fields, and processes connections and wall values.
It constructs and returns an EnergySystemDesign
instance.
Structures
EnergyModelsGUI.EnergySystemDesign
— TypeEnergySystemDesign <: AbstractGUIObj
Mutable type for providing a flexible data structure for modeling and working with complex energy system designs in Julia.
Fields
system::AbstractSystem
is the data related to the system.id_to_color_map::Dict
is a dictionary of resources and their assigned colors.id_to_icon_map::Dict
is a dictionary of nodes and their assigned icons.components::Vector{EnergySystemDesign}
is the components of the system, stored as an array of EnergySystemDesign objects.connections::Vector{Connection}
are the connections between system parts.xy::Observable{Tuple{Real,Real}}
are the coordinates of the system, observed for changes.icon::String
is the optional (path to) icons associated with the system, stored as a string.color::Observable{Symbol}
is the color of the system, observed for changes and represented as a Symbol. The color is toggled to highlight system activation.wall::Observable{Symbol}
represents an aspect of the system's state, observed for changes and represented as a Symbol.file::String
is the filename or path associated with theEnergySystemDesign
.plots::Vector{Any}
is a vector with all Makie object associated with this object. The value does not have to be provided.invest_data::ProcInvData
stores processed investment data.
EnergyModelsGUI.GUI
— TypeGUI
The main type for the realization of the GUI.
Fields
fig::Figure
is the figure handle to the main figure (window).axes::Dict{Symbol,Axis}
is a collection of axes: :topo (axis for visualizing the topology), :results (axis for plotting results), and :info (axis for displaying information).legends::Dict{Symbol,Legend}
is a collection of legends: :topo (legend for the topology), :results (legend for plotting results).buttons::Dict{Symbol,Makie.Button}
is a dictionary of the GLMakie buttons linked to the gui.axes[:topo] object.menus::Dict{Symbol,Makie.Menu}
is a dictionary of the GLMakie menus linked to the gui.axes[:results] object.toggles::Dict{Symbol,Makie.Toggle}
is a dictionary of the GLMakie toggles linked to the gui.axes[:results] object.root_design::EnergySystemDesign
is the data structure used for the root topology.design::EnergySystemDesign
is the data structure used for visualizing the topology.model::Model
contains the optimization results.vars::Dict{Symbol,Any}
is a dictionary of miscellaneous variables and parameters.
Utilities
EnergyModelsGUI.set_colors
— Functionset_colors(products::Vector{<:Resource}, id_to_color_map::Dict)
Returns a dictionary that completes the dictionary id_to_color_map
with default color values for standard names (like Power, NG, Coal, CO2) collected from src/colors.yml
.
Color can be represented as a hex (i.e., #a4220b2) or a symbol (i.e. :green), but also a string of the identifier for default colors in the src/colors.yml
file.
EnergyModelsGUI.set_icons
— Functionset_icons(id_to_icon_map::Dict)
Return a dictionary id_to_icon_map
with id from nodes and icon paths based on provided paths (or name of .png icon file which will be found in the icons folder of any of the EMX packages).
The icon images are assumed to be in .png format, and the strings should not contain this file ending.