RealBounds

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

Bases: AbstractRealConstraint

Overloaded function.

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

  2. __init__(self, lb: collections.abc.Sequence[float], ub: collections.abc.Sequence[float], 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: float, ub: float, 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, writable])

compute_violation([order, device, writable])

Overloaded function.

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

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[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

Overloaded function.

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

  2. compute_violation(self, arg: collections.abc.Sequence[float], /) -> 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[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