class_docstr: Truncate Exploit
  
  If the given trial is under a ``truncation_quantile`` compared to all other trials that
  has reached the same fidelity level, then a new candidate trial is selected for forking.
  The new candidate is selected from a pool of best ``candidate_pool_ratio``\% of the available
  trials at the same fidelity level.
  
  If there are less than ``min_forking_population`` trials that have reached the fidelity level
  as the passed trial, then `None` is return to signal that we should reconsider this trial later
  on when more trials are completed at this fidelity level.
  
  Parameters
  ----------
  min_forking_population: int, optional
      Minimum number of trials that should be completed up to the fidelity level of the current
      trial passed. TruncateExploit will return ``None`` when this requirement is not met.
      Default: 5
  truncation_quantile: float, optional
      If the passed trial's objective is above quantile ``truncation_quantile``, then another
      candidate is considered for forking. Default: 0.8
  candidate_pool_ratio: float, optional
      When choosing another candidate for forking, it will be randomly selected from the
      best ``candidate_pool_ratio``\% of the available trials. Default: 0.2
class_docstr_tok: ["Truncate","Exploit","If","the","given","trial","is","under","a","``","truncation_quantile","``","compared","to","all","other","trials","that","has","reached","the","same","fidelity","level",",","then","a","new","candidate","trial","is","selected","for","forking",".","The","new","candidate","is","selected","from","a","pool","of","best","``","candidate_pool_ratio","``","\\","%","of","the","available","trials","at","the","same","fidelity","level",".","If","there","are","less","than","``","min_forking_population","``","trials","that","have","reached","the","fidelity","level","as","the","passed","trial",",","then","`","None","`","is","return","to","signal","that","we","should","reconsider","this","trial","later","on","when","more","trials","are","completed","at","this","fidelity","level",".","Parameters","--","--","--","--","--","min_forking_population",":","int",",","optional","Minimum","number","of","trials","that","should","be","completed","up","to","the","fidelity","level","of","the","current","trial","passed",".","TruncateExploit","will","return","``","None","``","when","this","requirement","is","not","met",".","Default",":","5","truncation_quantile",":","float",",","optional","If","the","passed","trial","'s","objective","is","above","quantile","``","truncation_quantile","``",",","then","another","candidate","is","considered","for","forking",".","Default",":","0.8","candidate_pool_ratio",":","float",",","optional","When","choosing","another","candidate","for","forking",",","it","will","be","randomly","selected","from","the","best","``","candidate_pool_ratio","``","\\","%","of","the","available","trials",".","Default",":","0.2"]
docstr: Select other trial if current one not good enough
  
  If the given trial is under a ``self.truncation_quantile`` compared to all other trials that
  has reached the same fidelity level, then a new candidate trial is selected for forking.
  The new candidate is selected from a pool of best ``self.candidate_pool_ratio``\% of the
  available trials at the same fidelity level.
  
  If there are less than ``self.min_forking_population`` trials that have reached the fidelity
  level as the passed trial, then `None` is return to signal that we should reconsider this
  trial later on when more trials are completed at this fidelity level.
  
  Parameters
  ----------
  rng: numpy.random.Generator
      A random number generator. It is not contained in ``BaseExploit`` because the exploit
      class must be stateless.
  trial: Trial
      The :py:class:`orion.core.worker.trial.Trial` that is currently under examination.
  lineages: Lineages
      All :py:class:`orion.algo.pbt.pbt.Lineages` created by the population based training
      algorithm that is using this exploit class.
  
  Returns
  -------
  ``None``
      The exploit class signals that there are not enough completed trials in lineages to make
      a decision for current trial.
  ``Trial``
      If the returned trial is the same as the one received as argument, it means that
      population based training should continue with same parameters.
      If another trial from the lineages is returned, it means that population based training
      should try to explore new parameters.
docstr_tok: ["Select","other","trial","if","current","one","not","good","enough","If","the","given","trial","is","under","a","``","self.truncation_quantile","``","compared","to","all","other","trials","that","has","reached","the","same","fidelity","level",",","then","a","new","candidate","trial","is","selected","for","forking",".","The","new","candidate","is","selected","from","a","pool","of","best","``","self.candidate_pool_ratio","``","\\","%","of","the","available","trials","at","the","same","fidelity","level",".","If","there","are","less","than","``","self.min_forking_population","``","trials","that","have","reached","the","fidelity","level","as","the","passed","trial",",","then","`","None","`","is","return","to","signal","that","we","should","reconsider","this","trial","later","on","when","more","trials","are","completed","at","this","fidelity","level",".","Parameters","--","--","--","--","--","rng",":","numpy.random.Generator","A","random","number","generator",".","It","is","not","contained","in","``","BaseExploit","``","because","the","exploit","class","must","be","stateless",".","trial",":","Trial","The",":","py",":","class",":","`","orion.core.worker.trial.Trial","`","that","is","currently","under","examination",".","lineages",":","Lineages","All",":","py",":","class",":","`","orion.algo.pbt.pbt.Lineages","`","created","by","the","population","based","training","algorithm","that","is","using","this","exploit","class",".","Returns","--","--","--","-","``","None","``","The","exploit","class","signals","that","there","are","not","enough","completed","trials","in","lineages","to","make","a","decision","for","current","trial",".","``","Trial","``","If","the","returned","trial","is","the","same","as","the","one","received","as","argument",",","it","means","that","population","based","training","should","continue","with","same","parameters",".","If","another","trial","from","the","lineages","is","returned",",","it","means","that","population","based","training","should","try","to","explore","new","parameters","."]
code: def __call__(self, rng, trial, lineages):
      """Select other trial if current one not good enough
  
      If the given trial is under a ``self.truncation_quantile`` compared to all other trials that
      has reached the same fidelity level, then a new candidate trial is selected for forking.
      The new candidate is selected from a pool of best ``self.candidate_pool_ratio``\\% of the
      available trials at the same fidelity level.
  
      If there are less than ``self.min_forking_population`` trials that have reached the fidelity
      level as the passed trial, then `None` is return to signal that we should reconsider this
      trial later on when more trials are completed at this fidelity level.
  
      Parameters
      ----------
      rng: numpy.random.Generator
          A random number generator. It is not contained in ``BaseExploit`` because the exploit
          class must be stateless.
      trial: Trial
          The :py:class:`orion.core.worker.trial.Trial` that is currently under examination.
      lineages: Lineages
          All :py:class:`orion.algo.pbt.pbt.Lineages` created by the population based training
          algorithm that is using this exploit class.
  
      Returns
      -------
      ``None``
          The exploit class signals that there are not enough completed trials in lineages to make
          a decision for current trial.
      ``Trial``
          If the returned trial is the same as the one received as argument, it means that
          population based training should continue with same parameters.
          If another trial from the lineages is returned, it means that population based training
          should try to explore new parameters.
  
      """
  
      trials = lineages.get_trials_at_depth(trial)
      return self._truncate(rng, trial, trials)
  
imports: import logging
  import numpy
  from orion.core.utils import GenericFactory
label_desc: Use image node_id 2 for calling the TruncateExploit obj's underlying member method code with example usage: obj.__call__(rng, trial, lineages) and returns: self