original_docstring: Probing process to continually update the virtual position
  
          Yields:
              simpy.Event.timeout: timeout event which decides the probing interval
          
docstring: Probing process to continually update the virtual position
docstring_tokens: Probing process to continually update the virtual position
code: def probe_network(self):
          """Probing process to continually update the virtual position
  
          Yields:
              simpy.Event.timeout: timeout event which decides the probing interval
          """
          my_random = Random(self.id)
          yield self.env.timeout(my_random.randint(1,1000)/1000)
          # Initially probe every node in the network once. Is needed for meridian and cannot harm other protocols either
          for node in self.env.nodes:
              probe_node = node.get('id')
              # We dont want to send messages to ourself
              if probe_node != self.id:
                  out_msg = self.env.send_message(
                      self.id, probe_node, "Probing network at start", gossip=self.gossip, response=False, msg_type=3)
                  self.out_msg_history.append(out_msg)
  
          self.neighbours = self.env.get_neighbours(self)
          while(True):
              # Search for random node, which is not self as proposed by Dabek et al at 50% of the time, otherwise probe neighbourhood
              if my_random.randint(1, 100) < 50:
                  while(True):
                      probe_node = self.env.get_random_node()
                      if(probe_node != self.id):
                          break
              else:
                  probe_node = random.choice(self.neighbours)["id"]
              out_msg = self.env.send_message(
                  self.id, probe_node, "Probing network", gossip=self.gossip, response=False, msg_type=3)
              self.out_msg_history.append(out_msg)
              # unnecessary complex timeout for the probing process
              # idea is the longer the newtork is established the less probes are necessary
              # Randomness is to avoid all nodes to probe at the exact same moment
              timeout = math.log(
                  self.env.now + 1) if math.log(self.env.now + 1) < 2 else 2
              yield self.env.timeout(timeout + my_random.random())
code_tokens: def probe_network ( self ) : my_random = Random ( self . id ) yield self . env . timeout ( my_random . randint ( 1 , 1000 ) / 1000 ) for node in self . env . nodes : probe_node = node . get ( 'id' ) if probe_node != self . id : out_msg = self . env . send_message ( self . id , probe_node , "Probing network at start" , gossip = self . gossip , response = False , msg_type = 3 ) self . out_msg_history . append ( out_msg ) self . neighbours = self . env . get_neighbours ( self ) while ( True ) : if my_random . randint ( 1 , 100 ) < 50 : while ( True ) : probe_node = self . env . get_random_node ( ) if ( probe_node != self . id ) : break else : probe_node = random . choice ( self . neighbours ) [ "id" ] out_msg = self . env . send_message ( self . id , probe_node , "Probing network" , gossip = self . gossip , response = False , msg_type = 3 ) self . out_msg_history . append ( out_msg ) timeout = math . log ( self . env . now + 1 ) if math . log ( self . env . now + 1 ) < 2 else 2 yield self . env . timeout ( timeout + my_random . random ( ) )
short_docstring: Probing process to continually update the virtual position
short_docstring_tokens: Probing process to continually update the virtual position
comment: """Probing process to continually update the virtual position
  
          Yields:
              simpy.Event.timeout: timeout event which decides the probing interval
          """$SEP$# Initially probe every node in the network once. Is needed for meridian and cannot harm other protocols either
  $SEP$# We dont want to send messages to ourself
  $SEP$# Search for random node, which is not self as proposed by Dabek et al at 50% of the time, otherwise probe neighbourhood
  $SEP$# unnecessary complex timeout for the probing process
  $SEP$# idea is the longer the newtork is established the less probes are necessary
  $SEP$# Randomness is to avoid all nodes to probe at the exact same moment
  