RealConstraint#

class ioh.iohcpp.RealConstraint(self: ioh.iohcpp.RealConstraint, fn: handle, weight: float = 1.0, exponent: float = 1.0, enforced: ioh.iohcpp.ConstraintEnforcement = <ConstraintEnforcement.SOFT: 2>, name: str = '')#

Bases: AbstractRealConstraint

General Constraint, defined by a function

Parameters:
  • f (list -> float) – A function that computes the violation of a point

  • weight (float) – The weight given to the violation when penalizing the objective function

  • exponent (float) – The exponent given to the violation when penalizing the objective function

  • enforced (ConstraintEnforcement) – how the constraint should be enforced

  • name (str) – name of the constraint

Attributes Summary

enforced

The type of constraint enforcement applied.

exponent

The exponent for this constraint

weight

The weight given to this constraint

Methods Summary

__call__(self, arg0, arg1)

compute_violation(self, arg0)

is_feasible(self, arg0)

penalize(self, arg0)

penalty(self)

violation(self)

Attributes Documentation

enforced#

The type of constraint enforcement applied.

exponent#

The exponent for this constraint

weight#

The weight given to this constraint

Methods Documentation

__call__(self: ioh.iohcpp.AbstractRealConstraint, arg0: List[float], arg1: float) float#
compute_violation(self: ioh.iohcpp.AbstractRealConstraint, arg0: List[float]) bool#
is_feasible(self: ioh.iohcpp.AbstractRealConstraint, arg0: List[float]) bool#
penalize(self: ioh.iohcpp.AbstractRealConstraint, arg0: float) float#
penalty(self: ioh.iohcpp.AbstractRealConstraint) float#
violation(self: ioh.iohcpp.AbstractRealConstraint) float#