Infinite Models
A technical manual for infinite dimensional models. See the respective guide for more information.
Models
InfiniteOpt.InfiniteModel
— TypeInfiniteModel <: JuMP.AbstractModel
A DataType
for storing all of the mathematical modeling information needed to model an optmization problem with an infinite-dimensional decision space.
InfiniteOpt.InfiniteModel
— MethodInfiniteModel([backend::AbstractTransformationBackend = TranscriptionBackend()])
Return a new infinite model that uses backend
. For the default case with TranscriptionBackend
, the opimizer_constructor
and other arguments can be given directly:
InfiniteModel(
optimizer_constructor;
[add_bridges::Bool = true]
)
where optimizer_constructor
and add_bridges
are passed on to the underying JuMP Model
.
A different transformation backend can be specified later on using set_transformation_backend
.
Example
julia> using InfiniteOpt, JuMP, Ipopt;
julia> model = InfiniteModel()
An InfiniteOpt Model
Feasibility problem with:
Finite parameters: 0
Infinite parameters: 0
Variables: 0
Derivatives: 0
Measures: 0
Transformation backend information:
Backend type: TranscriptionBackend
Solver: none
Transformation built and up-to-date: false
julia> model = InfiniteModel(Ipopt.Optimizer)
An InfiniteOpt Model
Feasibility problem with:
Finite parameters: 0
Infinite parameters: 0
Variables: 0
Derivatives: 0
Measures: 0
Transformation backend information:
Backend type: TranscriptionBackend
Solver: Ipopt
Transformation built and up-to-date: false
JuMP.object_dictionary
— MethodJuMP.object_dictionary(model::InfiniteModel)::Dict{Symbol, Any}
Return the dictionary that maps the symbol name of a macro defined object (e.g., a parameter, variable, or constraint) to the corresponding object. Objects are registered to a specific symbol in the macros. For example, @variable(model, x[1:2, 1:2])
registers the array of variables x
to the symbol :x
.
InfiniteOpt.has_internal_supports
— Functionhas_internal_supports(pref::Union{IndependentParameterRef, DependentParameterRef})::Bool
Indicate if pref
has internal supports that will be hidden from the user by default.
has_internal_supports(prefs; [kwargs...])
Define has_internal_supports
for general variable references. It relies on has_internal_supports
being defined for the underlying DispatchVariableRef
, otherwise an ArgumentError
is thrown. See the underlying docstrings for more information. Note that this is a auto generated wrapper and the underlying method may or may not use kwargs
.
Base.empty!
— MethodBase.empty!(model::InfiniteModel)::InfiniteModel
Clear out model
of everything except the optimizer information and return the cleared model.
JuMP.set_optimize_hook
— MethodJuMP.set_optimize_hook(
model::InfiniteModel,
hook::Union{Function, Nothing}
)::Nothing
Set the function hook
as the optimize hook for model
where hook
should have be of the form hook(model::InfiniteModel; hook_specfic_kwargs..., kwargs...)
. The kwargs
are those passed to optimize!
. The hook_specifc_kwargs
are passed as additional keywords by the user when they call optimize!
.
Notes
- The optimize hook should generally modify the model, or some external state
in some way, and then call optimize!(model; ignore_optimize_hook = true)
to optimize the problem, bypassing the hook.
- Use
set_optimize_hook(model, nothing)
to unset an optimize hook.
InfiniteOpt.parameter_refs
— Methodparameter_refs(model::InfiniteModel)::Tuple
Returns a tuple of the infinite parameters used by model
.
For developers, note that the integer index of each element is what is referred to as an infinite parameter group integer index which corresponds to parameter_group_int_indices
.
Example
julia> parameter_refs(model)
(t, x)
InfiniteOpt.parameter_group_indices
— Functionparameter_group_indices(model::InfiniteModel)::Vector{Union{IndependentParameterIndex, DependentParametersIndex}}
Return a list the indices that correspond to the independent infinite parameter groups that have been added to model
. This provides the infinite parameter indicies that correspond to the integer indices reported by parameter_group_int_indices
. For instance, a group integer index of 2
corresponds to the infinite parameter index stored at parameter_group_indices(model)[2]
. This is intended for advanced users writing new types of AbstractTransformationBackend
s.
Abstract Dependencies
InfiniteOpt.AbstractDataObject
— TypeAbstractDataObject
An abstract type for DataType
s that store core variable DataType
s and their model specific information (e.g., dependency mappings). These are what are stored in the InfiniteModel
CleverDict
s.
InfiniteOpt.AbstractInfOptIndex
— TypeAbstractInfOptIndex
An abstract type for all index objects used in InfiniteOpt
.
InfiniteOpt.ObjectIndex
— TypeObjectIndex <: AbstractInfOptIndex
An abstract type for indices of objects stored in MOI.Utilities.CleverDicts
.