def set_current_node(self, msg):
        # Logic for the first loop
        if not self.start_time:
            self.start_time = time()

        # Otherwise record the timing data
        else:
            self.end_time = time()

            # if the prior message had node information, record info from prior edge
            if self.current_node:
                self.record_timing()
            # Otherwise, reset the timer
            else:
                self.start_time = time()

        # AFTER recording data from prior edge, update info from new message
        # If the current message does not contain node information, set all info to None
        if msg.data == "Do not record":
            self.current_node = None
            self.next_node = None
            self.hum_cond = None
        # Otherwise record edge info
        else:
            [self.current_node, self.next_node,
             self.hum_cond] = msg.data.split(', ')

        # Saves file every 5 minutes or so
        if time() - self.start_pickle_timer >= 300:
            HospGraph.pickle_it(self.hosp_graph, path_and_name)
            self.start_pickle_timer = time()
    def main(self):
        for (n1, n2) in self.hosp_graph.edges():
            print("--------------------")
            print(n1, n2)
            array_no = self.hosp_graph[n1][n2]['trav_data_no']
            array_hum = self.hosp_graph[n1][n2]['trav_data_hum']
            if len(array_no + array_hum) < 2:
                self.hosp_graph.remove_edge(n1, n2)
                print('edge removed between {} and {}'.format(n1, n2))
                continue
            self.euclidean_dist(n1, n2)
            self.min_distance(n1, n2)
            self.clean_data(n1, n2)
            self.add_stats(n1, n2)

        self.nav_failure_count()

        print("total removed: {} of {}".format(self.tot_start - self.tot_end,
                                               self.tot_start))
        HospGraph.pickle_it(self.hosp_graph,
                            self.file_path + '_plus_stats_clean')