#NEWLINE# def calculate_map_dist( self ) : #NEWLINE# #INDENT# '\n        Calculates the grid distance, which will be used during the training steps.\n        It supports only planar grids for the moment\n        ' #NEWLINE# nnodes = self . codebook . nnodes #NEWLINE# distance_matrix = np . zeros ( ( nnodes , nnodes ) ) #NEWLINE# for i in range ( nnodes ) : #NEWLINE# #INDENT# distance_matrix [ i ] = self . codebook . grid_dist ( i ) . reshape ( 1 , nnodes ) #NEWLINE# #UNINDENT# return distance_matrix