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: Initialization method.
  
  Args:
      n_agents: Number of agents (trees).
      n_variables: Number of decision variables.
      lower_bound: Minimum possible values.
      upper_bound: Maximum possible values.
      n_terminals: Number of terminal nodes.
      min_depth: Minimum depth of the trees.
      max_depth: Maximum depth of the trees.
      functions: Function nodes.
      mapping: String-based identifiers for mapping variables' names.
docstr_tok: ["Initialization","method",".","Args",":","n_agents",":","Number","of","agents","(","trees",")",".","n_variables",":","Number","of","decision","variables",".","lower_bound",":","Minimum","possible","values",".","upper_bound",":","Maximum","possible","values",".","n_terminals",":","Number","of","terminal","nodes",".","min_depth",":","Minimum","depth","of","the","trees",".","max_depth",":","Maximum","depth","of","the","trees",".","functions",":","Function","nodes",".","mapping",":","String-based","identifiers","for","mapping","variables","'","names","."]
code: def __init__(
      self,
      n_agents: int,
      n_variables: int,
      lower_bound: Union[float, List, Tuple, np.ndarray],
      upper_bound: Union[float, List, Tuple, np.ndarray],
      n_terminals: int = 1,
      min_depth: int = 1,
      max_depth: int = 3,
      functions: Optional[List[str]] = None,
      mapping: Optional[List[str]] = None,
  ) -> None:
      """Initialization method.
  
      Args:
          n_agents: Number of agents (trees).
          n_variables: Number of decision variables.
          lower_bound: Minimum possible values.
          upper_bound: Maximum possible values.
          n_terminals: Number of terminal nodes.
          min_depth: Minimum depth of the trees.
          max_depth: Maximum depth of the trees.
          functions: Function nodes.
          mapping: String-based identifiers for mapping variables' names.
  
      """
  
      logger.info("Overriding class: Space -> TreeSpace.")
  
      n_dimensions = 1
  
      super(TreeSpace, self).__init__(
          n_agents,
          n_variables,
          n_dimensions,
          lower_bound,
          upper_bound,
          mapping,
      )
  
      self.n_terminals = n_terminals
  
      self.min_depth = min_depth
      self.max_depth = max_depth
  
      if functions is None:
          self.functions = []
      else:
          self.functions = functions
  
      self._create_terminals()
      self._create_trees()
  
      self.build()
  
      logger.info("Class overrided.")
  
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 1 to create a new TreeSpace object from inherited base classes: Space with example: obj = TreeSpace(n_agents, n_variables, lower_bound, upper_bound, n_terminals, min_depth, max_depth, functions, mapping)