RealConstraint¶
- class ioh.iohcpp.RealConstraint(self, fn: object, weight: float = 1.0, exponent: float = 1.0, enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.SOFT, name: str = '')¶
Bases:
AbstractRealConstraintGeneral Constraint, defined by a function
- Parameters:
f (numpy.ndarray -> float) – A function that computes the violation of a point (a new numpy array, float64 for real and int32 for integer problems)
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
The type of constraint enforcement applied.
The exponent for this constraint
The weight given to this constraint
Methods Summary
__call__([order, device, writable])compute_violation([order, device, writable])is_feasible([order, device, writable])penalize(self, arg, /)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, arg0: ndarray[dtype=float64, shape=(*), order='C', device='cpu', writable=False], arg1: float, /) float¶
- __call__(self, arg0: collections.abc.Sequence[float], arg1: float, /) float
- compute_violation(self, arg: ndarray[dtype=float64, shape=(*), order='C', device='cpu', writable=False], /) bool¶
- compute_violation(self, arg: collections.abc.Sequence[float], /) bool
- is_feasible(self, arg: ndarray[dtype=float64, shape=(*), order='C', device='cpu', writable=False], /) bool¶
- is_feasible(self, arg: collections.abc.Sequence[float], /) bool
- penalize(self, arg: float, /) float¶
- penalty(self) float¶
- violation(self) float¶