class_docstr: A ConstrainedFunction class used to hold constrained single-objective functions.
class_docstr_tok: ["A","ConstrainedFunction","class","used","to","hold","constrained","single-objective","functions","."]
docstr: Callable to avoid using the `pointer` property.
  
  Args:
      x: Array of positions.
  
  Returns:
      (float): Constrained single-objective function fitness.
docstr_tok: ["Callable","to","avoid","using","the","`","pointer","`","property",".","Args",":","x",":","Array","of","positions",".","Returns",":","(","float",")",":","Constrained","single-objective","function","fitness","."]
code: def __call__(self, x: np.ndarray) -> float:
      """Callable to avoid using the `pointer` property.
  
      Args:
          x: Array of positions.
  
      Returns:
          (float): Constrained single-objective function fitness.
  
      """
  
      fitness = self.pointer(x)
  
      for constraint in self.constraints:
          if constraint(x):
              pass
          else:
              fitness += self.penalty * fitness
  
      return fitness
  
file_path: opytimizer/opytimizer/functions/constrained.py
imports: from typing import List
  import numpy
  import opytimizer.utils.exception
  from opytimizer.core import Function
  from opytimizer.utils import logging
label_desc: Use image node_id 6 for calling the ConstrainedFunction obj's underlying member method code with example usage: obj.__call__(x) and returns: fitness