`EnergyCommunity.ASSET_TYPE`

— Type`@enum ASSET_TYPE`

Enumeration type to specify the type of the assets. Implemented values:

- LOAD: load components
- REN: renewable assets
- BATT: battery components
- CONV: battery converters
- THER: thermal generators

`EnergyCommunity.ModelEC`

— TypeLoad Model from disk

file_name : str Filename

`EnergyCommunity.ModelEC`

— TypeConstructor of a ModelEC

**Inputs**

data : Dict Data of the EC group*type : AbstractGroup Type of EC optimizer Optimizer of the model user*set : Vector Vector of the users

`EnergyCommunity.ModelEC`

— TypeCopy constructor

`EnergyCommunity.ModelEC`

— TypeStructure encapsuling the data

`TheoryOfGames.EnumMode`

— Method`EnumMode(ECModel::AbstractEC)`

Function to create the EnumMode item for the TheoryOfGames.jl package

`TheoryOfGames.IterMode`

— Method`IterMode(ECModel::AbstractEC, base_group_type::AbstractGroup)`

Function to create the IterMode item for the TheoryOfGames.jl package

`Base.copy`

— MethodCopy of ModelEC

`Base.deepcopy`

— MethodDeepcopy of ModelEC

`Base.zero`

— MethodFunction zero to represent the empty ModelEC

`EnergyCommunity._jump_to_dict`

— Method`_jump_to_dict`

Function to turn a JuMP model to a dictionary

`EnergyCommunity._print_summary`

— Method`_print_summary(io::IO, model::AbstractEC)`

Print a plain-text summary of `model`

to `io`

.

`EnergyCommunity._verify_data`

— MethodFunction to verify the data loaded from the disk

`EnergyCommunity._verify_users_data`

— MethodFunction to verify the users data loaded from the disk

`EnergyCommunity.add_EC_economics_summary!`

— MethodFunction to create the output dataframe of the economics of the EC

`EnergyCommunity.add_EC_peak_summary!`

— MethodFunction to create the output dataframe of peak power for the EC

`EnergyCommunity.add_branching_priorities!`

— MethodGeneral fallback for branching priorities

`EnergyCommunity.add_info_solution_summary!`

— MethodFunction to create the dataframe to report the status of the optimization

`EnergyCommunity.add_notations!`

— MethodGeneral fallback for notations

`EnergyCommunity.add_users_design_summary!`

— MethodFunction to create the output dataframe of design capacity

`EnergyCommunity.add_users_economics_summary!`

— MethodFunction to create the output dataframe of the users' economics

`EnergyCommunity.add_users_peak_summary!`

— MethodFunction to create the output dataframe of peak power

`EnergyCommunity.asset_names`

— MethodFunction to get the list of the assets for a user

`EnergyCommunity.asset_names`

— MethodFunction to get the list of the assets for a user in a list of elements

`EnergyCommunity.asset_names`

— MethodFunction to get the list of the assets for a user

`EnergyCommunity.asset_names_ex`

— MethodFunction to get the list of the assets for a user in a list of elements except a list of given types

`EnergyCommunity.asset_type`

— MethodFunction to get the asset type of a component

`EnergyCommunity.build_base_utility!`

— Methodbuild*base*utility!(ECModel::AbstractEC, base_group::AbstractGroupANC)

When in the CO case the ANC model is used as base case, then this function builds the corresponding constraint

`EnergyCommunity.build_base_utility!`

— Methodbuild*base*utility!(ECModel::AbstractEC, base_group::AbstractGroupNC)

When in the CO case the NC model is used as base case, then this function builds the corresponding constraint

`EnergyCommunity.build_base_utility!`

— Methodbuild*base*utility!(ECModel::AbstractEC, no*aggregator*group::AbstractGroupANC)

When in the CO case the ANC model is used as reference case for when the aggregator is not in the group, then this function builds the corresponding constraint

`EnergyCommunity.build_least_profitable!`

— Methodbuild*least*profitable!(ECModel::AbstractEC; no*aggregator*group::AbstractGroup=GroupNC(), add_EC=true)

Function to build the model to identify the least profitable coalition

`EnergyCommunity.build_model!`

— MethodBuild the mathematical problem for the EC

`EnergyCommunity.build_model!`

— MethodAbstract build function model for generic EnergyCommunity model

`EnergyCommunity.build_no_agg_utility!`

— Methodbuild*no*agg*utility!(ECModel::AbstractEC, no*aggregator*group::AbstractGroupANC; base*model=nothing)

When in the CO case the ANC model is used as reference case for when the aggregator is not in the group, then this function builds the corresponding constraint

`EnergyCommunity.build_no_agg_utility!`

— Methodbuild*no*agg*utility!(ECModel::AbstractEC, no*aggregator_group::AbstractGroupNC; kwargs...)

When the NC case is the reference value when no aggregator is available, then no changes in the model are required

`EnergyCommunity.build_no_agg_utility!`

— Methodbuild*no*agg*utility!(ECModel::AbstractEC, no*aggregator_group::Any)

Not implemented case

`EnergyCommunity.build_noagg_least_profitable!`

— Methodbuild*noagg*least*profitable(ECModel::ModelEC; use*notations=false, optimizer=nothing)

Function to create an ecmodel that returns the least profitable coalition for ANC models

`EnergyCommunity.build_specific_model!`

— MethodSet the ANC-specific model for the EC

`EnergyCommunity.build_specific_model!`

— MethodSet the CO-specific model for the EC

`EnergyCommunity.build_specific_model!`

— MethodSet the NC/ANC-specific model for the EC

`EnergyCommunity.business_plan`

— Function`business_plan(ECModel::AbstractEC, profit_distribution)`

Function to describe the cost term distributions by all users for all years.

**Parameters**

- ECModel : AbstractEC EnergyCommunity model
- profit_distribution Final objective function
- user
*set*financial User set to be considered for the financial analysis

**Returns**

```
The output value is a NamedTuple with the following elements
- df_business
Dataframe with the business plan information
```

`EnergyCommunity.business_plan_plot`

— Method`business_plan_plot(ECModel::AbstractEC, profit_distribution)`

Function to describe the cost term distributions by all users for all years.

**Parameters**

- ECModel : AbstractEC EnergyCommunity model
- df_business Dataframe with the business plan information
- plot_struct Plot structure of the business plan

**Returns**

`The output value is a plot with the business plan information`

`EnergyCommunity.calculate_energy_ratios`

— Method`calculate_energy_ratios(users_data, _P_ren_us, user_agg_set, agg_id, time_set, _P_tot_us, _x_us)`

Calculate energy ratios '''

**Outputs**

- PV_frac
- PV
*frac*tot - wind_frac
- wind
*frac*tot

'''

`EnergyCommunity.calculate_grid_export`

— Method`calculate_grid_export(ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid export for the energy community and users. Output is normalized with respect to the demand when per_unit is true

''' Outputs –––- grid_frac : DenseAxisArray Reliance on the grid demand for each user and the aggregation '''

`EnergyCommunity.calculate_grid_export`

— Method`calculate_grid_export(::AbstractGroupANC, ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid export for the Aggregated Non Cooperative case. Output is normalized with respect to the demand when per*unit is true ''' Outputs –––- grid*frac : DenseAxisArray Reliance on the grid demand for each user and the aggregation '''

`EnergyCommunity.calculate_grid_export`

— Method`calculate_grid_export(::AbstractGroupCO, ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid export for the Cooperative case. Output is normalized with respect to the demand when per*unit is true ''' Outputs –––- grid*frac : DenseAxisArray Reliance on the grid demand for each user and the aggregation '''

`EnergyCommunity.calculate_grid_export`

— Method`calculate_grid_export(::AbstractGroupNC, ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid export for the Non-Cooperative case Output is normalized with respect to the demand when per_unit is true

''' Outputs –––- grid_frac : DenseAxisArray Reliance on the grid demand for each user and the aggregation '''

`EnergyCommunity.calculate_grid_import`

— Method`calculate_grid_import(ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid usage for the energy community and users. Output is normalized with respect to the demand when per_unit is true

''' Outputs –––- grid_frac : DenseAxisArray Reliance on the grid demand for each user and the aggregation '''

`EnergyCommunity.calculate_grid_import`

— Method`calculate_grid_import(::AbstractGroupANC, ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid usage for the Aggregated Non Cooperative case. Output is normalized with respect to the demand when per*unit is true ''' Outputs –––- grid*frac : DenseAxisArray Reliance on the grid demand for each user and the aggregation '''

`EnergyCommunity.calculate_grid_import`

— Method`calculate_grid_import(::AbstractGroupCO, ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid usage for the Cooperative case. Output is normalized with respect to the demand when per*unit is true ''' Outputs –––- grid*frac : DenseAxisArray Reliance on the grid demand for each user and the aggregation '''

`EnergyCommunity.calculate_grid_import`

— Method`calculate_grid_import(::AbstractGroupNC, ECModel::AbstractEC; per_unit::Bool=true)`

Calculate grid usage for the Non-Cooperative case Output is normalized with respect to the demand when per_unit is true

`EnergyCommunity.calculate_grid_ratios_agg`

— Method`calculate_grid_ratios_noagg(users_data, user_agg_set, agg_id, time_set, _P_tot_us_agg)`

Calculate energy ratios '''

**Outputs**

- grid
*frac*agg - grid
*frac*tot_agg

'''

`EnergyCommunity.calculate_grid_ratios_noagg`

— Method`calculate_grid_ratios_noagg(users_data, user_agg_set, agg_id, time_set, _P_tot_us_noagg)`

Calculate energy ratios '''

**Outputs**

- grid
*frac*noagg - grid
*frac*tot_noagg

'''

`EnergyCommunity.calculate_production`

— Method`calculate_production(ECModel::AbstractEC)`

Function to calculate the energy production by user Outputs –––- production*us*EC : DenseAxisArray DenseAxisArray representing the production by the EC and each user

`EnergyCommunity.calculate_production_shares`

— Method`calculate_production_shares(ECModel::AbstractEC; per_unit::Bool=true)`

Calculate energy ratio by energy production resource for a generic group Output is normalized with respect to the demand when per_unit is true '''

**Outputs**

frac : DenseAxisArray DenseAxisArray describing the share of energy production by energy resource by user and the entire system, normalized with respect to the demand of the corresponding group

'''

`EnergyCommunity.calculate_self_consumption`

— Method`calculate_self_consumption(ECModel::AbstractEC; per_unit::Bool=true)`

Calculate the demand that each user meets using its own sources, or self consumption. Output is normalized with respect to the demand when per_unit is true

''' Outputs –––- shared*cons*frac : DenseAxisArray Shared consumption for each user and the aggregation '''

`EnergyCommunity.calculate_self_production`

— Method`calculate_self_production(ECModel::AbstractEC; per_unit::Bool=true, only_shared::Bool=false)`

Calculate the self production for each user. Output is normalized with respect to the demand when per_unit is true

''' Outputs –––- shared*en*frac : DenseAxisArray Shared energy for each user and the aggregation '''

`EnergyCommunity.calculate_shared_consumption`

— Method`calculate_shared_consumption(ECModel::AbstractEC; per_unit::Bool=true)`

Calculate the demand that each user meets using its own sources or other users. When only*shared is false, also self consumption is considered, otherwise only shared consumption. Output is normalized with respect to the demand when per*unit is true

''' Outputs –––- shared*cons*frac : DenseAxisArray Shared consumption for each user and the aggregation '''

`EnergyCommunity.calculate_shared_consumption`

— Method`calculate_shared_consumption(::AbstractGroupANC, ECModel::AbstractEC; per_unit::Bool=true, only_shared::Bool=false)`

Calculate the demand that each user meets using its own sources or other users for the Aggregated Non Cooperative case. In this case, there can be shared energy, non only self consumption. When only*shared is false, also self consumption is considered, otherwise only shared energy. Shared energy means energy that is shared between Output is normalized with respect to the demand when per*unit is true

''' Outputs –––- shared*cons*frac : DenseAxisArray Shared consumption for each user and the aggregation '''

`EnergyCommunity.calculate_shared_consumption`

— Method`calculate_shared_consumption(::AbstractGroupCO, ECModel::AbstractEC; per_unit::Bool=true, only_shared::Bool=false)`

Calculate the demand that each user meets using its own sources or other users for the Cooperative case. In the Cooperative case, there can be shared energy, non only self consumption. When only*shared is false, also self consumption is considered, otherwise only shared energy. Shared energy means energy that is shared between Output is normalized with respect to the demand when per*unit is true

*cons*frac : DenseAxisArray Shared consumption for each user and the aggregation '''

`EnergyCommunity.calculate_shared_consumption`

— Method`calculate_shared_consumption(::AbstractGroupNC, ECModel::AbstractEC; kwargs...)`

Calculate the demand that each user meets using its own sources or other users for the Non-Cooperative case. In the Non-Cooperative case, there is no shared energy, only self consumption. Shared energy means energy that is shared between Output is normalized with respect to the demand when per_unit is true

*cons*frac : DenseAxisArray Shared consumption for each user and the aggregation '''

`EnergyCommunity.calculate_shared_energy_abs_agg`

— Method```
calculate_shared_energy_abs_agg(users_data, user_set, time_set,
_P_ren_us, _P_tot_us, shared_en_frac, shared_cons_frac)
```

Calculate the absolute shared produced energy (en), the shared consumption (cons) and self consumption (self cons) '''

**Outputs**

- shared
*en*frac*us*agg - shared
*en*tot*frac*agg - shared
*cons*frac*us*agg - shared
*cons*tot*frac*agg - self
*cons*frac*us*agg - self
*cons*tot*frac*agg

'''

`EnergyCommunity.calculate_shared_energy_agg`

— Method```
calculate_shared_energy(users_data, user_agg_set, agg_id, time_set,
_P_ren_us, _P_tot_us, shared_en_frac, shared_cons_frac)
```

Calculate the shared produced energy (en) and the shared consumption (cons) ratios '''

**Outputs**

- shared
*en*frac*us*agg - shared
*en*tot*frac*agg - shared
*cons*frac*us*agg - shared
*cons*tot*frac*agg

'''

`EnergyCommunity.calculate_shared_production`

— Method`calculate_shared_production(ECModel::AbstractEC; per_unit::Bool=true)`

Calculate the energy that each user produces and uses in its own POD or it is commercially consumed within the EC, when creaded. When only*shared is false, also self production is considered, otherwise only shared energy. Output is normalized with respect to the demand when per*unit is true

*cons*frac : DenseAxisArray Shared consumption for each user and the aggregation '''

`EnergyCommunity.calculate_shared_production`

— Method`calculate_shared_production(::AbstractGroupANC, ECModel::AbstractEC; per_unit::Bool=true, only_shared::Bool=false)`

Calculate the shared produced energy for the Aggregated Non Cooperative case. In this case, there can be shared energy between users, not only self production. When only*shared is false, also self production is considered, otherwise only shared energy. Shared energy means energy that is shared between Output is normalized with respect to the demand when per*unit is true

''' Outputs –––- shared*en*frac : DenseAxisArray Shared energy for each user and the aggregation '''

`EnergyCommunity.calculate_shared_production`

— Method`calculate_shared_production(::AbstractGroupCO, ECModel::AbstractEC; per_unit::Bool=true, only_shared::Bool=false)`

Calculate the shared produced energy for the Cooperative case. In the Cooperative case, there can be shared energy between users, not only self production. When only*shared is false, also self production is considered, otherwise only shared energy. Shared energy means energy that is shared between Output is normalized with respect to the demand when per*unit is true

''' Outputs –––- shared*en*frac : DenseAxisArray Shared energy for each user and the aggregation '''

`EnergyCommunity.calculate_shared_production`

— Method`calculate_shared_production(::AbstractGroupNC, ECModel::AbstractEC; kwargs...)`

Calculate the shared produced energy for the Non-Cooperative case. In the Non-Cooperative case, there is no shared energy between users, only self production. Output is normalized with respect to the demand when per_unit is true

''' Outputs –––- shared*en*frac : DenseAxisArray Shared energy for each user and the aggregation '''

`EnergyCommunity.calculate_time_shared_consumption`

— Method`calculate_time_shared_consumption(ECModel::AbstractEC)`

Calculate the time series of the shared consumed energy for the Energy Community.

For every time step and user, this time series highlight the quantity of load that is met by using shared energy.

''' Outputs –––- shared*cons*us : DenseAxisArray Shared consumption for each user and the aggregation and time step '''

`EnergyCommunity.calculate_time_shared_consumption`

— Method`calculate_time_shared_consumption(::AbstractGroupANC, ECModel::AbstractEC; add_EC=true, kwargs...)`

Calculate the time series of the shared consumed energy for the Cooperative case. In the Cooperative case, there can be shared energy between users, not only self production.

For every time step and user, this time series highlight the quantity of load that is met by using shared energy.

''' Outputs –––- shared*cons*us : DenseAxisArray Shared consumption for each user and the aggregation and time step '''

`EnergyCommunity.calculate_time_shared_consumption`

— Method`calculate_time_shared_consumption(::AbstractGroupCO, ECModel::AbstractEC; add_EC=true, kwargs...)`

Calculate the time series of the shared consumed energy for the Cooperative case. In the Cooperative case, there can be shared energy between users, not only self production.

For every time step and user, this time series highlight the quantity of load that is met by using shared energy.

''' Outputs –––- shared*cons*us : DenseAxisArray Shared consumption for each user and the aggregation and time step '''

`EnergyCommunity.calculate_time_shared_consumption`

— Method`calculate_time_shared_consumption(::AbstractGroupNC, ECModel::AbstractEC; add_EC=true, kwargs...)`

Calculate the time series of the shared consumed energy for the Cooperative case. In the Cooperative case, there can be shared energy between users, not only self production.

*cons*us : DenseAxisArray Shared consumption for each user and the aggregation and time step '''

`EnergyCommunity.calculate_time_shared_production`

— Method`calculate_time_shared_production(ECModel::AbstractEC; kwargs...)`

Calculate the time series of the shared consumed energy for the Energy Community.

For every time step and user, this time series highlight the quantity of production that meets needs by other users.

''' Outputs –––- shared*prod*us : DenseAxisArray Shared production for each user and the aggregation and time step '''

`EnergyCommunity.calculate_time_shared_production`

— Method`calculate_time_shared_production(::AbstractGroupANC, ECModel::AbstractEC; add_EC=true, kwargs...)`

Calculate the time series of the shared produced energy for the Cooperative case. In the Cooperative case, there can be shared energy between users, not only self production.

For every time step and user, this time series highlight the quantity of production that meets needs by other users.

''' Outputs –––- shared*prod*us : DenseAxisArray Shared production for each user and the aggregation and time step '''

`EnergyCommunity.calculate_time_shared_production`

— Method`calculate_time_shared_production(::AbstractGroupCO, ECModel::AbstractEC; add_EC=true, kwargs...)`

Calculate the time series of the shared produced energy for the Cooperative case. In the Cooperative case, there can be shared energy between users, not only self production.

For every time step and user, this time series highlight the quantity of production that meets needs by other users.

''' Outputs –––- shared*prod*us : DenseAxisArray Shared production for each user and the aggregation and time step '''

`EnergyCommunity.calculate_time_shared_production`

— Method`calculate_time_shared_production(::AbstractGroupNC, ECModel::AbstractEC; add_EC=true, kwargs...)`

Calculate the time series of the shared produced energy for the Cooperative case. In the Cooperative case, there can be shared energy between users, not only self production.

*prod*us : DenseAxisArray Shared production for each user and the aggregation and time step '''

`EnergyCommunity.check_valid_data_dict`

— MethodCheck whether the dictionary data has the needed components

`EnergyCommunity.component`

— MethodFunction to get the components value of a dictionary

`EnergyCommunity.components`

— MethodFunction to get the components list of a dictionary

`EnergyCommunity.create_example_data`

— Method`create_example_data(parent_folder, config_name::String = "default")`

Create an example data for the Energy Community model. This function creates in the specified folder the necessary data to run the Energy Community model, based on the specified configuration name.

**Parameters**

- parent_folder : AbstractString Parent folder where the example data will be created
- config_name : String Configuration name to be used to create the example data Supported values: "default"

`EnergyCommunity.create_output_data`

— MethodFunction to create output data after the optimization for TheoryOfGames.jl

`EnergyCommunity.data_sankey`

— Method`plot_sankey(ECModel::AbstractEC)`

Function to create the input data for plotting any Sankey diagram representing the energy flows across the energy community

**Inputs**

ECModel : AbstractEC Energy Community model name_units : (optional) Vector Labels used for the sankey diagram with the following order: "Market buy", [users labels], "Community", "Market sell", [users labels]

`EnergyCommunity.device_names`

— MethodFunction to get the list of devices for a user

`EnergyCommunity.explode_data`

— MethodReturn main data elements of the dataset of the ECModel: general parameters, users data and market data

`EnergyCommunity.explode_data`

— MethodReturn main data elements of the dataset: general parameters, users data and market data

`EnergyCommunity.field`

— FunctionFunction get field that throws an error if the field is not found

`EnergyCommunity.field_component`

— MethodFunction to get the components value of a dictionary, with default value

`EnergyCommunity.field_component`

— MethodFunction to get the components value of a dictionary

`EnergyCommunity.field_d`

— FunctionFunction to safely get a field of a dictionary with default value

`EnergyCommunity.finalize_results!`

— Methodfinalize_results!(::AbstractGroupANC, ECModel::AbstractEC)

Function to finalize the results of the Aggregated Non Cooperative model after the execution

`EnergyCommunity.finalize_results!`

— Methodfinalize_results!(::AbstractGroupCO, ECModel::AbstractEC)

Function to finalize the results of the Cooperative model after the execution Nothing to do

`EnergyCommunity.finalize_results!`

— Methodfinalize_results!(::AbstractGroupNC, ECModel::AbstractEC)

Function to finalize the results of the Non Cooperative model after the execution Many of the variables are set to zero due to the absence of cooperation between users

`EnergyCommunity.general`

— MethodFunction to get the general parameters

`EnergyCommunity.generator_names`

— MethodFunction to get the list of generators for a user

`EnergyCommunity.get_annotations`

— MethodGet annotations for Benders decomposition

`EnergyCommunity.get_group_type`

— MethodGet the EC group type

`EnergyCommunity.get_subproblem_vars_by_user`

— MethodGet variables related to the user u_name for a DenseAxisArray

`EnergyCommunity.get_subproblem_vars_by_user`

— MethodGet variables related to the user u_name for a SparseAxisArray

`EnergyCommunity.get_user_set`

— MethodGet the EC user set

`EnergyCommunity.has_any_asset`

— FunctionFunction to check whether an user has any asset

`EnergyCommunity.has_asset`

— MethodFunction to check whether an user has an asset type

`EnergyCommunity.has_asset`

— MethodFunction to check whether an user has an asset given its name

`EnergyCommunity.has_component`

— MethodFunction to know if a dictionary has a particular component

`EnergyCommunity.has_type`

— MethodAuxiliary function to check if the key 'type' is available in the dictionary d, otherwise false

`EnergyCommunity.load!`

— Method`load!(output_file::AbstractString, ECModel::AbstractEC)`

Function to save the results and the model to the hard drive

`EnergyCommunity.market`

— MethodFunction to get the market configuration

`EnergyCommunity.name`

— Method`name(model::AbstractEC)`

Return the name of the model.

`EnergyCommunity.name`

— Method`name(model::ModelEC)`

Return the name of the model.

`EnergyCommunity.objective_by_user`

— MethodFunction to return the objective function by User

`EnergyCommunity.objective_by_user`

— MethodFunction to return the objective function by user in the Aggregated Non Cooperative case

`EnergyCommunity.objective_by_user`

— MethodFunction to return the objective function by user in the NonCooperative case

`EnergyCommunity.objective_by_user`

— MethodFunction to return the objective function by user in the NonCooperative case

`EnergyCommunity.output_results`

— MethodOutput results for the EC configuration

`EnergyCommunity.output_results`

— MethodOutput results for the NC configuration

`EnergyCommunity.parse_dataprofile`

— MethodFunction to throw error for unformatted data

`EnergyCommunity.parse_dataprofile`

— MethodFunction to parse a string value of a profile to load the corresponding dataframe

`EnergyCommunity.parse_dataprofile`

— MethodFunction to parse a personalized processing to generate the data When profile_value is a dictionary, then the user is asking a custom processing of data by a function

`EnergyCommunity.parse_dataprofile`

— MethodFunction to parse a string value of a profile to load the corresponding dataframe

`EnergyCommunity.parse_dataprofile`

— MethodFunction to parse a string value of a profile to load the corresponding dataframe

`EnergyCommunity.parse_peak_quantity_by_time_vectors`

— MethodFunction to parse the peak power categories and tariff

`EnergyCommunity.plot_sankey`

— Method`plot_sankey(ECModel::AbstractEC, sank_data::Dict)`

Function to plot the Sankey diagram representing the energy flows across the energy community. This function can be used to plot the sankey diagram of already processed data sank_data.

**Inputs**

ECModel : AbstractEC Energy Community model name_units : (optional) Vector Labels used for the sankey diagram with the following order: "Market buy", [users labels], "Community", "Market sell", [users labels]

`EnergyCommunity.plot_sankey`

— Method`plot_sankey(ECModel::AbstractEC)`

Function to plot the Sankey diagram representing the energy flows across the energy community

**Inputs**

ECModel : AbstractEC Energy Community model name_units : (optional) Vector Labels used for the sankey diagram with the following order: "Market buy", [users labels], "Community", "Market sell", [users labels]

`EnergyCommunity.prepare_summary`

— Method```
prepare_summary(::AbstractGroupANC, ECModel::AbstractEC;
user_set::Vector=Vector())
```

Save base excel file with a summary of the results for the Aggregated Non Cooperative case

`EnergyCommunity.prepare_summary`

— Method```
prepare_summary(::AbstractGroupCO, ECModel::AbstractEC;
user_set::Vector=Vector())
```

Save base excel file with a summary of the results for the Cooperative case

`EnergyCommunity.prepare_summary`

— Method```
prepare_summary(::AbstractGroupNC, ECModel::AbstractEC, file_summary_path::AbstractString;
user_set::Vector=Vector())
```

Prepare the dataframe lists to be saved in an excel file

**Outputs**

output_list: Vector{Pair{String, DataFrame}} Vector of pairs representing the sheets of the Excel file and the corresponding data to save

`EnergyCommunity.print_summary`

— MethodFunction to print a summary of the results of the model. The function dispatches the execution to the appropriate function depending on the Aggregation type of the EC

`EnergyCommunity.print_summary`

— Method`print_summary(::AbstractGroupANC, ECModel::AbstractEC)`

Function to print the main results of the model

`EnergyCommunity.print_summary`

— Method`print_summary(::AbstractGroupCO, ECModel::AbstractEC)`

Function to print the main results of the model

`EnergyCommunity.print_summary`

— Method`print_summary(::AbstractGroupNC, ECModel::AbstractEC)`

Function to print the main results of the model

`EnergyCommunity.profile`

— MethodFunction to get a specific profile

`EnergyCommunity.profile_component`

— MethodFunction to get a specific profile

`EnergyCommunity.profiles`

— MethodFunction to get the profile dictionary

`EnergyCommunity.read_input`

— MethodFunction to read the input of the optimization model described as a yaml file

`EnergyCommunity.reset_user_set!`

— MethodSet the EC user set equal to the stored user_set

`EnergyCommunity.save_summary`

— MethodFunction to save a summary of the results of the model. The function dispatches the execution to the appropriate function depending on the Aggregation type of the EC

`EnergyCommunity.set_group_type!`

— MethodSet the EC group type

`EnergyCommunity.set_least_profitable_profit!`

— Methodset*least*profitable*profit!(ECModel::AbstractEC, profit*distribution)

Function to set the profit distribution of the least profitable problem

**Parameters**

ECModel : ModelEC Model of the community profit_distribution : AbstractDict Profit distribution per user

`EnergyCommunity.set_objective!`

— Method`Function to set the objective function of the model of the Aggregated-Non-Cooperative model`

`EnergyCommunity.set_objective!`

— MethodSet the objective for the cooperative approach

`EnergyCommunity.set_objective!`

— Method`Function to set the objective function of the model of the Non-Cooperative model`

`EnergyCommunity.set_user_set!`

— MethodSet the EC user set

`EnergyCommunity.split_financial_terms`

— Function`split_financial_terms(ECModel::AbstractEC, profit_distribution)`

Function to describe the cost term distributions by all users.

**Parameters**

- ECModel : AbstractEC EnergyCommunity model
- profit_distribution Final objective function

**Returns**

```
The output value is a NamedTuple with the following elements
- NPV: the NPV of each user given the final profit_distribution adjustment
by game theory techniques
- CAPEX: the annualized CAPEX
- OPEX: the annualized operating costs (yearly maintenance and yearly peak and energy grid charges)
- REP: the annualized replacement costs
- RV: the annualized recovery charges
- REWARD: the annualized reward distribution by user
- PEAK: the annualized peak costs
- EN_SELL: the annualized revenues from energy sales
- EN_BUY: the annualized costs from energy consumption and buying
- EN_NET: the annualized net energy costs
```

`EnergyCommunity.split_yearly_financial_terms`

— Functionsplit*yearly*financial*terms(ECModel::AbstractEC, profit*distribution)

Function to describe the cost term distributions by all users for all years.

**Parameters**

- ECModel : AbstractEC EnergyCommunity model
- profit_distribution Final objective function
- user
*set*financial User set to be considered for the financial analysis

**Returns**

```
The output value is a NamedTuple with the following elements
- NPV: the NPV of each user given the final profit_distribution adjustment by game theory techniques
- CAPEX: the annualized CAPEX
- OPEX: the annualized operating costs (yearly maintenance and yearly peak and energy grid charges)
- REP: the annualized replacement costs
- RV: the annualized recovery charges
- REWARD: the annualized reward distribution by user
- PEAK: the annualized peak costs
- EN_SELL: the annualized revenues from energy sales
- EN_BUY: the annualized costs from energy consumption and buying
- EN_NET: the annualized net energy costs
```

`EnergyCommunity.to_least_profitable_coalition_callback`

— Method`to_least_profitable_coalition_callback(ECModel::AbstractEC, base_group::AbstractGroup=GroupNC(); no_aggregator_group::AbstractGroup=GroupNC())`

Function that returns a callback function that, given as input a profit distribution scheme, returns the coalition that has the least benefit in remaining in the grand coalition. The returned function least*profitable*coalition_callback accepts an AbstractDict as argument that specifies the profit distribution by user that is used to compute the least benefit procedure.

**Parameters**

ECModel : AbstractEC Cooperative EC Model of the EC to study. When the model is not cooperative an error is thrown. base*group : AbstractGroup (optional, default GroupNC()) Base group with respect the benefit is calculated. no*aggregator*group : AbstractGroup (optional, default GroupNC()) Type of aggregation group of the community when no aggregator is available When not provided, an equivalent NonCooperative model is created and the corresponding utilities by user are used as reference case. number*of*solutions : (optional, default 1) Number of solutions to be returned at every iteration number*of*solutions <= 0: all solutions are returned number*of*solutions >= 1: specific number of solutions are returned relax*combinatorial : (optional, default false) When true, the full least profitable coalition MILP problem is relaxed to continuous, in the combinatorial part direct*model : (optional, default false) When true the JuMP model is direct callback*solution : Dict (optional, default empty) Dictionary of callbacks depending on the termination status of the optimization. Keys shall be of type JuMP.TerminationStatusCode, and outputs a function with as argument a ModelEC branching*priorities : Bool (optional, default true) Option to specify if add the branching priorities decompose*ANC : Bool (optional, default false) When True, if the no*aggregator*group is ANC and, then the main optimization model is decomposed into two models: (a) when no Aggregator is in the coalition and (b) when the aggregator is in the coalition In this case, (a) is optimized first and if the optimization is beyond a given threshold, the execution is terminated without optimizing (b). The threshold is provided as an optional input in the callback function returned by the function. Otherwise the optimization continues with (b). decompose*rel*tolerance : Float Relative tolerance of the decompose*ANC procedure that compares the stopping criterion with the current result decompose*abs*tolerance : Float Absolute tolerance of the decompose*ANC procedure that compares the stopping criterion with the current result

**Return**

least*profitable*coalition_callback : Function Function that accepts as input an AbstractDict representing the benefit distribution by user

`EnergyCommunity.to_objective_callback_by_subgroup`

— Method`to_objective_callback_by_subgroup(ECModel::AbstractEC)`

Function that returns a callback function that quantifies the objective of a given subgroup of users The returned function objective_func accepts as arguments an AbstractVector of users and returns the objective of the aggregation for any model

**Parameters**

ECModel : AbstractEC Cooperative EC Model of the EC to study. When the model is not cooperative an error is thrown.

**Return**

objective*callback*by_subgroup : Function Function that accepts as input an AbstractVector (or Set) of users and returns as output the benefit of the specified community

`EnergyCommunity.to_objective_callback_by_subgroup`

— Method`to_objective_callback_by_subgroup(::AbstractGroupANC, ECModel::AbstractEC)`

Function that returns a callback function that quantifies the objective of a given subgroup of users The returned function objective_func accepts as arguments an AbstractVector of users and returns the objective of the aggregation for Aggregated Non Cooperative models

**Parameters**

ECModel : AbstractEC Cooperative EC Model of the EC to study. When the model is not cooperative an error is thrown. base_model : AbstractEC optional When provided, it represents the base model used to perform the calculations

**Return**

objective*callback*by_subgroup : Function Function that accepts as input an AbstractVector (or Set) of users and returns as output the benefit of the specified community

`EnergyCommunity.to_objective_callback_by_subgroup`

— Method`to_objective_callback_by_subgroup(::AbstractGroupCO, ECModel::AbstractEC)`

Function that returns a callback function that quantifies the objective of a given subgroup of users The returned function objective_func accepts as arguments an AbstractVector of users and returns the objective of the aggregation for Aggregated Cooperative models

**Parameters**

ECModel : AbstractEC Cooperative EC Model of the EC to study. When the model is not cooperative an error is thrown. no*aggregator*group : AbstractGroup (otional, default NonCooperative) EC group type when no aggregator is considered

**Return**

objective*callback*by_subgroup : Function Function that accepts as input an AbstractVector (or Set) of users and returns as output the benefit of the specified community

`EnergyCommunity.to_objective_callback_by_subgroup`

— Method`to_objective_callback_by_subgroup(::AbstractGroupNC, ECModel::AbstractEC)`

Function that returns a callback function that quantifies the objective of a given subgroup of users The returned function objective_func accepts as arguments an AbstractVector of users and returns the objective of the aggregation for Non Cooperative models

**Parameters**

ECModel : AbstractEC Cooperative EC Model of the EC to study. When the model is not cooperative an error is thrown.

**Return**

*callback*by_subgroup : Function Function that accepts as input an AbstractVector (or Set) of users and returns as output the benefit of the specified community

`EnergyCommunity.to_utility_callback_by_subgroup`

— Method`to_utility_callback_by_subgroup(ECModel::AbstractEC, base_group_type::AbstractGroup)`

Function that returns a callback function that quantifies the benefit of a given subgroup of users The returned function utility_func accepts as arguments an AbstractVector of users and returns the benefit with respect to the base case of the users optimized independently

**Parameters**

ECModel : AbstractEC Cooperative EC Model of the EC to study. When the model is not cooperative an error is thrown. base*group*type : AbstractGroup Type of the base case to consider no*aggregator*group : AbstractGroup (otional, default NonCooperative) EC group type for when no aggregator is considered

**Return**

utility*callback*by_subgroup : Function Function that accepts as input an AbstractVector (or Set) of users and returns as output the benefit of the specified community

`EnergyCommunity.user_names`

— MethodGet the list of users

`EnergyCommunity.users`

— MethodFunction to get the users configuration

`FileIO.load`

— Method`load(output_file::AbstractString)`

Function to save the results and the model to the hard drive

`FileIO.save`

— Method`save(output_file::AbstractString, ECModel::AbstractEC)`

Function to save the results and the model to the hard drive

`JuMP.objective_function`

— Method`objective_function(ECModel::AbstractEC)`

Get the objective function of the model

`JuMP.objective_value`

— MethodFunction to return the objective function by User

`JuMP.optimize!`

— MethodSolve the optimization problem for the EC

`JuMP.result_count`

— MethodSolve the optimization problem for the EC

`JuMP.termination_status`

— Method`termination_status(ECModel::AbstractEC)`

Calculate the optimization status of the model

`RecipesBase.plot`

— FunctionFunction to plot the EC model

`RecipesBase.plot`

— MethodFunction to plot the results of the Aggregated non cooperative configuration

`RecipesBase.plot`

— MethodFunction to plot the results of the Cooperative EC

`RecipesBase.plot`

— Method```
plot(::AbstractGroupNC, ECModel::AbstractEC, output_plot_file::AbstractString;
user_set::Vector=Vector(), line_width=2.0)
```

Function to plot the results of the user model