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: Initialization method.
  
  Args:
      pointer: Pointer to a function that will return the fitness value.
      constraints: Constraints to be applied to the fitness function.
      penalty: Penalization factor when a constraint is not valid.
docstr_tok: ["Initialization","method",".","Args",":","pointer",":","Pointer","to","a","function","that","will","return","the","fitness","value",".","constraints",":","Constraints","to","be","applied","to","the","fitness","function",".","penalty",":","Penalization","factor","when","a","constraint","is","not","valid","."]
code: def __init__(
      self,
      pointer: List[callable],
      constraints: List[callable],
      penalty: float = 0.0,
  ) -> None:
      """Initialization method.
  
      Args:
          pointer: Pointer to a function that will return the fitness value.
          constraints: Constraints to be applied to the fitness function.
          penalty: Penalization factor when a constraint is not valid.
  
      """
  
      logger.info("Overriding class: Function -> ConstrainedFunction.")
  
      super(ConstrainedFunction, self).__init__(pointer)
  
      self.constraints = constraints or []
      self.penalty = penalty
  
      logger.debug(
          "Constraints: %s | Penalty: %s.",
          self.constraints,
          self.penalty,
      )
      logger.info("Class overrided.")
  
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 1 to create a new ConstrainedFunction object from inherited base classes: Function with example: obj = ConstrainedFunction(pointer, constraints, penalty)