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 modelscore/constraint.jl
- abstract mathematical constraints that occur across many types of InfrastructureModelscore/data.jl
- tools for working with data dictionaries that conform to the InfrastructureModels data standardscore/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 standardscore/relaxation_scheme.jl
- abstract mathematical constraints implementing convex relaxations of functions that occur across many types of InfrastructureModelscore/solution.jl
- tools for building optimization result dictionaries in the InfrastructureModels standard formatio/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.AbstractInfrastructureModel
— Typeroot of the infrastructure model formulation type hierarchy
InfrastructureModels.InitializeInfrastructureModel
— MethodConstructor for an InfrastructureModels modeling object, where the infrastructure type it
must be specified a priori.
InfrastructureModels.InitializeInfrastructureModel
— MethodConstructor for an InfrastructureModels modeling object, where data
is assumed to in a multi-infrastructure network data format.
InfrastructureModels._add_line_delimiter
— MethodInfrastructureModels._bold
— MethodMakes a string bold in the terminal
InfrastructureModels._compare_numbers
— Methodtests if two numbers are equal, up to floating point precision
InfrastructureModels._extract_matlab_assignment
— Methodbreaks up matlab strings of the form 'name = value;'
InfrastructureModels._grey
— MethodMakes 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
InfrastructureModels._guard_objective_bound
— MethodInfrastructureModels._guard_objective_value
— MethodInfrastructureModels._initialize_dict_from_ref
— MethodInitialize an empty dictionary with a structure similar to ref
.
InfrastructureModels._iscomponentdict
— MethodAttempts to determine if the given data is a component dictionary
InfrastructureModels._parse_matlab_cells
— MethodInfrastructureModels._parse_matlab_data
— MethodInfrastructureModels._parse_matlab_matrix
— MethodInfrastructureModels._populate_ref_global_keys!
— FunctionPopulate the portion of refs
corresponding to global keys.
InfrastructureModels._populate_ref_it!
— MethodPopulate the portion of refs
for a specific infrastructure type.
InfrastructureModels._type_array
— MethodAttempts to determine the type of an array of strings extracted from a matlab file
InfrastructureModels._type_value
— MethodAttempts to determine the type of a string extracted from a matlab file
InfrastructureModels._update_data!
— Methodrecursive call of updatedata
InfrastructureModels._update_data_timepoint!
— Methodrecursive call of updatedata
InfrastructureModels.apply!
— MethodApply 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.
InfrastructureModels.apply!
— MethodApply 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.
InfrastructureModels.apply!
— MethodApply 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.
InfrastructureModels.arrays_to_dicts!
— Methodturns top level arrays into dicts
InfrastructureModels.build_ref
— MethodBuilds a ref object without the need to initialize an AbstractInfrastructureModel, where it
specifies the infrastructure type.
InfrastructureModels.build_ref
— MethodBuilds a ref object without the need to initialize an AbstractInfrastructureModel, where the data is assumed to be in a multi-infrastructure format.
InfrastructureModels.build_result
— MethodInfrastructureModels.build_solution
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.build_solution_values
— MethodInfrastructureModels.check_type
— MethodChecks if the given value is of a given type, if not tries to make it that type
InfrastructureModels.compare_dict
— Methodtests if two dicts are equal, up to floating point precision
InfrastructureModels.component_table
— Methodbuilds a table of component data
InfrastructureModels.constraint_bounds_on_off
— MethodGiven a continuous variable x
and a binary variable z
, sets x to 0.0 when z is 0. Requires that 0.0 is in the domain of x.
InfrastructureModels.float2string
— Methodconverts 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
InfrastructureModels.get_data
— MethodApply 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.
InfrastructureModels.get_num_networks
— Methodgets the number of networks that could exist provided the base data
InfrastructureModels.has_time_series
— Methodchecks if a given dataset has a time series component
InfrastructureModels.instantiate_model
— MethodInfrastructureModels.instantiate_model
— MethodInfrastructureModels.ismultiinfrastructure
— Methodchecks if a given network data is a multinetwork
InfrastructureModels.ismultinetwork
— Methodchecks if a given network data is a multinetwork
InfrastructureModels.load_timepoint!
— Methodloads a single time point from a time_series data block into the current network
InfrastructureModels.logger_config!
— Methodalows the user to set the logging level without the need to add Memento
InfrastructureModels.make_multinetwork
— Methodturns a single network and a time_series data block into a multi-network
InfrastructureModels.optimize_model!
— MethodInfrastructureModels.print_summary
— Methodprints the text summary for a data dictionary to stdout
InfrastructureModels.ref_initialize
— FunctionGiven 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
InfrastructureModels.ref_initialize
— FunctionGiven 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.
InfrastructureModels.relaxation_complex_product
— Methodconstraint: c^2 + d^2 <= a*b
InfrastructureModels.relaxation_complex_product
— Methodconstraint: c^2 <= a*b
InfrastructureModels.relaxation_complex_product_conic
— Methoda conic encoding of constraint: c^2 + d^2 <= a*b
InfrastructureModels.relaxation_complex_product_conic
— Methoda conic encoding of constraint: c^2 <= a*b
InfrastructureModels.relaxation_complex_product_conic_on_off
— Methodon/off variant of relaxationcomplexproduct controlled by indicator variable z in the conic form
InfrastructureModels.relaxation_complex_product_conic_on_off
— Methodon/off variant of relaxationcomplexproduct controlled by indicator variable z in the conic form
InfrastructureModels.relaxation_complex_product_on_off
— Methodon/off variant of relaxationcomplexproduct controlled by indicator variable z
InfrastructureModels.relaxation_complex_product_on_off
— Methodon/off variant of relaxationcomplexproduct controlled by indicator variable z, variant with a fixed value of z
InfrastructureModels.relaxation_complex_product_on_off
— Methodon/off variant of relaxationcomplexproduct controlled by indicator variable z
InfrastructureModels.relaxation_equality_on_off
— Methodan on/off variant of x == y, controlled by the indicator variable z
InfrastructureModels.relaxation_equality_on_off
— Methodan on/off variant of x == y, controlled by the indicator variable z, a variant for fixed z
InfrastructureModels.relaxation_product
— Methodgeneral 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)
InfrastructureModels.relaxation_product_on_off
— MethodOn/Off variant of a relaxed binlinear term (McCormick) requires that all variables (x,y,z) go to zero with ind
InfrastructureModels.relaxation_product_on_off
— MethodOn/Off variant of a relaxed binlinear term (McCormick) requires that all variables (x,y,z) go to zero with ind Variant where ind is a fixed value and not a variable
InfrastructureModels.relaxation_sqr
— Methodgeneral relaxation of a square term
x^2 <= y <= (JuMP.upper_bound(x)+JuMP.lower_bound(x))*x - JuMP.upper_bound(x)*JuMP.lower_bound(x)
InfrastructureModels.relaxation_trilinear
— Methodconvex 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
InfrastructureModels.replicate
— MethodTransforms a single network into a multinetwork with several deepcopies of the original network
InfrastructureModels.row_to_dict
— Methodtakes a row from a matrix and assigns the values names
InfrastructureModels.row_to_typed_dict
— Methodtakes a row from a matrix and assigns the values names and types
InfrastructureModels.silence
— MethodSuppresses information and warning messages output by InfrastructureModels, for fine grained control use the Memento package
InfrastructureModels.sol_component_fixed
— Methodgiven a constant value, builds the standard component-wise solution structure
InfrastructureModels.sol_component_value
— Methodgiven a variable that is indexed by component ids, builds the standard solution structure
InfrastructureModels.sol_component_value_edge
— Methodmaps asymmetric edge variables into components
InfrastructureModels.solution_preprocessor
— MethodInfrastructureModels.split_line
— MethodInfrastructureModels.summary
— Methodprints the text summary for a data dictionary to IO
InfrastructureModels.update_data!
— Methodrecursively applies new_data to data, overwriting information
InfrastructureModels.value2string
— Methodconverts a float to a string, using float_precision cutoff
InfrastructureModels.value2string
— Methodconverts any value to a string
InfrastructureModels.value2string
— Methodconverts any value to a string, summarizes arrays
InfrastructureModels.value2string
— Methodconverts any value to a string, summarizes dicts
InfrastructureModels.variable_domain
— MethodComputes the valid domain of a given JuMP variable taking into account bounds and the varaible's implicit bounds (e.g. binary).
InfrastructureModels.@def
— MacroThe 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.
InfrastructureModels.@im_fields
— Macroa macro for adding the standard InfrastructureModels fields to a type definition