CADETProcess.optimization.OptimizationProblem.add_nonlinear_constraint#
- OptimizationProblem.add_nonlinear_constraint(nonlincon, name=None, n_nonlinear_constraints=1, bad_metrics=None, evaluation_objects=-1, bounds=0, comparison_operator='le', labels=None, requires=None, *args, **kwargs)[source]#
Add nonliner constraint function to optimization problem.
- Parameters:
- nonlinconcallable
Nonlinear constraint function.
- namestr, optional
Name of the nonlinear constraint.
- n_nonlinear_constraintsint, optional
Number of metrics returned by nonlinear constraint function. The default is 1.
- bad_metricsfloat or list of floats, optional
Value which is returned when evaluation fails.
- evaluation_objects{EvaluationObject, None, -1, list}
EvaluationObjects which are evaluated by objective. If None, no EvaluationObject is used. If -1, all EvaluationObjects are used.
- boundsscalar or list of scalars, optional
Upper limits of constraint function. If only one value is given, the same value is assumed for all constraints. The default is 0.
- comparison_operator{‘ge’, ‘le’}, optional
Comparator to define whether metric should be greater or equal to, or less than or equal to the specified bounds. The default is ‘le’ (lower or equal).
- labelsstr, optional
Names of the individual metrics.
- requires{None, Evaluator, list}, optional
Evaluators used for preprocessing. If None, no preprocessing is required. The default is None.
- argstuple, optional
Additional arguments for nonlinear constraint function.
- kwargsdict, optional
Additional keyword arguments for nonlinear constraint function.
- Raises:
- TypeError
If nonlinear constraint function is not callable.
- CADETProcessError
If EvaluationObject is not found. If Evaluator is not found.
Warning
If nonlinear constraint with same name already exists.