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:
AbstractIntegerConstraintOverloaded function.
__init__(self, lb: ndarray[shape=(*), order='C', device='cpu'], ub: ndarray[shape=(*), order='C', device='cpu'], enforced: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.NOT) -> None__init__(self, lb: collections.abc.Sequence[int], ub: collections.abc.Sequence[int], 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: int, ub: int, 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])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.
compute_violation(self, arg: ndarray[shape=(*), order='C', device='cpu'], /) -> boolcompute_violation(self, arg: collections.abc.Sequence[int], /) -> 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[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¶