original_docstring: The node has issued other nodes to ping the target.
          Like elaborated in the meridian paper we wait (2*beta + 1)*d timesteps until we forward the best node to the target
          Nodes with no slots available simply do not answer and therefore are ignored in this process
  
          Args:
              target (target_id): ID of the target, usually a client
              d_latency (float): latency to the target
              orig_msg (Message): original message from the closest node request
  
          Yields:
              simpy.events.timeout: Waiting the given time
          
docstring: The node has issued other nodes to ping the target.
  Like elaborated in the meridian paper we wait (2*beta + 1)*d timesteps until we forward the best node to the target
  Nodes with no slots available simply do not answer and therefore are ignored in this process
docstring_tokens: The node has issued other nodes to ping the target . Like elaborated in the meridian paper we wait ( 2 * beta + 1 ) * d timesteps until we forward the best node to the target Nodes with no slots available simply do not answer and therefore are ignored in this process
code: def await_meridian_pings(self, target, d_latency, orig_msg):
          """The node has issued other nodes to ping the target.
          Like elaborated in the meridian paper we wait (2*beta + 1)*d timesteps until we forward the best node to the target
          Nodes with no slots available simply do not answer and therefore are ignored in this process
  
          Args:
              target (target_id): ID of the target, usually a client
              d_latency (float): latency to the target
              orig_msg (Message): original message from the closest node request
  
          Yields:
              simpy.events.timeout: Waiting the given time
          """
          waiting_time = (2*self.virtual_position.beta + 1)*d_latency
          yield self.env.timeout((waiting_time))
          start = time.perf_counter()
          requests = next(
              (req for req in self.meridian_requests if req.get('target') == target), None)
          if(requests.get('measures')):
              measures = requests.get('measures')
              best_node = min(measures, key=lambda x: x['latency'])
              best_node_id = best_node.get('member')
              msg = self.env.send_message(
                  self.id, best_node_id, msg=target, gossip=self.gossip, msg_type=2, prev_msg=orig_msg)
          else:
              msg = self.env.send_message(self.id, target,
                                          self.id, gossip=self.gossip, response=True, msg_type=2, prev_msg=orig_msg)
          self.out_msg_history.append(msg)
          self.meridian_requests.remove(requests)
          self.await_performance = time.perf_counter() - start
code_tokens: def await_meridian_pings ( self , target , d_latency , orig_msg ) : waiting_time = ( 2 * self . virtual_position . beta + 1 ) * d_latency yield self . env . timeout ( ( waiting_time ) ) start = time . perf_counter ( ) requests = next ( ( req for req in self . meridian_requests if req . get ( 'target' ) == target ) , None ) if ( requests . get ( 'measures' ) ) : measures = requests . get ( 'measures' ) best_node = min ( measures , key = lambda x : x [ 'latency' ] ) best_node_id = best_node . get ( 'member' ) msg = self . env . send_message ( self . id , best_node_id , msg = target , gossip = self . gossip , msg_type = 2 , prev_msg = orig_msg ) else : msg = self . env . send_message ( self . id , target , self . id , gossip = self . gossip , response = True , msg_type = 2 , prev_msg = orig_msg ) self . out_msg_history . append ( msg ) self . meridian_requests . remove ( requests ) self . await_performance = time . perf_counter ( ) - start
short_docstring: The node has issued other nodes to ping the target.
short_docstring_tokens: The node has issued other nodes to ping the target .
comment: """The node has issued other nodes to ping the target.
          Like elaborated in the meridian paper we wait (2*beta + 1)*d timesteps until we forward the best node to the target
          Nodes with no slots available simply do not answer and therefore are ignored in this process
  
          Args:
              target (target_id): ID of the target, usually a client
              d_latency (float): latency to the target
              orig_msg (Message): original message from the closest node request
  
          Yields:
              simpy.events.timeout: Waiting the given time
          """