Miscellaneous types/functions/macros

Index

Module

EnergyModelsBaseModule

Main module for EnergyModelsBase a framework for building flexible energy system models.

It exports several types and associated functions for accessing fields. In addition, all required functions for creaeting and running the model are exported.

You can find the exported types and functions below or on the pages Constraint functions and Data functions.

source

PreviousPeriods and CyclicPeriods

PreviousPeriods is a type used to store information from the previous periods in an iteration loop through the application of the iterator withprev of TimeStruct.

CyclicPeriods is used for storing the current and the last period. The periods can either be AbstractStrategicPeriod or AbstractRepresentativePeriod. In the former case, it is however not fully used as the last strategic period is not relevant for the level balances.

Both composite types allow only EMB.NothingPeriod types as input to the individual fields.

EnergyModelsBase.PreviousPeriodsType
PreviousPeriods{S<:NothingPeriod, T<:NothingPeriod, U<:NothingPeriod}

Contains the previous strategic, representative, and operational period used through the application of the with_prev iterator developed in TimeStruct.

Fields

  • sp::S is the previous strategic period.
  • rp::T is the previous representative period.
  • op::U is the previous operational period.
source
EnergyModelsBase.CyclicPeriodsType
CyclicPeriods{S<:NothingPeriod}

Contains information for calculating the cyclic constraints. The parameter S should be either an AbstractStrategicPeriod or AbstractRepresentativePeriod.

Fields

  • last_per::S is the last period in the case of S<:AbstractRepresentativePeriod or the current period in the case of S<:AbstractStrategicPeriod as the last strategic period is not relevant.
  • current_per::S is the current period in both the case of S<:AbstractRepresentativePeriod and S<:AbstractStrategicPeriod.
source

The individual fields can be accessed through the following functions:

Macros for checking the input data

The macro @assert_or_log is an extension to the @assert macro to allow either for asserting the input data directly, or logging the errors in the input data.

EnergyModelsBase.@assert_or_logMacro
assert_or_log(ex, msg)

Macro that extends the behaviour of the @assert macro. The switch ASSERTS_AS_LOG, controls if the macro should act as a logger or a normal @assert. This macro is designed to be used to check whether the data provided is consistent.

source