class_docstr: A TreeSpace class for trees, agents, variables and methods
  related to a tree-based search space.
class_docstr_tok: ["A","TreeSpace","class","for","trees",",","agents",",","variables","and","methods","related","to","a","tree-based","search","space","."]
docstr: Creates a random tree based on the GROW algorithm.
  
  References:
      S. Luke. Two Fast Tree-Creation Algorithms for Genetic Programming.
      IEEE Transactions on Evolutionary Computation (2000).
  
  Args:
      min_depth: Minimum depth of the tree.
      max_depth: Maximum depth of the tree.
  
  Returns:
      (Node): Random tree based on the GROW algorithm.
docstr_tok: ["Creates","a","random","tree","based","on","the","GROW","algorithm",".","References",":","S.","Luke",".","Two","Fast","Tree-Creation","Algorithms","for","Genetic","Programming",".","IEEE","Transactions","on","Evolutionary","Computation","(","2000",")",".","Args",":","min_depth",":","Minimum","depth","of","the","tree",".","max_depth",":","Maximum","depth","of","the","tree",".","Returns",":","(","Node",")",":","Random","tree","based","on","the","GROW","algorithm","."]
code: def grow(self, min_depth: int = 1, max_depth: int = 3) -> Node:
      """Creates a random tree based on the GROW algorithm.
  
      References:
          S. Luke. Two Fast Tree-Creation Algorithms for Genetic Programming.
          IEEE Transactions on Evolutionary Computation (2000).
  
      Args:
          min_depth: Minimum depth of the tree.
          max_depth: Maximum depth of the tree.
  
      Returns:
          (Node): Random tree based on the GROW algorithm.
  
      """
  
      if min_depth == max_depth:
          terminal_id = r.generate_integer_random_number(
              0, self.n_terminals
          )
  
          return Node(
              terminal_id,
              "TERMINAL",
              self.terminals[terminal_id].position,
          )
  
      node_id = r.generate_integer_random_number(
          0, len(self.functions) + self.n_terminals
      )
  
      if node_id >= len(self.functions):
          terminal_id = node_id - len(self.functions)
  
          return Node(
              terminal_id,
              "TERMINAL",
              self.terminals[terminal_id].position,
          )
  
      function_node = Node(self.functions[node_id], "FUNCTION")
  
      for i in range(c.FUNCTION_N_ARGS[self.functions[node_id]]):
          node = self.grow(min_depth + 1, max_depth)
  
          if not i:
              function_node.left = node
          else:
              function_node.right = node
              node.flag = False
  
          node.parent = function_node
  
      return function_node
  
imports: import copy
  from typing import List, Optional, Tuple, Union
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.constant
  import opytimizer.utils.exception
  from opytimizer.core import Agent, Node, Space
  from opytimizer.utils import logging
label_desc: Use image node_id 19 for calling the TreeSpace obj's underlying member method code with example usage: obj.grow(min_depth, max_depth) and returns: function_node, Node, Node