original_docstring: Triggers the recursive closest node search of the Meridian system
  
          Args:
              in_msg (Message): The request of the client
          
docstring: Triggers the recursive closest node search of the Meridian system
docstring_tokens: Triggers the recursive closest node search of the Meridian system
code: def meridian_get_closest_node(self, in_msg):
          """Triggers the recursive closest node search of the Meridian system
  
          Args:
              in_msg (Message): The request of the client
          """
          start = time.perf_counter()
          sender = self.env.get_participant(in_msg.send_id)
          # If sender of the Message is another node we iniatiate the search process with the targets last ping
          if(isinstance(sender, FogNode)):
              target = in_msg.body
              # reversing in_msg_history to automatically find the newest ping
              rev_msg_history = reversed(self.in_msg_history)
              ping_from_target = next(
                  (message for message in rev_msg_history if message.send_id == target and message.msg_type == 3), None)
              orig_msg = in_msg.prev_msg
              # If there is no ping from the target something logically went wrong and we return
              if not ping_from_target:
                  return
              target_latency = ping_from_target.latency
  
          # If the sender of the message is a client, the target is the sender
          if(isinstance(sender, MobileClient)):
              target = in_msg.send_id
              target_latency = in_msg.latency
              orig_msg = in_msg
  
          ring_set = self.virtual_position.ring_set
          # Get ring number of the client
          ring_number = ring_set.get_ring_number(target_latency)
          ring = ring_set.get_ring(True, ring_number)
          # Message every member of the same ring as the client with a type 4 message: Ping request to target
          for member in ring.get('members'):
              if(member.get('id') != self.id):
                  msg = self.env.send_message(self.id, member.get('id'),
                                        {'latency': target_latency, 'target': target}, gossip=self.gossip, msg_type=4)
                  self.out_msg_history.append(msg)
          # Start meridian waiting process to collect answers
          self.meridian_requests.append({'target': target, 'measures': []})
          self.env.process(self.await_meridian_pings(
              target, in_msg.latency, orig_msg))
          self.discovery_performance = time.perf_counter() - start
code_tokens: def meridian_get_closest_node ( self , in_msg ) : start = time . perf_counter ( ) sender = self . env . get_participant ( in_msg . send_id ) if ( isinstance ( sender , FogNode ) ) : target = in_msg . body rev_msg_history = reversed ( self . in_msg_history ) ping_from_target = next ( ( message for message in rev_msg_history if message . send_id == target and message . msg_type == 3 ) , None ) orig_msg = in_msg . prev_msg if not ping_from_target : return target_latency = ping_from_target . latency if ( isinstance ( sender , MobileClient ) ) : target = in_msg . send_id target_latency = in_msg . latency orig_msg = in_msg ring_set = self . virtual_position . ring_set ring_number = ring_set . get_ring_number ( target_latency ) ring = ring_set . get_ring ( True , ring_number ) for member in ring . get ( 'members' ) : if ( member . get ( 'id' ) != self . id ) : msg = self . env . send_message ( self . id , member . get ( 'id' ) , { 'latency' : target_latency , 'target' : target } , gossip = self . gossip , msg_type = 4 ) self . out_msg_history . append ( msg ) self . meridian_requests . append ( { 'target' : target , 'measures' : [ ] } ) self . env . process ( self . await_meridian_pings ( target , in_msg . latency , orig_msg ) ) self . discovery_performance = time . perf_counter ( ) - start
short_docstring: Triggers the recursive closest node search of the Meridian system
short_docstring_tokens: Triggers the recursive closest node search of the Meridian system
comment: """Triggers the recursive closest node search of the Meridian system
  
          Args:
              in_msg (Message): The request of the client
          """$SEP$# If sender of the Message is another node we iniatiate the search process with the targets last ping
  $SEP$# reversing in_msg_history to automatically find the newest ping
  $SEP$# If there is no ping from the target something logically went wrong and we return
  $SEP$# If the sender of the message is a client, the target is the sender
  $SEP$# Get ring number of the client
  $SEP$# Message every member of the same ring as the client with a type 4 message: Ping request to target
  $SEP$# Start meridian waiting process to collect answers
  