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:
AbstractRealConstraintOverloaded function.
__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__init__(self, lb: collections.abc.Sequence[float], ub: collections.abc.Sequence[float], enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT) -> NoneProblem 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
__init__(self, size: int, lb: float, ub: float, enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT) -> NoneProblem 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
The type of constraint enforcement applied.
The exponent for this constraint
a new numpy array on every read (assign lb to change it)
a new numpy array on every read (assign ub to change it)
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.
compute_violation(self, arg: ndarray[dtype=float64, shape=(*), order='C', device='cpu', writable=False], /) -> boolcompute_violation(self, arg: collections.abc.Sequence[float], /) -> boolCheck 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¶