IntegerBounds

class ioh.iohcpp.IntegerBounds(self, lb: ndarray[shape=(*), order='C', device='cpu'], ub: ndarray[shape=(*), order='C', device='cpu'], enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT)
class ioh.iohcpp.IntegerBounds(self, lb: collections.abc.Sequence[int], ub: collections.abc.Sequence[int], enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT)
class ioh.iohcpp.IntegerBounds(self, size: int, lb: int, ub: int, enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT)

Bases: AbstractIntegerConstraint

Overloaded function.

  1. __init__(self, lb: ndarray[shape=(*), order='C', device='cpu'], ub: ndarray[shape=(*), order='C', device='cpu'], enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT) -> None

  2. __init__(self, lb: collections.abc.Sequence[int], ub: collections.abc.Sequence[int], enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT) -> None

    Problem Bounds, defined as a Box Constraint

    lb: list

    the lower bound of the search space/domain

    ub: list

    the upper bound of the search space/domain

    enforced: ConstraintEnforcement

    whether the constraint should be enforced

  3. __init__(self, size: int, lb: int, ub: int, enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT) -> None

    Problem Bounds, defined as a Box Constraint

    size: int

    The size of the problem

    lb: float

    the lower bound of the search space/domain

    ub: float

    the upper bound of the search space/domain

    enforced: ConstraintEnforcement

    whether the constraint should be enforced

Attributes Summary

enforced

The type of constraint enforcement applied.

exponent

The exponent for this constraint

lb

a new numpy array on every read (assign lb to change it)

ub

a new numpy array on every read (assign ub to change it)

weight

The weight given to this constraint

Methods Summary

__call__([order, device])

compute_violation([order, device])

Overloaded function.

is_feasible([order, device])

penalize(self, arg, /)

penalty(self)

violation(self)

Attributes Documentation

enforced

The type of constraint enforcement applied.

exponent

The exponent for this constraint

lb

a new numpy array on every read (assign lb to change it)

Type:

The lower bound (box constraint)

ub

a new numpy array on every read (assign ub to change it)

Type:

The upper bound (box constraint)

weight

The weight given to this constraint

Methods Documentation

__call__(self, arg0: ndarray[shape=(*), order='C', device='cpu'], arg1: float, /) → float
__call__(self, arg0: collections.abc.Sequence[int], arg1: float, /) → float
compute_violation(self, arg: ndarray[shape=(*), order='C', device='cpu'], /) → bool
compute_violation(self, arg: collections.abc.Sequence[int], /) → bool

Overloaded function.

  1. compute_violation(self, arg: ndarray[shape=(*), order='C', device='cpu'], /) -> bool

  2. compute_violation(self, arg: collections.abc.Sequence[int], /) -> bool

    Check if a point is within the bounds or not.

    x: list | np.ndarray

    the search point to check

    y: float

    the objective value

    bool

    Whether there is a constraint violation

is_feasible(self, arg: ndarray[shape=(*), order='C', device='cpu'], /) → bool
is_feasible(self, arg: collections.abc.Sequence[int], /) → bool
penalize(self, arg: float, /) → float
penalty(self) → float
violation(self) → float