ioh.wrap_problem(function: ~typing.Callable[[~typing.List[~typing.Union[int, float]]], float], name: ~typing.Optional[str] = None, problem_class: ~ioh.ProblemClass = ProblemClass.REAL, dimension: int = 5, instance: int = 1, optimization_type: ~ioh.iohcpp.OptimizationType = <OptimizationType.MIN: 0>, lb: ~typing.Union[int, float] = 0, ub: ~typing.Union[int, float] = 1, transform_variables: ~typing.Optional[~typing.Callable[[~typing.List[~typing.Union[int, float]], int], ~typing.List[~typing.Union[int, float]]]] = None, transform_objectives: ~typing.Optional[~typing.Callable[[float, int], float]] = None, calculate_objective: ~typing.Optional[~typing.Callable[[int, int], ~typing.Union[~ioh.iohcpp.IntegerSolution, ~ioh.iohcpp.RealSolution]]] = None, constraints: ~typing.Optional[~typing.List[~typing.Union[~ioh.iohcpp.IntegerConstraint, ~ioh.iohcpp.RealConstraint]]] = None) Union[RealSingleObjective, IntegerSingleObjective]#

Function to wrap a callable as an ioh function

  • function (fn(x: list) -> float) – The callable to wrap

  • name (str = None) – The name of the function. This can be used to create new instances of this function. Note, when not using unique names, this will override the previously wrapped functions.

  • problem_class (ProblemClass = ProblemClass.REAL) – The type of the problem.

  • dimension (int = 5) – The dimension (number of variables) of the problem

  • instance (int = 1) – The instance ID of the problem

  • optimization_type (OptimizationType = OptimizationType.MIN) – The type of optimization to do, maximization or minimization

  • lb ([int, float] = 0) – The lower bound of the constraint, should be the same type as problem_class. Defaults to 0

  • ub ([int, float] = 1) – The upper bound of the constraint, should be the same type as problem_class. Defaults to 1

  • transform_variables (fn(x: list) -> list = None) – A function to transform the elements of x, prior to calling the function.

  • transform_objectives (fn(y: float) -> float = None) – A function to tranform the float value of y, after callling the function.

  • calculate_objective (fn(instance, dimension) -> Solution | (x, y) = None) – A function to calculate the global optimum of the function. This function gets a dimension and instance id, and should return either a Solution objective(IntegerSolution or RealSolution) or a tuple giving the x and y values for the global optimum. Where x is the search space representation and y the target value.

  • constraints (list[IntegerConstraint | RealConstraint] = None) – The constraints applied to the problem