class_docstr: Non-dominated ranking of NSGA-II proposed by Deb et al., see [Deb2002]
docstr: Compare the domainance relation of two candidates.
  
  :param candidate1: Candidate.
  :param candidate2: Candidate.
code: def compare(
      self, candidate1: p.Parameter, candidate2: p.Parameter
  ) -> int:
      """Compare the domainance relation of two candidates.
  
      :param candidate1: Candidate.
      :param candidate2: Candidate.
      """
      one_wins = np.sum(candidate1.losses < candidate2.losses)
      two_wins = np.sum(candidate2.losses < candidate1.losses)
      if one_wins > two_wins:
          return -1
      if two_wins > one_wins:
          return 1
      return 0
  
file_path: nevergrad/nevergrad/optimization/multiobjective/nsga2.py
imports: import logging
  import numpy
  import nevergrad.common.typing
  from nevergrad.parametrization import parameter
label_desc: Use image node_id 1 for calling the FastNonDominatedRanking obj's underlying member method code with example usage: obj.compare(candidate1, candidate2) and returns: int, unknown, int