code: def dtlz2(individual, obj):
      r"""DTLZ2 multiobjective function. It returns a tuple of *obj* values.
      The individual must have at least *obj* elements.
      From: K. Deb, L. Thiele, M. Laumanns and E. Zitzler. Scalable Multi-Objective
      Optimization Test Problems. CEC 2002, p. 825 - 830, IEEE Press, 2002.
  
      :math:`g(\mathbf{x}_m) = \sum_{x_i \in \mathbf{x}_m} (x_i - 0.5)^2`
  
      :math:`f_{\text{DTLZ2}1}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \prod_{i=1}^{m-1} \cos(0.5x_i\pi)`
  
      :math:`f_{\text{DTLZ2}2}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \sin(0.5x_{m-1}\pi ) \prod_{i=1}^{m-2} \cos(0.5x_i\pi)`
  
      :math:`\ldots`
  
      :math:`f_{\text{DTLZ2}m}(\mathbf{x}) = (1 + g(\mathbf{x}_m)) \sin(0.5x_{1}\pi )`
  
      Where :math:`m` is the number of objectives and :math:`\mathbf{x}_m` is a
      vector of the remaining attributes :math:`[x_m~\ldots~x_n]` of the
      individual in :math:`n > m` dimensions.
      """
      xc = individual[: obj - 1]
      xm = individual[obj - 1 :]
      g = sum((xi - 0.5) ** 2 for xi in xm)
      f = [
          (1.0 + g)
          * reduce(mul, (cos(0.5 * xi * pi) for xi in xc), 1.0)
      ]
      f.extend(
          (1.0 + g)
          * reduce(mul, (cos(0.5 * xi * pi) for xi in xc[:m]), 1)
          * sin(0.5 * xc[m] * pi)
          for m in range(obj - 2, -1, -1)
      )
  
      return f
  
imports: import random
  from math import sin, cos, pi, exp, e, sqrt
  from operator import mul
  from functools import reduce
label_desc: Use image node_id 25 for calling a global function with example usage: dtlz2(individual, obj) and returns: f