Library
Public API
OptimizationParameters.OptimizationParameter
— TypeOptimizationParameter{S, TX, TF, TB, DV}
The basic building block of the interface, representing one potential design variable. S
is a tuple with the dimensions of the underlying data and DV
indicates whether a design variable is activated for the variable.
OptimizationParameters.OptimizationParameter
— MethodOptimizationParameter(x0; lb=-Inf, ub=Inf, scaling=1.0, dv=false, description="")
The default constructor for objects of type OptimizationParameter. x0
, lb
, ub
, scaling
, and dv
may be either scalars or arrays, however, all array inputs must have the same dimensions.
OptimizationParameters.get_x0
— Functionget_x0(optparam::OptimizationParameter)
Returns initial value(s) for optparam
get_x0(optparams, field)
Returns initial value(s) for field
in optparams
OptimizationParameters.get_lb
— Functionget_lb(optparam::OptimizationParameter)
Returns lower bound(s) for optparam
get_lb(optparams, field)
Returns lower bound(s) for field
in optparams
OptimizationParameters.get_ub
— Functionget_ub(optparam::OptimizationParameter)
Returns upper bound(s) for optparam
get_ub(optparams, field)
Returns upper bound(s) for field
in optparams
OptimizationParameters.get_scaling
— Functionget_scaling(optparam::OptimizationParameter)
Returns scaling parameter(s) for optparam
get_scaling(optparams, field)
Returns scaling parameter(s) for field
in optparams
OptimizationParameters.get_dv
— Functionget_dv(optparam::OptimizationParameter)
Returns design variable flag(s) for optparam
get_dv(optparams, field)
Returns design variable flag(s) for field
in optparams
OptimizationParameters.get_description
— Functionget_description(optparam::OptimizationParameter)
Returns the description for optparam
get_description(optparams, field)
Returns the description for field
in optparams
OptimizationParameters.set_x0
— Functionset_x0(optparam::OptimizationParameter, x0)
Returns optparam
with the initial value(s) given by x0
set_x0(optparams::AbstractDict, field, x0)
Modifies the field
in optparams
to have the initial value(s) given by x0
set_x0(optparams::NamedTuple, field, x0)
Modifies the field
in optparams
to have the initial value(s) given by x0
OptimizationParameters.set_x0!
— Functionset_x0!(optparams::AbstractDict, field, x0)
Modifies the field
in optparams
to have the initial value(s) given by x0
OptimizationParameters.set_lb
— Functionset_lb(optparam::OptimizationParameter, lb)
Returns optparam
with the lower bound(s) given by lb
set_lb(optparams::AbstractDict, field, lb)
Modifies the field
in optparams
to have the lower bound(s) given by lb
set_lb(optparams::NamedTuple, field, lb)
Modifies the field
in optparams
to have the lower bound(s) given by lb
OptimizationParameters.set_lb!
— Functionset_lb!(optparams::AbstractDict, field, lb)
Modifies the field
in optparams
to have the lower bound(s) given by lb
OptimizationParameters.set_ub
— Functionset_ub(optparam::OptimizationParameter, ub)
Returns optparam
with the upper bound(s) given by ub
set_ub(optparams::AbstractDict, field, ub)
Modifies the field
in optparams
to have the upper bound(s) given by ub
set_ub(optparams::NamedTuple, field, ub)
Modifies the field
in optparams
to have the upper bound(s) given by ub
OptimizationParameters.set_ub!
— Functionset_ub!(optparams::AbstractDict, field, ub)
Modifies the field
in optparams
to have the upper bound(s) given by ub
OptimizationParameters.set_scaling
— Functionset_scaling(optparam::OptimizationParameter, scaling)
Returns optparam
with the scaling parameter given by scaling
set_scaling(optparams::AbstractDict, field, scaling)
Modifies the field
in optparams
to have the scaling parameter(s) given by scaling
set_scaling(optparams::NamedTuple, field, scaling)
Modifies the field
in optparams
to have the scaling parameter(s) given by scaling
OptimizationParameters.set_scaling!
— Functionset_scaling!(optparams::AbstractDict, field, scaling)
Modifies the field
in optparams
to have the scaling parameter(s) given by scaling
OptimizationParameters.set_dv
— Functionset_dv(optparam::OptimizationParameter, dv)
Returns optparam
with the design variable flag(s) given by dv
set_dv(optparams::AbstractDict, field, dv)
Modifies the field
in optparams
to have the design variable flag(s) given by dv
set_dv(optparams::NamedTuple, field, dv)
Modifies the field
in optparams
to have the design variable flag(s) given by dv
OptimizationParameters.set_dv!
— Functionset_dv!(optparams::AbstractDict, field, dv)
Modifies the field
in optparams
to have the design variable flag(s) given by dv
OptimizationParameters.set_description
— Functionset_description(optparam::OptimizationParameter, description)
Returns optparam
with the description given by description
set_description(optparams::AbstractDict, field, description)
Modifies the field
in optparams
to have the description given by description
set_description(optparams::NamedTuple, field, description)
Modifies the field
in optparams
to have the description given by description
OptimizationParameters.set_description!
— Functionset_description!(optparams::AbstractDict, field, description)
Modifies the field
in optparams
to have the description given by description
OptimizationParameters.update_parameters
— Functionupdate_parameters(optparams, params)
Inserts parameters from params
into optparams
and returns the result. optparams
is a named tuple or dictionary filled with objects of type OptimizationParameter. params
is a named tuple or dictionary with the parameter values to be replaced or a vector of scaled design variables.
OptimizationParameters.update_parameters!
— Functionupdate_parameters!(optparams, params)
Inserts parameters from params
into optparams
and returns the result. optparams
is a dictionary filled with objects of type OptimizationParameter params
is a dictionary with the parameter values to be replaced or a vector of scaled design variables
OptimizationParameters.update_design_variables
— Functionupdate_design_variables(original, optimized)
Copies design variables that are active in both original
and optimized
from optimized
into original
and returns the result. original
is a named tuple or dictionary filled with objects of type OptimizationParameter optimized
is a named tuple or dictionary filled with objects of type OptimizationParameter
OptimizationParameters.update_design_variables!
— Functionupdate_design_variables!(original, optimized)
Copies design variables that are active in both original
and optimized
from optimized
into original
and returns the result. original
is a named tuple or dictionary filled with objects of type OptimizationParameter optimized
is a named tuple or dictionary filled with objects of type OptimizationParameter
OptimizationParameters.named_tuple_to_dict
— Functionnamed_tuple_to_dict(nt)
Converts a named tuple to an ordered dictionary
OptimizationParameters.dict_to_named_tuple
— Functiondict_to_named_tuple(dict)
Converts a dictionary to a named tuple
OptimizationParameters.assemble_input
— Functionassemble_input(optparams)
Assembles the input for the optimization problem: x0, lb, ub
OptimizationParameters.get_values
— Functionget_values(optparam[, x])
Returns a named tuple or dictionary of the values of the optimization parameter(s) given a vector of design variables. If x
is not provided, the default parameter values are returned.
OptimizationParameters.print_design_variables
— Functionprint_design_variables(optparams, x)
Prints design variable get_values for the current iteration
OptimizationParameters.read_parameters
— Functionread_parameters(file; dict=true)
Reads the optimization parameters in a csv file and returns either an ordered dictionary or a named tuple of the optimization parameters.
OptimizationParameters.write_parameters
— Functionwrite_parameters([inputfile, ]outputfile, optparams)
Writes the optimization parameters in optparams
to a csv file. If given, the file inputfile
is used as a template for the organization of the resulting file.
Private API
OptimizationParameters.get_value
— Functionget_value(optparam[, x])
Returns the value(s) of the optimization parameter(s) given a scalar/vector of design variables. If x
is not provided, the default parameter values are returned.
OptimizationParameters.design_variable_offset
— Functiondesign_variable_offset(lb, ub)
Determines the amount to offset a design variable in order to center it around zero
OptimizationParameters.parse_value
— Functionparse_value(value)
Returns value
if value
is not a string.
If value
is a string this function checks if value
should have been parsed as a boolean and returns the corresponding boolean.
Otherwise value
is parsed as a Julia expression, with a few customizations:
- [] parses to Float64[]
- The unicode characters “ and ” are converted to "
OptimizationParameters.write_value
— Functionwrite_value(value)
Returns a string representing value
using a set of custom rules.
OptimizationParameters.get_column_ordering
— Functionget_column_ordering(header)
Returns the column ordering given the file header
Index
OptimizationParameters.OptimizationParameter
OptimizationParameters.OptimizationParameter
OptimizationParameters.assemble_input
OptimizationParameters.design_variable_offset
OptimizationParameters.dict_to_named_tuple
OptimizationParameters.get_column_ordering
OptimizationParameters.get_description
OptimizationParameters.get_dv
OptimizationParameters.get_lb
OptimizationParameters.get_scaling
OptimizationParameters.get_ub
OptimizationParameters.get_value
OptimizationParameters.get_values
OptimizationParameters.get_x0
OptimizationParameters.named_tuple_to_dict
OptimizationParameters.parse_value
OptimizationParameters.print_design_variables
OptimizationParameters.read_parameters
OptimizationParameters.set_description
OptimizationParameters.set_description!
OptimizationParameters.set_dv
OptimizationParameters.set_dv!
OptimizationParameters.set_lb
OptimizationParameters.set_lb!
OptimizationParameters.set_scaling
OptimizationParameters.set_scaling!
OptimizationParameters.set_ub
OptimizationParameters.set_ub!
OptimizationParameters.set_x0
OptimizationParameters.set_x0!
OptimizationParameters.update_design_variables
OptimizationParameters.update_design_variables!
OptimizationParameters.update_parameters
OptimizationParameters.update_parameters!
OptimizationParameters.write_parameters
OptimizationParameters.write_value