def betweenness(self, paremeters=None): print "measuring btw" #graph_btw = self.network.betweenness() graph_btw = self.extra_network.betweenness() graph_btw_w = self.network.betweenness(weights=self.network.es['weight']) ranked_by_btw = reverseSortList(graph_btw) ranked_by_btw_w = reverseSortList(graph_btw_w) print ranked_by_btw print ranked_by_btw_w self.node_rankings['btw'] = ranked_by_btw self.node_rankings['btw_w'] = ranked_by_btw_w self.node_values['btw'] = graph_btw self.node_values['btw_w'] = graph_btw_w
def clustering_coefficient(self, paremeters=None): print "measuring cc" #graph__cc = self.network.transitivity_local_undirected() graph__cc = self.extra_network.transitivity_local_undirected() graph__cc_w = self.network.transitivity_local_undirected(weights=self.network.es['weight']) ranked_by_cc = reverseSortList(graph__cc) ranked_by_cc_w = reverseSortList(graph__cc_w) print ranked_by_cc #print ranked_by_cc_w self.node_rankings['cc'] = ranked_by_cc self.node_rankings['cc_w'] = ranked_by_cc_w self.node_values['cc'] = graph__cc self.node_values['cc_w'] = graph__cc_w
def degree(self, paremeters=None): #print "measuring degree" #graph_degree = self.network.degree() graph_degree = self.extra_network.degree() graph_stg = self.network.strength(weights=self.network.es['weight']) ranked_by_degree = reverseSortList(graph_degree) ranked_by_stg = reverseSortList(graph_stg) print ranked_by_degree #save_vector_to_file(ranked_by_degree) print ranked_by_stg self.node_rankings['dg'] = ranked_by_degree self.node_rankings['stg'] = ranked_by_stg self.node_values['dg'] = graph_degree self.node_values['stg'] = graph_stg
def page_rank(self, paremeters=None): print "measuring pr" #graph_pr = self.network.pagerank() graph_pr = self.extra_network.pagerank() graph_pr_w = self.network.pagerank(weights=self.network.es['weight']) ranked_by_pr = reverseSortList(graph_pr) ranked_by_pr_w = reverseSortList(graph_pr_w) print ranked_by_pr print ranked_by_pr_w self.node_rankings['pr'] = ranked_by_pr #save_vector_to_file(ranked_by_pr) self.node_rankings['pr_w'] = ranked_by_pr_w self.node_values['pr'] = graph_pr self.node_values['pr_w'] = graph_pr_w
def get_accs_values(self, h): command = "./CVAccessibility2 -l " + h + " " + self.location print command values = get_terminal_values(command) values = values.split('\n') values = values[:len(values) - 1] values = [float(i) for i in values] return (reverseSortList(values), values)
def sort_by_concentric(self, type, h): results = read_dat_files() measure_type = results[type] if h == 2: measure = measure_type[0] else: measure = measure_type[1] return reverseSortList(measure)
def sort_by_symmetry(self, order, type, h): #order : h - l #type: b - m #h: 2-3 if type == 'b': nType = 0 else: nType = 1 if h == '2': nH = 0 else: nH = 1 symmetries = read_csv_file() measure = symmetries[nType][nH] the_high = reverseSortList(measure) if order == 'h': return the_high else: return specialSortList(the_high)
def get_gaccs_values(self): measures = self.calculate_accesibility() measures = measures.tolist() return (utils.reverseSortList(measures), measures)
def sort_by_accesibility(self): measures = self.calculate_accesibility() measures = measures.tolist() return utils.reverseSortList(measures)