IntegerConstraint#

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

Bases: AbstractIntegerConstraint

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.AbstractIntegerConstraint, arg0: List[int], arg1: float) float#
compute_violation(self: ioh.iohcpp.AbstractIntegerConstraint, arg0: List[int]) bool#
is_feasible(self: ioh.iohcpp.AbstractIntegerConstraint, arg0: List[int]) bool#
penalize(self: ioh.iohcpp.AbstractIntegerConstraint, arg0: float) float#
penalty(self: ioh.iohcpp.AbstractIntegerConstraint) float#
violation(self: ioh.iohcpp.AbstractIntegerConstraint) float#