original_docstring: Wrapper function to update the virtual position of the Fog Node
          Calls the corresponding update mechanism depending on the discovery protcol
  
          Args:
              in_msg (Message): Incoming message upon which the virtual position should be updated
          
docstring: Wrapper function to update the virtual position of the Fog Node
  Calls the corresponding update mechanism depending on the discovery protcol
docstring_tokens: Wrapper function to update the virtual position of the Fog Node Calls the corresponding update mechanism depending on the discovery protcol
code: def update_virtual_position(self, in_msg):
          """Wrapper function to update the virtual position of the Fog Node
          Calls the corresponding update mechanism depending on the discovery protcol
  
          Args:
              in_msg (Message): Incoming message upon which the virtual position should be updated
          """
          if self.discovery_protocol == "baseline" or self.discovery_protocol == "random":
              return
  
          sender_news = next(
              (news for news in in_msg.gossip if news.get('id') == in_msg.send_id), None)
          # should not happen but just in case
          if not sender_news:
              print("whooopsies")
              return
  
          virtual_position = sender_news.get('position')
  
          if self.discovery_protocol == "vivaldi":
              cj = virtual_position
              ej = cj.getErrorEstimate()
              rtt = self.calculate_rtt(in_msg)
  
              try:
                  self.get_virtual_position().update(rtt, cj, ej)
              except ValueError as e:
                  print(
                      "Node {} TypeError at update VivaldiPosition: {}".format(self.id, e))
  
          elif self.discovery_protocol == "meridian":
              self.virtual_position.add_node(
                  in_msg.send_id, in_msg.latency, virtual_position.get_vector())
code_tokens: def update_virtual_position ( self , in_msg ) : if self . discovery_protocol == "baseline" or self . discovery_protocol == "random" : return sender_news = next ( ( news for news in in_msg . gossip if news . get ( 'id' ) == in_msg . send_id ) , None ) if not sender_news : print ( "whooopsies" ) return virtual_position = sender_news . get ( 'position' ) if self . discovery_protocol == "vivaldi" : cj = virtual_position ej = cj . getErrorEstimate ( ) rtt = self . calculate_rtt ( in_msg ) try : self . get_virtual_position ( ) . update ( rtt , cj , ej ) except ValueError as e : print ( "Node {} TypeError at update VivaldiPosition: {}" . format ( self . id , e ) ) elif self . discovery_protocol == "meridian" : self . virtual_position . add_node ( in_msg . send_id , in_msg . latency , virtual_position . get_vector ( ) )
short_docstring: Wrapper function to update the virtual position of the Fog Node
  Calls the corresponding update mechanism depending on the discovery protcol
short_docstring_tokens: Wrapper function to update the virtual position of the Fog Node Calls the corresponding update mechanism depending on the discovery protcol
comment: """Wrapper function to update the virtual position of the Fog Node
          Calls the corresponding update mechanism depending on the discovery protcol
  
          Args:
              in_msg (Message): Incoming message upon which the virtual position should be updated
          """$SEP$# should not happen but just in case
  