class_docstr: Interface of an event handler API for hyperparameter search.
  
  Unlike TrialSchedulers, SearchAlgorithms will not have the ability
  to modify the execution (i.e., stop and pause trials).
  
  Trials added manually (i.e., via the Client API) will also notify
  this class upon new events, so custom search algorithms should
  maintain a list of trials ID generated from this class.
  
  See also: `ray.tune.search.BasicVariantGenerator`.
class_docstr_tok: ["Interface","of","an","event","handler","API","for","hyperparameter","search",".","Unlike","TrialSchedulers",",","SearchAlgorithms","will","not","have","the","ability","to","modify","the","execution","(","i.e.",",","stop","and","pause","trials",")",".","Trials","added","manually","(","i.e.",",","via","the","Client","API",")","will","also","notify","this","class","upon","new","events",",","so","custom","search","algorithms","should","maintain","a","list","of","trials","ID","generated","from","this","class",".","See","also",":","`","ray.tune.search.BasicVariantGenerator","`","."]
docstr: Pass search properties to search algorithm.
  
  This method acts as an alternative to instantiating search algorithms
  with their own specific search spaces. Instead they can accept a
  Tune config through this method.
  
  The search algorithm will usually pass this method to their
  ``Searcher`` instance.
  
  Args:
      metric: Metric to optimize
      mode: One of ["min", "max"]. Direction to optimize.
      config: Tune config dict.
      **spec: Any kwargs for forward compatiblity.
          Info like Experiment.PUBLIC_KEYS is provided through here.
docstr_tok: ["Pass","search","properties","to","search","algorithm",".","This","method","acts","as","an","alternative","to","instantiating","search","algorithms","with","their","own","specific","search","spaces",".","Instead","they","can","accept","a","Tune","config","through","this","method",".","The","search","algorithm","will","usually","pass","this","method","to","their","``","Searcher","``","instance",".","Args",":","metric",":","Metric","to","optimize","mode",":","One","of","[","``","min","''",",","``","max","''","]",".","Direction","to","optimize",".","config",":","Tune","config","dict",".","*","*","spec",":","Any","kwargs","for","forward","compatiblity",".","Info","like","Experiment.PUBLIC_KEYS","is","provided","through","here","."]
code: def set_search_properties(
      self,
      metric: Optional[str],
      mode: Optional[str],
      config: Dict,
      **spec,
  ) -> bool:
      """Pass search properties to search algorithm.
  
      This method acts as an alternative to instantiating search algorithms
      with their own specific search spaces. Instead they can accept a
      Tune config through this method.
  
      The search algorithm will usually pass this method to their
      ``Searcher`` instance.
  
      Args:
          metric: Metric to optimize
          mode: One of ["min", "max"]. Direction to optimize.
          config: Tune config dict.
          **spec: Any kwargs for forward compatiblity.
              Info like Experiment.PUBLIC_KEYS is provided through here.
      """
      if self._metric and metric:
          return False
      if metric:
          self._metric = metric
      return True
  
file_path: ray/python/ray/tune/search/search_algorithm.py
imports: from typing import Dict, List, Optional, Union, TYPE_CHECKING
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 2 for calling the SearchAlgorithm obj's underlying member method code with example usage: obj.set_search_properties(metric, mode, config) and returns: True, False