InfrastructureModels Library

Overview

The core functionalities provided by InfrastructureModels are organized into the following files in the src directory,

  • core/base.jl - tools for building, accessing and optimizing InfrastructureModels mathematical models
  • core/constraint.jl - abstract mathematical constraints that occur across many types of InfrastructureModels
  • core/data.jl - tools for working with data dictionaries that conform to the InfrastructureModels data standards
  • core/export.jl - an internal tool for only exporting functions that do not begin with _
  • core/ref.jl - tools for working with reference dictionaries (ref) that conform to the InfrastructureModels standards
  • core/relaxation_scheme.jl - abstract mathematical constraints implementing convex relaxations of functions that occur across many types of InfrastructureModels
  • core/solution.jl - tools for building optimization result dictionaries in the InfrastructureModels standard format
  • io/matlab.jl - basic tools for parsing matlab files for reading standard infrastructure data formats, such as the Matpower data format

API Reference

Below is a complete list of all components of InfrastructureModels with documentation strings when available. Following the JuMP developer style guide, items beginning with _ are for InfrastructureModels internal use only, while other elements are exported for use and extension by other packages.

InfrastructureModels._greyMethod

Makes a string grey in the terminal, does not seem to work well on Windows terminals more info can be found at https://en.wikipedia.org/wiki/ANSIescapecode

source
InfrastructureModels.apply!Method

Apply the function func!, which modifies data for a specific infrastructure, it. Here, apply_to_subnetworks specifies whether or not func! should be applied to all subnetworks in a multinetwork dataset.

source
InfrastructureModels.apply!Method

Apply the function func!, which modifies ref using data for a specific infrastructure, it. Here, apply_to_subnetworks specifies whether or not func! should be applied to all subnetworks in a multinetwork dataset.

source
InfrastructureModels.apply!Method

Apply the function func!, which modifies ref for a specific infrastructure, it. Here, apply_to_subnetworks specifies whether or not func! should be applied to all subnetworks in a multinetwork dataset.

source
InfrastructureModels.build_refMethod

Builds a ref object without the need to initialize an AbstractInfrastructureModel, where the data is assumed to be in a multi-infrastructure format.

source
InfrastructureModels.float2stringMethod

converts a float value into a string of fixed precision

sprintf would do the job but this work around is needed because sprintf cannot take format strings during runtime

source
InfrastructureModels.get_dataMethod

Apply the getter function func, which operates on data for a specific infrastructure, it. Here, apply_to_subnetworks specifies whether or not func should be applied to all subnetworks in a multinetwork dataset. If so, a dictionary of retrieved data using func is returned, indexed by the indices of the multinetwork. Otherwise, a single value is returned.

source
InfrastructureModels.ref_initializeFunction

Given a data dictionary following the Infrastructure Models conventions, builds an initial "ref" dictionary converting strings to symbols and component keys to integers. The global keys argument specifies which keys should remain in the root of dictionary when building a multi-network

source
InfrastructureModels.ref_initializeFunction

Given a data dictionary following the InfrastructureModels multi-infrastructure conventions, build and return an initial "ref" dictionary, converting strings to symbols and component keys to integers. The global keys argument specifies which keys should remain in the root of the dictionary when building the multi-infrastructure dataset.

source
InfrastructureModels.relaxation_productMethod

general relaxation of binlinear term (McCormick)

z >= JuMP.lower_bound(x)*y + JuMP.lower_bound(y)*x - JuMP.lower_bound(x)*JuMP.lower_bound(y)
z >= JuMP.upper_bound(x)*y + JuMP.upper_bound(y)*x - JuMP.upper_bound(x)*JuMP.upper_bound(y)
z <= JuMP.lower_bound(x)*y + JuMP.upper_bound(y)*x - JuMP.lower_bound(x)*JuMP.upper_bound(y)
z <= JuMP.upper_bound(x)*y + JuMP.lower_bound(y)*x - JuMP.upper_bound(x)*JuMP.lower_bound(y)
source
InfrastructureModels.relaxation_trilinearMethod

convex hull relaxation of trilinear term

w₁ = JuMP.lower_bound(x)*JuMP.lower_bound(y)*JuMP.lower_bound(z)
w₂ = JuMP.lower_bound(x)*JuMP.lower_bound(y)*JuMP.upper_bound(z)
w₃ = JuMP.lower_bound(x)*JuMP.upper_bound(y)*JuMP.lower_bound(z)
w₄ = JuMP.lower_bound(x)*JuMP.upper_bound(y)*JuMP.upper_bound(z)
w₅ = JuMP.upper_bound(x)*JuMP.lower_bound(y)*JuMP.lower_bound(z)
w₆ = JuMP.upper_bound(x)*JuMP.lower_bound(y)*JuMP.upper_bound(z)
w₇ = JuMP.upper_bound(x)*JuMP.upper_bound(y)*JuMP.lower_bound(z)
w₈ = JuMP.upper_bound(x)*JuMP.upper_bound(y)*JuMP.upper_bound(z)
w = λ₁*w₁ + λ₂*w₂ + λ₃*w₃ + λ₄*w₄ + λ₅*w₅ + λ₆*w₆ + λ₇*w₇ + λ₈*w₈
x = (λ₁ + λ₂ + λ₃ + λ₄)*JuMP.lower_bound(x) + (λ₅ + λ₆ + λ₇ + λ₈)*JuMP.upper_bound(x)
y = (λ₁ + λ₂ + λ₅ + λ₆)*JuMP.lower_bound(y) + (λ₃ + λ₄ + λ₇ + λ₈)*JuMP.upper_bound(y)
z = (λ₁ + λ₃ + λ₅ + λ₇)*JuMP.lower_bound(z) + (λ₂ + λ₄ + λ₆ + λ₈)*JuMP.upper_bound(z)
λ₁ + λ₂ + λ₃ + λ₄ + λ₅ + λ₆ + λ₇ + λ₈ = 1
source
InfrastructureModels.@defMacro

The def macro is used to build other macros that can insert the same block of julia code into different parts of a program. In InfrastructureModels packages this is macro is used to generate a standard set of fields inside a model type hierarchy.

source