class_docstr: Penalty 1 objective function.
  
  This class defines the Penalty 1 [1]_ global optimization problem. This is a
  imultimodal minimization problem defined as follows:
  
  .. math::
  
      f_{\text{Penalty01}}(x) = \frac{\pi}{30} \left\{10 \sin^2(\pi y_1)
      + \sum_{i=1}^{n-1} (y_i - 1)^2 \left[1 + 10 \sin^2(\pi y_{i+1}) \right]
      + (y_n - 1)^2 \right \} + \sum_{i=1}^n u(x_i, 10, 100, 4)
  
  
  Where, in this exercise:
  
  .. math::
  
      y_i = 1 + \frac{1}{4}(x_i + 1)
  
  
  And:
  
  .. math::
  
      u(x_i, a, k, m) =
      \begin{cases}
      k(x_i - a)^m & \textrm{if} \hspace{5pt} x_i > a \\
      0 & \textrm{if} \hspace{5pt} -a \leq x_i \leq a \\
      k(-x_i - a)^m & \textrm{if} \hspace{5pt} x_i < -a 
      \end{cases}
  
  
  Here, :math:`n` represents the number of dimensions and
  :math:`x_i \in [-50, 50]` for :math:`i= 1, ..., n`.
  
  *Global optimum*: :math:`f(x) = 0` for :math:`x_i = -1` for
  :math:`i = 1, ..., n`
  
  .. [1] Gavana, A. Global Optimization Benchmarks and AMPGO retrieved 2015
class_docstr_tok: ["Penalty","1","objective","function",".","This","class","defines","the","Penalty","1","[","1","]","_","global","optimization","problem",".","This","is","a","imultimodal","minimization","problem","defined","as","follows",":","..","math",":",":","f_","{","\\text","{","Penalty01","}","}","(","x",")","=","\\frac","{","\\pi","}","{","30","}","\\left\\","{","10","\\sin^2","(","\\pi","y_1",")","+","\\sum_","{","i=1","}","^","{","n-1","}","(","y_i","-","1",")","^2","\\left","[","1","+","10","\\sin^2","(","\\pi","y_","{","i+1","}",")","\\right","]","+","(","y_n","-","1",")","^2","\\right","\\","}","+","\\sum_","{","i=1","}","^n","u","(","x_i",",","10",",","100",",","4",")","Where",",","in","this","exercise",":","..","math",":",":","y_i","=","1","+","\\frac","{","1","}","{","4","}","(","x_i","+","1",")","And",":","..","math",":",":","u","(","x_i",",","a",",","k",",","m",")","=","\\begin","{","cases","}","k","(","x_i","-","a",")","^m","&","\\textrm","{","if","}","\\hspace","{","5pt","}","x_i",">","a","\\\\","0","&","\\textrm","{","if","}","\\hspace","{","5pt","}","-a","\\leq","x_i","\\leq","a","\\\\","k","(","-x_i","-","a",")","^m","&","\\textrm","{","if","}","\\hspace","{","5pt","}","x_i","<","-a","\\end","{","cases","}","Here",",",":","math",":","`","n","`","represents","the","number","of","dimensions","and",":","math",":","`","x_i","\\in","[","-50",",","50","]","`","for",":","math",":","`","i=","1",",","...",",","n","`",".","*","Global","optimum","*",":",":","math",":","`","f","(","x",")","=","0","`","for",":","math",":","`","x_i","=","-1","`","for",":","math",":","`","i","=","1",",","...",",","n","`","..","[","1","]","Gavana",",","A",".","Global","Optimization","Benchmarks","and","AMPGO","retrieved","2015"]
code: def __init__(self, dimensions=2):
      Benchmark.__init__(self, dimensions)
  
      self._bounds = list(zip([-50.0] * self.N, [50.0] * self.N))
      self.custom_bounds = ([-5.0, 5.0], [-5.0, 5.0])
  
      self.global_optimum = [[-1.0 for _ in range(self.N)]]
      self.fglob = 0.0
      self.change_dimensionality = True
  
imports: from numpy import abs, sum, sin, cos, sqrt, log, prod, where, pi, exp, arange, floor, log10, atleast_2d, zeros
  from .go_benchmark import Benchmark
label_desc: Use image node_id 1 to create a new Penalty01 object from inherited base classes: Benchmark with example: obj = Penalty01(dimensions)