class_docstr: `SMAC <https://www.cs.ubc.ca/~hutter/papers/10-TR-SMAC.pdf>`__ is based on Sequential Model-Based Optimization (SMBO).
  It adapts the most prominent previously used model class (Gaussian stochastic process models)
  and introduces the model class of random forests to SMBO in order to handle categorical parameters.
  
  The SMAC supported by nni is a wrapper on `the SMAC3 github repo <https://github.com/automl/SMAC3>`__,
  following NNI tuner interface :class:`nni.tuner.Tuner`. For algorithm details of SMAC, please refer to the paper
  :footcite:t:`hutter2011sequential`.
  
  Note that SMAC on nni only supports a subset of the types in
  :doc:`search space </hpo/search_space>`:
  ``choice``, ``randint``, ``uniform``, ``loguniform``, and ``quniform``.
  
  Note that SMAC needs additional installation using the following command:
  
  .. code-block:: bash
  
      pip install nni[SMAC]
  
  ``swig`` is required for SMAC. for Ubuntu ``swig`` can be installed with ``apt``.
  
  Examples
  --------
  
  .. code-block::
  
      config.tuner.name = 'SMAC'
      config.tuner.class_args = {
          'optimize_mode': 'maximize'
      }
  
  Parameters
  ----------
  optimize_mode : str
      Optimize mode, 'maximize' or 'minimize', by default 'maximize'
  config_dedup : bool
      If True, the tuner will not generate a configuration that has been already generated.
      If False, a configuration may be generated twice, but it is rare for relatively large search space.
docstr: Receive a trial's final performance result reported through :func:``nni.report_final_result`` by the trial.
  GridSearchTuner does not need trial's results.
  
  Parameters
  ----------
  parameter_id : int
      Unique identifier of used hyper-parameters, same with :meth:`generate_parameters`.
  parameters : dict
      Hyper-parameters generated by :meth:`generate_parameters`.
  value : dict
      Result from trial (the return value of :func:`nni.report_final_result`).
  
  Raises
  ------
  RuntimeError
      Received parameter id not in ``self.total_data``
docstr_tok: ["Receive","a","trial","'s","final","performance","result","reported","through",":","func",":","``","nni.report_final_result","``","by","the","trial",".","GridSearchTuner","does","not","need","trial","'s","results",".","Parameters","--","--","--","--","--","parameter_id",":","int","Unique","identifier","of","used","hyper-parameters",",","same","with",":","meth",":","`","generate_parameters","`",".","parameters",":","dict","Hyper-parameters","generated","by",":","meth",":","`","generate_parameters","`",".","value",":","dict","Result","from","trial","(","the","return","value","of",":","func",":","`","nni.report_final_result","`",")",".","Raises","--","--","--","RuntimeError","Received","parameter","id","not","in","``","self.total_data","``"]
code: def receive_trial_result(
      self, parameter_id, parameters, value, **kwargs
  ):
      """
      Receive a trial's final performance result reported through :func:``nni.report_final_result`` by the trial.
      GridSearchTuner does not need trial's results.
  
      Parameters
      ----------
      parameter_id : int
          Unique identifier of used hyper-parameters, same with :meth:`generate_parameters`.
      parameters : dict
          Hyper-parameters generated by :meth:`generate_parameters`.
      value : dict
          Result from trial (the return value of :func:`nni.report_final_result`).
  
      Raises
      ------
      RuntimeError
          Received parameter id not in ``self.total_data``
      """
      reward = extract_scalar_reward(value)
      if self.optimize_mode is OptimizeMode.Maximize:
          reward = -reward
  
      if parameter_id not in self.total_data:
          raise RuntimeError("Received parameter_id not in total_data.")
      if self.first_one:
          self.smbo_solver.nni_smac_receive_first_run(
              self.total_data[parameter_id], reward
          )
          self.first_one = False
      else:
          self.smbo_solver.nni_smac_receive_runs(
              self.total_data[parameter_id], reward
          )
  
imports: import logging
  import sys
  import numpy
  from schema import Schema, Optional
  from smac.facade.epils_facade import EPILS
  from smac.facade.roar_facade import ROAR
  from smac.facade.smac_facade import SMAC
  from smac.scenario.scenario import Scenario
  from smac.utils.io.cmd_reader import CMDReader
  from ConfigSpaceNNI import Configuration
  import nni
  from nni import ClassArgsValidator
  from nni.common.hpo_utils import validate_search_space
  from nni.tuner import Tuner
  from nni.utils import OptimizeMode, extract_scalar_reward
  from .convert_ss_to_scenario import generate_scenario
label_desc: Use image node_id 4 for calling the SMACTuner obj's underlying member method code with example usage: obj.receive_trial_result(parameter_id, parameters, value) without return types