#NEWLINE# def getDOTString( self ) : #NEWLINE# #INDENT# '\n        Get the trail in .dot compatible format.\n        ' #NEWLINE# result = '' #NEWLINE# data = self . getData ( ) #NEWLINE# last_node = '' #NEWLINE# last_probability = None #NEWLINE# for ( idx , entry ) in enumerate ( data ) : #NEWLINE# #INDENT# new_node = 'rnd{}' . format ( idx ) #NEWLINE# for value in entry [ : ( - 1 ) ] : #NEWLINE# #INDENT# new_node += str ( value ) #NEWLINE# #UNINDENT# result += ( new_node + ' [label="{},{}"];\n' . format ( entry [ 0 ] , entry [ 1 ] ) ) #NEWLINE# if ( last_node != '' ) : #NEWLINE# #INDENT# result += '{} -> {} [label="{}"];\n' . format ( last_node , new_node , new_node ) #NEWLINE# #UNINDENT# last_probability = entry [ 2 ] #NEWLINE# last_node = new_node #NEWLINE# #UNINDENT# return result