Public interface
Constructor
EnergyModelsGUI.GUI — Method
GUI(case::Case; kwargs...)
GUI(case::Dict; 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 instance from the EnergyModelsBase package or a dictionary containing system-related data stored as key-value pairs. The latter corresponds to 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 mapsResourcesidto colors.id_to_icon_map::Dict=Dict()is a dict that mapsNode/Areaidto .png files for icons.model::Union{JuMP.Model, String}is the solved JuMP model with results for thecase, but can also be the path (String) to the directory containing the JuMP results written as CSV-files.hide_topo_ax_decorations::Bool=trueis a visibility toggle of ticks, ticklabels and grids for the topology axis.expand_all::Bool=falseis 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=trueis 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=12is the general fontsize.plot_widths::Tuple{Int64,Int64}=(1920, 1080)is the resolution of the window.case_name::String = ""provides a tag for the window title.scale_tot_opex::Bool=falsemultiplies total OPEX quantities with the duration of the strategic period.scale_tot_capex::Bool=falsedivides 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-12the tolerance for numbers close to machine epsilon precision.enable_data_inspector::Bool=truetoggles the DataInspector functionality for hovering objects to show information.use_geomakie::Bool=truetoggles the use of GeoMakie for plotting geographical designs when thecasecontains geographical information.
Reading model results from a directory (i.e., model::String implying that the results are stored in CSV-files) does not support more than three indices for variables.
EnergyModelsGUI.EnergySystemDesign — Method
EnergySystemDesign(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::Dictis a dictionary of resources and their assigned colors.id_to_icon_map::Dictis a dictionary of nodes and their assigned icons.x::Float32=0.0f0is the initial x-coordinate of the system.y::Float32=0.0f0is the initial y-coordinate of the system.icon::String=""is the optional (path to) icons associated with the system, stored as a string.parent::AbstractGUIObj=NothingDesign()is a parent EnergySystemDesign object.
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.
Types
EnergyModelsGUI.EnergySystemDesign — Type
EnergySystemDesign <: AbstractGUIObjMutable type for providing a flexible data structure for modeling and working with complex energy system designs in Julia.
Fields
system::AbstractSystemis the data related to the system.id_to_color_map::Dictis a dictionary of resources and their assigned colors.id_to_icon_map::Dictis 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.parent::AbstractGUIObjis the parent of the system.xy::Observable{<:Point2f}is the coordinate of the system, observed for changes.icon::Stringis the optional (path to) icons associated with the system, stored as a string.color::Observable{RGBA{Float32}}is the color of the system, observed for changes. 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::Stringis 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::ProcInvDatastores processed investment data.
EnergyModelsGUI.GUI — Type
GUIThe main type for the realization of the GUI.
Fields
fig::Figureis the figure handle to the main figure (window).screen::GLMakie.Screenis the screen handle for displaying the figure.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::EnergySystemDesignis the data structure used for the root topology.design::EnergySystemDesignis the data structure used for visualizing the topology.model::Union{Model, Dict}contains the optimization results.vars::Dict{Symbol,Any}is a dictionary of miscellaneous variables and parameters.
Utilities
EnergyModelsGUI.save_results — Function
save_results(model::Model; directory=joinpath(pwd(),"csv_files"))Saves the model results of all variables as CSV files and metadata as a yml-file. If no directory is specified, it will create, if necessary, a new directory "csv_files" in the current working directory and save the files in said directory.
sourceEnergyModelsGUI.set_colors — Function
set_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 — Function
set_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.
source