docstr: Static helper method to compute Delannoy numbers
  
  This method computes the number of neighbours of a Von Neumann
  topology, i.e. a Delannoy number, dependent on the range and the
  dimension of the search space. The Delannoy numbers are computed
  recursively.
  
  Parameters
  ----------
  d : int
      dimension of the search space
  r : int
      range of the Von Neumann topology
  
  Returns
  -------
  int
      Delannoy number
docstr_tok: ["Static","helper","method","to","compute","Delannoy","numbers","This","method","computes","the","number","of","neighbours","of","a","Von","Neumann","topology",",","i.e",".","a","Delannoy","number",",","dependent","on","the","range","and","the","dimension","of","the","search","space",".","The","Delannoy","numbers","are","computed","recursively",".","Parameters","--","--","--","--","--","d",":","int","dimension","of","the","search","space","r",":","int","range","of","the","Von","Neumann","topology","Returns","--","--","--","-","int","Delannoy","number"]
code: def delannoy(d, r):
      """Static helper method to compute Delannoy numbers
  
      This method computes the number of neighbours of a Von Neumann
      topology, i.e. a Delannoy number, dependent on the range and the
      dimension of the search space. The Delannoy numbers are computed
      recursively.
  
      Parameters
      ----------
      d : int
          dimension of the search space
      r : int
          range of the Von Neumann topology
  
      Returns
      -------
      int
          Delannoy number"""
      if d == 0 or r == 0:
          return 1
      else:
          del_number = (
              VonNeumann.delannoy(d - 1, r)
              + VonNeumann.delannoy(d - 1, r - 1)
              + VonNeumann.delannoy(d, r - 1)
          )
          return del_number
  
file_path: pyswarms/pyswarms/backend/topology/von_neumann.py
imports: import logging
  from ...utils.reporter import Reporter
  from .ring import Ring
label_desc: Use image node_id 3 for calling the VonNeumann obj's underlying member method code with example usage: obj.delannoy(d, r) and returns: int, del_number