Links
Links are connecting the individual Nodes for the exchange of energy/mass. Links are directional, that is transport of mass/energy is only allowed in a single direction.
Index
EnergyModelsBase.DirectEnergyModelsBase.LinearEnergyModelsBase.LinkEnergyModelsBase.formulationEnergyModelsBase.has_capacityEnergyModelsBase.has_emissionsEnergyModelsBase.has_opexEnergyModelsBase.inputsEnergyModelsBase.is_unidirectionalEnergyModelsBase.link_dataEnergyModelsBase.outputs
Link types
The following types for links are implemented in EnergyModelsBase. The thought process is to dispatch on the EMB.Formulation of a link as additional option. This is in the current stage not implemented.
EnergyModelsBase.Link — Type
abstract type Link <: AbstractElementGeneral supertype for links connecting Nodes.
EnergyModelsBase.Direct — Type
struct Direct <: LinkA direct link between two nodes.
Fields
idis the name/identifier of the link.from::Nodeis the node from which there is flow into the link.to::Nodeis the node to which there is flow out of the link.formulation::Formulationis the used formulation of links. If not specified, aLinearlink is assumed.
EnergyModelsBase.Linear — Type
struct Linear <: FormulationLinear Formulation, that is input equals output.
Functions for accessing fields of Link types
The following functions are declared for accessing fields from a Link type.
If you want to introduce new Link types, it is important that the function formulation is either functional for your new types or you have to declare a corresponding function. The first approach can be achieved through using the same name for the respective fields.
EnergyModelsBase.inputs — Method
inputs(n::Link)Returns the input resources of a link l.
The default approach is to use the function link_res(l::Link).
This function should receive a new method when you define a new Link type in which you specify the transported resources.
The new method must return a Vector{<:Resource}
EnergyModelsBase.outputs — Method
outputs(n::Link)Returns the output resources of a link l.
The default approach is to use the function link_res(l::Link).
This function should receive a new method when you define a new Link type in which you specify the transported resources.
The new method must return a Vector{<:Resource}
EnergyModelsBase.formulation — Function
formulation(l::Link)Return the formulation of a Link l.
EnergyModelsBase.link_data — Function
link_data(l::Link)Returns the ExtensionData array of link l.
The default options returns an empty ExtensionData vector.
Functions for identifying Links
The following functions are declared for filtering on Link types.
EnergyModelsBase.has_capacity — Method
has_capacity(l::Link)Checks whether link l has a capacity.
By default, links do not have a capacity. You must dispatch on this function if you want to introduce links with capacities.
EnergyModelsBase.has_opex — Method
has_opex(l::Link)Checks whether link l has operational expenses.
By default, links do not have operational expenses. You must dispatch on this function if you want to introduce links with operational expenses.
EnergyModelsBase.has_emissions — Method
has_emissions(l::Link)Checks whether link l has emissions.
By default, links do not have emissions. You must dispatch on this function if you want to introduce links with associated emissions, e.g., through leakage.
EnergyModelsBase.is_unidirectional — Method
is_unidirectional(l::Link)Returns logic whether the link l can be used bidirectional or only unidirectional.
In the current stage, EnergyModelsBase does not include any links which can be used bidirectional, that is with flow reversal.
If you plan to use bidirectional flow, you have to declare your own nodes and links which support this. You can then dispatch on this function for the incorporation.