- class iwopy.core.Constraint(iwopy.core.OptFunction)[source]
Abstract base class for optimization constraints.
Attributes¶
- tol: float
The tolerance for constraint violations
Public members¶
-
Constraint(*args, tol=
1e-05
, **kwargs)[source] Constructor
- get_bounds()[source]
Returns the bounds for all components.
-
check_individual(constraint_values, verbosity=
0
)[source] Check if the constraints are fullfilled for the given individual.
-
check_population(constraint_values, verbosity=
0
)[source] Check if the constraints are fullfilled for the given population.
- classmethod new(constraint_type, *args, **kwargs)[source]
Run-time constraint factory.
- abstract n_components()[source]
Returns the number of components of the function.
-
initialize(verbosity=
0
)[source] Initialize the object.
- property component_names
The names of the components
- property var_names_int
The names of the integer variables
- property n_vars_int
The number of int variables
- property var_names_float
The names of the float variables
- property n_vars_float
The number of float variables
- vardeps_int()[source]
Gets the dependencies of all components on the function int variables
- vardeps_float()[source]
Gets the dependencies of all components on the function float variables
- rename_vars_int(varmap)[source]
Rename integer variables.
- rename_vars_float(varmap)[source]
Rename float variables.
- calc_individual(vars_int, vars_float, problem_results, ...)[source]
Calculate values for a single individual of the underlying problem.
- calc_population(vars_int, vars_float, problem_results, ...)[source]
Calculate values for all individuals of a population.
- finalize_individual(vars_int, vars_float, problem_results, ...)[source]
Finalization, given the champion data.
- finalize_population(vars_int, vars_float, problem_results, ...)[source]
Finalization, given the final population data.
-
ana_deriv(vars_int, vars_float, var, components=
None
)[source] Calculates the analytic derivative, if possible.
- property initialized
Flag for finished initialization